OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 module blink.mojom; | 5 module blink.mojom; |
6 | 6 |
7 import "mojo/common/common_custom_types.mojom"; | 7 import "mojo/common/common_custom_types.mojom"; |
8 import "ui/gfx/geometry/mojo/geometry.mojom"; | 8 import "ui/gfx/geometry/mojo/geometry.mojom"; |
9 import "url/mojo/url.mojom"; | 9 import "url/mojo/url.mojom"; |
10 | 10 |
11 // Spec: https://wicg.github.io/mediasession/ | |
12 enum MediaSessionAction { | |
13 PLAY, | |
14 PAUSE, | |
15 PLAY_PAUSE, | |
16 PREVIOUS_TRACK, | |
17 NEXT_TRACK, | |
18 SEEK_FORWARD, | |
19 SEEK_BACKWARD, | |
20 | |
21 LAST = SEEK_BACKWARD | |
whywhat
2016/10/19 21:59:00
This doesn't seem to be used. Do we really need it
Zhiqiang Zhang (Slow)
2016/10/21 14:52:45
Thought it was a pattern, seems not :)
| |
22 }; | |
23 | |
11 // Album art in MediaMetadata | 24 // Album art in MediaMetadata |
12 // Spec: https://wicg.github.io/mediasession/ | 25 // Spec: https://wicg.github.io/mediasession/ |
13 struct MediaImage { | 26 struct MediaImage { |
14 url.mojom.Url src; | 27 url.mojom.Url src; |
15 mojo.common.mojom.String16 type; | 28 mojo.common.mojom.String16 type; |
16 array<gfx.mojom.Size> sizes; | 29 array<gfx.mojom.Size> sizes; |
17 }; | 30 }; |
18 | 31 |
19 // MediaMetadata | 32 // MediaMetadata |
20 // Spec: https://wicg.github.io/mediasession/ | 33 // Spec: https://wicg.github.io/mediasession/ |
21 struct MediaMetadata { | 34 struct MediaMetadata { |
22 mojo.common.mojom.String16 title; | 35 mojo.common.mojom.String16 title; |
23 mojo.common.mojom.String16 artist; | 36 mojo.common.mojom.String16 artist; |
24 mojo.common.mojom.String16 album; | 37 mojo.common.mojom.String16 album; |
25 array<MediaImage> artwork; | 38 array<MediaImage> artwork; |
26 }; | 39 }; |
27 | 40 |
41 interface MediaSessionClient { | |
42 DidReceiveAction(MediaSessionAction action); | |
43 }; | |
44 | |
28 interface MediaSessionService { | 45 interface MediaSessionService { |
46 // MediaSessionClient interface is used to notify Blink MediaSession of | |
47 // media control actions. | |
48 SetClient(MediaSessionClient client); | |
49 | |
29 SetMetadata(MediaMetadata? metadata); | 50 SetMetadata(MediaMetadata? metadata); |
51 | |
52 EnableAction(MediaSessionAction action); | |
53 DisableAction(MediaSessionAction action); | |
30 }; | 54 }; |
OLD | NEW |