Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1551)

Unified Diff: third_party/WebKit/public/platform/modules/mediasession/media_session.mojom

Issue 2426653002: Adding mojo MediaSessionClient to support media controls (Closed)
Patch Set: rebased and nits Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/mediasession/MediaSession.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/modules/mediasession/media_session.mojom
diff --git a/third_party/WebKit/public/platform/modules/mediasession/media_session.mojom b/third_party/WebKit/public/platform/modules/mediasession/media_session.mojom
index dae65f6e339dbc465103e023d64599ffba08892a..0a022cecb493766aaa80c6d5613ee596b55f7aa9 100644
--- a/third_party/WebKit/public/platform/modules/mediasession/media_session.mojom
+++ b/third_party/WebKit/public/platform/modules/mediasession/media_session.mojom
@@ -8,6 +8,17 @@ import "mojo/common/common_custom_types.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom";
import "url/mojo/url.mojom";
+// Spec: https://wicg.github.io/mediasession/
+enum MediaSessionAction {
+ PLAY,
+ PAUSE,
+ PLAY_PAUSE,
+ PREVIOUS_TRACK,
+ NEXT_TRACK,
+ SEEK_FORWARD,
+ SEEK_BACKWARD,
+};
+
// Album art in MediaMetadata
// Spec: https://wicg.github.io/mediasession/
struct MediaImage {
@@ -25,6 +36,27 @@ struct MediaMetadata {
array<MediaImage> artwork;
};
+interface MediaSessionClient {
+ // Notifies the Blink side that a MediaSessionAction has been fired from the
+ // UI or the platform.
+ DidReceiveAction(MediaSessionAction action);
+};
+
interface MediaSessionService {
+ // MediaSessionClient interface is used to notify Blink MediaSession of
+ // media control actions.
+ SetClient(MediaSessionClient client);
+
+ // Notifies the browser that the metadata is set, |metadata| will be displayed
+ // on the UI.
SetMetadata(MediaMetadata? metadata);
+
+ // Notifies the browser that the event handler for |action| has been set,
+ // browser needs to show a media button in the UI or register listeners to the
+ // platform.
+ EnableAction(MediaSessionAction action);
+ // Notifies the browser that the event handler for |action| has been set,
+ // browser needs to hide the media button in the UI and unregister listeners
+ // from the platform.
+ DisableAction(MediaSessionAction action);
};
« no previous file with comments | « third_party/WebKit/Source/modules/mediasession/MediaSession.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698