| // Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // https://wicg.github.io/mediasession/#enumdef-mediasessionplaybackstate |
| |
| enum MediaSessionPlaybackState { |
| "none", |
| "paused", |
| "playing" |
| }; |
| |
| // https://wicg.github.io/mediasession/#the-mediasession-interface |
| |
| enum MediaSessionAction { |
| "play", |
| "pause", |
| "previoustrack", |
| "nexttrack", |
| "seekbackward", |
| "seekforward" |
| }; |
| |
| callback MediaSessionActionHandler = void (); |
| |
| [ |
| RuntimeEnabled=MediaSession, |
| DependentLifetime |
| ] interface MediaSession { |
| [Measure] attribute MediaMetadata? metadata; |
| [Measure] attribute MediaSessionPlaybackState playbackState; |
| |
| [Measure] void setActionHandler(MediaSessionAction action, |
| MediaSessionActionHandler? handler); |
| }; |