MediaPositionState

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.

特性

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.

规范

规范 状态 Comment
Media Session Standard
The definition of 'MediaPositionState' in that specification.
草案 初始定义。

浏览器兼容性

No compatibility data found. Please contribute data for "api.MediaPositionState" (depth: 1) to the MDN 兼容性数据存储库 .