testing/web-platform/tests/interfaces/mediasession.idl
author autofoolip <auto@foolip.org>
Wed, 14 Aug 2019 10:55:44 +0000
changeset 488103 49de28caecb8c577463d2f0ee8958b4ca4390b38
parent 486371 92781e32c7799490a05b2fd127492330303925af
permissions -rw-r--r--
Bug 1573008 [wpt PR 18381] - Update interfaces/mediasession.idl, a=testonly Automatic update from web-platform-tests Update interfaces/mediasession.idl (#18381) Source: https://github.com/tidoust/reffy-reports/blob/3336bd0/whatwg/idl/mediasession.idl Build: https://travis-ci.org/tidoust/reffy-reports/builds/570123391 -- wpt-commits: 9f428424dacec4acfc312887048dadf7208f5186 wpt-pr: 18381

// 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);
};

[Constructor(optional MediaMetadataInit init), Exposed=Window]
interface MediaMetadata {
  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;
  bool? fastSeek;
};