The Media Session API's MediaPositionState
dictionary is used to represent the current playback position of a media session. Its contents can be used by the user agent to provide a user interface displaying information about the playback position and duration of the media currently being performed.
Properties
duration
- A floating-point value giving the total duration of the current media in seconds. This should always be a positive number, with positive infinity (
Infinity
) indicating media without a defined end, such as a live stream. playbackRate
- A floating-point value indicating the rate at which the media is being played, as a ratio relative to its normal playback speed. Thus, a value of 1 is playing at normal speed, 2 is playing at double speed, and so forth. Negative values indicate that the media is playing in reverse; -1 indicates playback at the normal speed but backward, -2 is double speed in reverse, and so on.
position
- A floating-point value indicating the last reported playback position of the media in seconds. This must always be a positive value.
Specifications
Specification | Status | Comment |
---|---|---|
Media Session Standard The definition of 'MediaPositionState' in that specification. |
Draft | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
No compatibility data found. Please contribute data for "api.MediaPositionState" (depth: 1) to the MDN compatibility data repository.