blob: 9bfc3fed96eb72ea15dd231206256ab2e8c71355 [file] [log] [blame]
// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://w3c.github.io/mediasession/#enumdef-mediasessionplaybackstate
enum MediaSessionPlaybackState {
"none",
"paused",
"playing"
};
// https://w3c.github.io/mediasession/#the-mediasession-interface
enum MediaSessionAction {
"play",
"pause",
"previoustrack",
"nexttrack",
"seekbackward",
"seekforward",
"skipad",
"stop",
"seekto",
"togglemicrophone",
"togglecamera",
"hangup",
"previousslide",
"nextslide",
"enterpictureinpicture"
};
callback MediaSessionActionHandler = void (MediaSessionActionDetails details);
[
Exposed=Window,
RuntimeEnabled=MediaSession
] interface MediaSession {
[Measure] attribute MediaMetadata? metadata;
[Measure] attribute MediaSessionPlaybackState playbackState;
[Measure, RaisesException] void setActionHandler(MediaSessionAction action,
MediaSessionActionHandler? handler);
[Measure, RaisesException]
void setPositionState(optional MediaPositionState state = {});
[Measure]
void setMicrophoneActive(boolean active);
[Measure]
void setCameraActive(boolean active);
};