blob: 8671af5acd9205978e1828502245ba134258c1e9 [file] [log] [blame]
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
// Source: Media Session Standard (https://w3c.github.io/mediasession/)
[Exposed=Window]
partial interface Navigator {
[SameObject] readonly attribute MediaSession mediaSession;
};
enum MediaSessionPlaybackState {
"none",
"paused",
"playing"
};
enum MediaSessionAction {
"play",
"pause",
"seekbackward",
"seekforward",
"previoustrack",
"nexttrack",
"skipad",
"stop",
"seekto"
};
callback MediaSessionActionHandler = void(MediaSessionActionDetails details);
[Exposed=Window]
interface MediaSession {
attribute MediaMetadata? metadata;
attribute MediaSessionPlaybackState playbackState;
void setActionHandler(MediaSessionAction action, MediaSessionActionHandler? handler);
void setPositionState(optional MediaPositionState state = {});
};
[Exposed=Window]
interface MediaMetadata {
constructor(optional MediaMetadataInit init = {});
attribute DOMString title;
attribute DOMString artist;
attribute DOMString album;
attribute FrozenArray<MediaImage> artwork;
};
dictionary MediaMetadataInit {
DOMString title = "";
DOMString artist = "";
DOMString album = "";
sequence<MediaImage> artwork = [];
};
dictionary MediaImage {
required USVString src;
DOMString sizes = "";
DOMString type = "";
};
dictionary MediaPositionState {
double duration;
double playbackRate;
double position;
};
dictionary MediaSessionActionDetails {
required MediaSessionAction action;
};
dictionary MediaSessionSeekActionDetails : MediaSessionActionDetails {
double? seekOffset;
};
dictionary MediaSessionSeekToActionDetails : MediaSessionActionDetails {
required double seekTime;
boolean? fastSeek;
};