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.
Whether preferences are currently being persisted.
Detaches all player event listeners. Call when the UI instance is released.
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.
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
UIManageronly has to create, configure and release it rather than wiring up the player lifecycle by hand.Persistence is gated by an
enabledflag that is itself persisted. Integrators can switch it on by default viaUIConfig.enablePersistentPreferences, and/or expose an end-user opt-in toggle viaUIConfig.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).