Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module media_router.mojom; | |
| 6 | |
| 7 import "mojo/common/time.mojom"; | |
| 8 | |
| 9 // Represents the current state of a media content. This struct should be kept | |
| 10 // free of details specific to Media Router, so that it can be moved to the | |
| 11 // media namespace and be reused for other features in the future. | |
| 12 struct MediaStatus { | |
| 13 // The main title of the media. For example, in a MediaStatus representing | |
| 14 // a YouTube Cast session, this could be the title of the video. | |
| 15 string title; | |
| 16 | |
| 17 // Text describing the status of the media, or a secondary title. For example, | |
| 18 // in a MediaStatus representing a YouTube Cast session, this could be | |
| 19 // "YouTube". | |
| 20 string status; | |
| 21 | |
| 22 // If this is true, the media can be played and paused through its | |
| 23 // MediaController. | |
| 24 bool can_play_pause; | |
| 25 | |
| 26 // If this is true, the media can be muted and unmuted through its | |
| 27 // MediaController. | |
| 28 bool can_mute; | |
| 29 | |
| 30 // If this is true, the media's volume can be changed through its | |
| 31 // MediaController. | |
| 32 bool can_set_volume; | |
| 33 | |
| 34 // If this is true, the media's current playback position can be changed | |
| 35 // through its MediaController. | |
| 36 bool can_seek; | |
| 37 | |
| 38 bool is_paused; | |
| 39 | |
| 40 bool is_muted; | |
| 41 | |
| 42 // Current volume of the media, with 1 being the highest and 0 being the | |
| 43 // lowest/no sound. When |is_muted| is true, there should be no sound | |
| 44 // regardless of |volume|. | |
| 45 float volume; | |
| 46 | |
| 47 // The length of the media in milliseconds. A value of 0 indicates that this | |
| 48 // is a media with no set duration (e.g. a live stream). | |
| 49 mojo.common.mojom.TimeDelta duration; | |
| 50 | |
| 51 // Current playback position in milliseconds. Must be less than or equal to | |
| 52 // |duration|. | |
| 53 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'
| |
| 54 }; | |
| 55 | |
| 56 // Interface for being notified whenever the MediaStatus of a media changes. | |
| 57 // This interface should be kept free of details specific to Media Router, so | |
| 58 // that it can be moved to the media namespace and be reused for other features | |
| 59 // in the future. | |
| 60 interface MediaStatusObserver { | |
| 61 OnMediaStatusUpdated(MediaStatus status); | |
| 62 }; | |
| OLD | NEW |