mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +01:00
script: Move code generation and webidl files to new script_bindings crate. (#35157)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
a88b59534f
commit
af8d7c2de7
469 changed files with 187 additions and 137 deletions
62
components/script_bindings/webidls/MediaSession.webidl
Normal file
62
components/script_bindings/webidls/MediaSession.webidl
Normal file
|
@ -0,0 +1,62 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
/*
|
||||
* The origin of this IDL file is
|
||||
* https://w3c.github.io/mediasession/#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"
|
||||
};
|
||||
|
||||
dictionary MediaSessionActionDetails {
|
||||
required MediaSessionAction action;
|
||||
};
|
||||
|
||||
dictionary MediaSessionSeekActionDetails : MediaSessionActionDetails {
|
||||
double? seekOffset;
|
||||
};
|
||||
|
||||
dictionary MediaSessionSeekToActionDetails : MediaSessionActionDetails {
|
||||
required double seekTime;
|
||||
boolean? fastSeek;
|
||||
};
|
||||
|
||||
dictionary MediaPositionState {
|
||||
double duration;
|
||||
double playbackRate;
|
||||
double position;
|
||||
};
|
||||
|
||||
callback MediaSessionActionHandler = undefined(/*MediaSessionActionDetails details*/);
|
||||
|
||||
[Exposed=Window]
|
||||
interface MediaSession {
|
||||
attribute MediaMetadata? metadata;
|
||||
|
||||
attribute MediaSessionPlaybackState playbackState;
|
||||
|
||||
undefined setActionHandler(MediaSessionAction action, MediaSessionActionHandler? handler);
|
||||
|
||||
[Throws] undefined setPositionState(optional MediaPositionState state = {});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue