Storing Player States - samvera-labs/ramp GitHub Wiki
Ramp uses browser's Local Storage to store some of player related states, to make the playback experience consistent across tabs, and user sessions. This feature was introduced in @samvera/[email protected].
The states Ramp keeps in Local Storage are as follows;
- mute/unmute (key: startMuted) : a Boolean value to indicate whether the player is muted or not. This value is set to
falseby default, which sets the player to unmute status. - selected source quality (key: startQuality): a String value for the label of the source quality selected in the quality selector menu in the player's control bar. This value is set to
nullby default, which allows Ramp to select eitherautosource or the first source available in the Canvas. - volume (key: startVolume): a Number between 0 and 1, to indicate the volume level of the player on page. This value is set to 1 by default, which sets the volume to maximum value.
- captions status (key: startCaptioned): a Boolean value to indicate whether captions are turned on/off in the player. This value is set to
trueby default, which turns on the captions. (added in@samvera/[email protected]) - time positions for resuming playback (key: playbackPositions): an Array of
{ key: canvasURL<String>, value: { time<Float>, savedAt<Number> } }like entries. This feature is turned OFF by default in Ramp, and can be turned ON usingresumeCacheprop inMediaPlayercomponent (read more in docs). This array is implemented as an LRU (least-recently-used) cache, which creates, updates, and deletes Canvas entries based on LRU principle. More information on this feature is documented under the MediaPlayer component. (added in@samvera/[email protected])
These values are changed as the user interacts with the player and stored in Local Storage in the browser.