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

Unified Diff: chrome/browser/media/router/mojo/media_status.mojom

Issue 2727123002: [Media Router] Custom Controls 1 - Add MediaStatus, MediaRouteController, and mojo interfaces (Closed)
Patch Set: Address Derek's comments Created 3 years, 9 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
Index: chrome/browser/media/router/mojo/media_status.mojom
diff --git a/chrome/browser/media/router/mojo/media_status.mojom b/chrome/browser/media/router/mojo/media_status.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..e57edd4c268c84d72224e684aed74ac7c9adc2cd
--- /dev/null
+++ b/chrome/browser/media/router/mojo/media_status.mojom
@@ -0,0 +1,62 @@
+// Copyright 2017 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.
+
+module media_router.mojom;
+
+import "mojo/common/time.mojom";
+
+// Represents the current state of a media content. This struct should be kept
+// free of details specific to Media Router, so that it can be moved to the
+// media namespace and be reused for other features in the future.
+struct MediaStatus {
+ // The main title of the media. For example, in a MediaStatus representing
+ // a YouTube Cast session, this could be the title of the video.
+ string title;
+
+ // Text describing the status of the media, or a secondary title. For example,
+ // in a MediaStatus representing a YouTube Cast session, this could be
+ // "YouTube".
+ string status;
+
+ // If this is true, the media can be played and paused through its
+ // MediaController.
+ bool can_play_pause;
+
+ // If this is true, the media can be muted and unmuted through its
+ // MediaController.
+ bool can_mute;
+
+ // If this is true, the media's volume can be changed through its
+ // MediaController.
+ bool can_set_volume;
+
+ // If this is true, the media's current playback position can be changed
+ // through its MediaController.
+ bool can_seek;
+
+ bool is_paused;
+
+ bool is_muted;
+
+ // Current volume of the media, with 1 being the highest and 0 being the
+ // lowest/no sound. When |is_muted| is true, there should be no sound
+ // regardless of |volume|.
+ float volume;
+
+ // The length of the media in milliseconds. A value of 0 indicates that this
+ // is a media with no set duration (e.g. a live stream).
+ mojo.common.mojom.TimeDelta duration;
+
+ // Current playback position in milliseconds. Must be less than or equal to
+ // |duration|.
+ mojo.common.mojom.TimeDelta current_time;
dcheng 2017/03/22 01:17:10 FWIW, I'm uncertain of the granularity of these up
takumif 2017/03/22 21:54:30 The updates will be once per second, so for now I'
+};
+
+// Interface for being notified whenever the MediaStatus of a media changes.
+// This interface should be kept free of details specific to Media Router, so
+// that it can be moved to the media namespace and be reused for other features
+// in the future.
+interface MediaStatusObserver {
+ OnMediaStatusUpdated(MediaStatus status);
+};

Powered by Google App Engine
This is Rietveld 408576698