MediaSessionActionDetails.action - Web APIs 编辑
The action
property is the only required property MediaSessionActionDetails
dictionary, specifying the type of media session action which the action handler callback is being executed for.
Syntax
let mediaSessionActionDetails = { action: actionType }; let actionType = mediaSessionActionDetails.action;
Value
A DOMString
specifying which of the action types the callback is being invoked for:
nexttrack
- Advances playback to the next track.
pause
- Pauses playback of the media.
play
- Begins (or resumes) playback of the media.
previoustrack
- Moves back to the previous track.
seekbackward
- Seeks backward through the media from the current position. The
MediaSessionActionDetails
propertyseekOffset
specifies the amount of time to seek backward. seekforward
- Seeks forward from the current position through the media. The
MediaSessionActionDetails
propertyseekOffset
specifies the amount of time to seek forward. seekto
- Moves the playback position to the specified time within the media. The time to which to seek is specified in the
MediaSessionActionDetails
propertyseekTime
. If you intend to perform multipleseekto
operations in rapid succession, you can also specify theMediaSessionActionDetails
propertyfastSeek
property with a value oftrue
. This lets the browser know it can take steps to optimize repeated operations, and is likely to result in improved performance. skipad
- Skips past the currently playing advertisement or commercial. This action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances.
stop
- Halts playback entirely.
Specifications
Specification | Status | Comment |
---|---|---|
Media Session Standard The definition of 'MediaSessionActionDetails.action' in that specification. | Draft | Initial definition. |
BCD tables only load in the browser
- Media Session API
- Refer to the
MediaSession
methodsetActionHandler()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论