bitmovin-player-ui
    Preparing search index...

    Class UIPreferencesManager

    Persists a small set of cross-session UI preferences (volume, mute state, playback speed) into localStorage and reapplies them whenever a player using this UI is initialized.

    Follows the same ownership model as SubtitleSettingsManager: the manager subscribes to the relevant player events itself and tears them down on release, so the UIManager only has to create, configure and release it rather than wiring up the player lifecycle by hand.

    Persistence is gated by an enabled flag that is itself persisted. Integrators can switch it on by default via UIConfig.enablePersistentPreferences, and/or expose an end-user opt-in toggle via UIConfig.showPersistentPreferencesToggle. While disabled the manager holds no player subscriptions and stores nothing.

    All storage access routes through StorageUtils, which no-ops when storage is unavailable (private browsing, restricted WebViews, disableStorageApi).

    Index

    Constructors

    Methods

    • Wires the manager to a player. When the end-user toggle is configured, the persisted enabled flag takes precedence; otherwise enabledByDefault (the integrator's UIConfig.enablePersistentPreferences) decides. When enabled, the stored preferences are reapplied and subsequent changes are tracked.

      Parameters

      • player: PlayerAPI
      • enabledByDefault: boolean
      • respectStoredEnabled: boolean

      Returns void

    • Enables or disables persistence as an explicit end-user choice (via the toggle) and stores that choice.

      Enabling captures the player's current volume / mute / speed right away so it takes effect immediately, then tracks subsequent changes. Disabling stops tracking and clears the stored preferences so the next session starts fresh.

      Parameters

      • enabled: boolean

      Returns void