mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-12-01 01:36:09 +03:00
83 lines
2.8 KiB
Plaintext
83 lines
2.8 KiB
Plaintext
// 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 {
|
|
enum PlayState {
|
|
PLAYING,
|
|
PAUSED,
|
|
BUFFERING
|
|
};
|
|
|
|
// The title of the currently playing media. For example, in a MediaStatus
|
|
// representing a YouTube Cast route, this is the title of the video.
|
|
// For a tab mirroring or media remoting route, it's the page title.
|
|
// For a Presentation API route, it is the presentation page title.
|
|
string title;
|
|
|
|
// Text describing the media, or a secondary title. For example, in a
|
|
// MediaStatus representing a YouTube Cast session, this could be "YouTube".
|
|
//
|
|
// DEPRECATED. This is used to override MediaRoute.description (defined in
|
|
// media_router.mojom) in the Media Router UX. We will be using
|
|
// MediaRoute.description exclusively once all MRPs have been updated.
|
|
// TODO(crbug.com/786208): Remove this when that is done.
|
|
string description;
|
|
|
|
// 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;
|
|
|
|
// Whether the media is playing, paused, or buffering.
|
|
PlayState play_state;
|
|
|
|
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. 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. Must be less than or equal to |duration|.
|
|
mojo.common.mojom.TimeDelta current_time;
|
|
|
|
// Only set for Hangouts routes.
|
|
HangoutsMediaStatusExtraData? hangouts_extra_data;
|
|
};
|
|
|
|
struct HangoutsMediaStatusExtraData {
|
|
// Whether local present mode (aka "smooth motion") is on.
|
|
bool local_present;
|
|
};
|
|
|
|
// 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);
|
|
};
|