OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // https://wicg.github.io/mediasession/#enumdef-mediasessionplaybackstate | 5 // https://wicg.github.io/mediasession/#enumdef-mediasessionplaybackstate |
6 | 6 |
7 enum MediaSessionPlaybackState { | 7 enum MediaSessionPlaybackState { |
8 "none", | 8 "none", |
9 "paused", | 9 "paused", |
10 "playing" | 10 "playing" |
11 }; | 11 }; |
12 | 12 |
13 // https://wicg.github.io/mediasession/#the-mediasession-interface | 13 // https://wicg.github.io/mediasession/#the-mediasession-interface |
14 | 14 |
15 enum MediaSessionAction { | |
16 "play", | |
17 "pause", | |
18 "playpause", | |
mlamouri (slow - plz ping)
2016/12/20 13:25:57
playpause is no longer there, right?
Zhiqiang Zhang (Slow)
2016/12/20 13:53:06
Thanks for the catch. Done :)
| |
19 "previoustrack", | |
20 "nexttrack", | |
21 "seekbackward", | |
22 "seekforward" | |
23 }; | |
24 | |
25 callback MediaSessionActionCallback = void (); | |
26 | |
15 [ | 27 [ |
28 Custom=VisitDOMWrapper, | |
16 RuntimeEnabled=MediaSession, | 29 RuntimeEnabled=MediaSession, |
17 ] interface MediaSession : EventTarget { | 30 ] interface MediaSession : EventTarget { |
18 attribute MediaMetadata? metadata; | 31 attribute MediaMetadata? metadata; |
19 | |
20 attribute MediaSessionPlaybackState playbackState; | 32 attribute MediaSessionPlaybackState playbackState; |
21 | 33 |
22 attribute EventHandler onplay; | 34 // Why `MediaSessionActionCallback?` will generate bindings with `Nullable<M ediaSessionActionCallback*>` instead of `MediaSessionActionCallback*`? |
Zhiqiang Zhang (Slow)
2016/12/19 21:21:08
bashi@, do you have answer to this question? If I
bashi
2016/12/20 06:02:10
That seems a bug in the code generator. Thank you
| |
23 attribute EventHandler onpause; | 35 void setActionCallback(MediaSessionAction action, MediaSessionActionCallback callback); |
mlamouri (slow - plz ping)
2016/12/20 13:25:58
I would prefer to keep Handler to match the discus
Zhiqiang Zhang (Slow)
2016/12/20 13:53:06
Done.
| |
24 attribute EventHandler onprevioustrack; | |
25 attribute EventHandler onnexttrack; | |
26 attribute EventHandler onseekforward; | |
27 attribute EventHandler onseekbackward; | |
28 }; | 36 }; |
OLD | NEW |