| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Any strings used here will already be localized. Values such as | 5 // Any strings used here will already be localized. Values such as |
| 6 // CastMode.type or IDs will be defined elsewhere and determined later. | 6 // CastMode.type or IDs will be defined elsewhere and determined later. |
| 7 | 7 |
| 8 cr.exportPath('media_router'); | 8 cr.exportPath('media_router'); |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 /** | 80 /** |
| 81 * The minimum number of sinks to have to enable the search input strictly for | 81 * The minimum number of sinks to have to enable the search input strictly for |
| 82 * filtering (i.e. the Media Router doesn't support search so the search input | 82 * filtering (i.e. the Media Router doesn't support search so the search input |
| 83 * only filters existing sinks). | 83 * only filters existing sinks). |
| 84 * @const {number} | 84 * @const {number} |
| 85 */ | 85 */ |
| 86 media_router.MINIMUM_SINKS_FOR_SEARCH = 20; | 86 media_router.MINIMUM_SINKS_FOR_SEARCH = 20; |
| 87 | 87 |
| 88 /** | 88 /** |
| 89 * The states that media can be in. |
| 90 * @enum {number} |
| 91 */ |
| 92 media_router.PlayState = { |
| 93 PLAYING: 0, |
| 94 PAUSED: 1, |
| 95 BUFFERING: 2, |
| 96 }; |
| 97 |
| 98 /** |
| 89 * This corresponds to the C++ MediaSink IconType, and the order must stay in | 99 * This corresponds to the C++ MediaSink IconType, and the order must stay in |
| 90 * sync. | 100 * sync. |
| 91 * @enum {number} | 101 * @enum {number} |
| 92 */ | 102 */ |
| 93 media_router.SinkIconType = { | 103 media_router.SinkIconType = { |
| 94 CAST: 0, | 104 CAST: 0, |
| 95 CAST_AUDIO_GROUP: 1, | 105 CAST_AUDIO_GROUP: 1, |
| 96 CAST_AUDIO: 2, | 106 CAST_AUDIO: 2, |
| 97 MEETING: 3, | 107 MEETING: 3, |
| 98 HANGOUT: 4, | 108 HANGOUT: 4, |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 * @param {boolean} isPaused Whether the route is paused. | 244 * @param {boolean} isPaused Whether the route is paused. |
| 235 * @param {boolean} isMuted Whether the route is muted. | 245 * @param {boolean} isMuted Whether the route is muted. |
| 236 * @param {number} volume The route's volume, between 0 and 1. | 246 * @param {number} volume The route's volume, between 0 and 1. |
| 237 * @param {number} duration The route's duration in seconds. | 247 * @param {number} duration The route's duration in seconds. |
| 238 * @param {number} currentTime The route's current position in seconds. | 248 * @param {number} currentTime The route's current position in seconds. |
| 239 * Must not be greater than |duration|. | 249 * Must not be greater than |duration|. |
| 240 * @constructor | 250 * @constructor |
| 241 * @struct | 251 * @struct |
| 242 */ | 252 */ |
| 243 var RouteStatus = function( | 253 var RouteStatus = function( |
| 244 title, description, canPlayPause, canMute, canSetVolume, canSeek, | 254 title = '', description = '', canPlayPause = false, canMute = false, |
| 245 isPaused, isMuted, volume, duration, currentTime) { | 255 canSetVolume = false, canSeek = false, |
| 256 playState = media_router.PlayState.PLAYING, isPaused = false, |
| 257 isMuted = false, volume = 0, duration = 0, currentTime = 0) { |
| 246 | 258 |
| 247 /** @type {string} */ | 259 /** @type {string} */ |
| 248 this.title = title; | 260 this.title = title; |
| 249 | 261 |
| 250 /** @type {string} */ | 262 /** @type {string} */ |
| 251 this.description = description; | 263 this.description = description; |
| 252 | 264 |
| 253 /** @type {boolean} */ | 265 /** @type {boolean} */ |
| 254 this.canPlayPause = canPlayPause; | 266 this.canPlayPause = canPlayPause; |
| 255 | 267 |
| 256 /** @type {boolean} */ | 268 /** @type {boolean} */ |
| 257 this.canMute = canMute; | 269 this.canMute = canMute; |
| 258 | 270 |
| 259 /** @type {boolean} */ | 271 /** @type {boolean} */ |
| 260 this.canSetVolume = canSetVolume; | 272 this.canSetVolume = canSetVolume; |
| 261 | 273 |
| 262 /** @type {boolean} */ | 274 /** @type {boolean} */ |
| 263 this.canSeek = canSeek; | 275 this.canSeek = canSeek; |
| 264 | 276 |
| 265 /** @type {boolean} */ | 277 /** @type {media_router.PlayState} */ |
| 266 this.isPaused = isPaused; | 278 this.playState = playState; |
| 267 | 279 |
| 268 /** @type {boolean} */ | 280 /** @type {boolean} */ |
| 269 this.isMuted = isMuted; | 281 this.isMuted = isMuted; |
| 270 | 282 |
| 271 /** @type {number} */ | 283 /** @type {number} */ |
| 272 this.volume = volume; | 284 this.volume = volume; |
| 273 | 285 |
| 274 /** @type {number} */ | 286 /** @type {number} */ |
| 275 this.duration = duration; | 287 this.duration = duration; |
| 276 | 288 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 return { | 347 return { |
| 336 AUTO_CAST_MODE: AUTO_CAST_MODE, | 348 AUTO_CAST_MODE: AUTO_CAST_MODE, |
| 337 CastMode: CastMode, | 349 CastMode: CastMode, |
| 338 Issue: Issue, | 350 Issue: Issue, |
| 339 Route: Route, | 351 Route: Route, |
| 340 RouteStatus: RouteStatus, | 352 RouteStatus: RouteStatus, |
| 341 Sink: Sink, | 353 Sink: Sink, |
| 342 TabInfo: TabInfo, | 354 TabInfo: TabInfo, |
| 343 }; | 355 }; |
| 344 }); | 356 }); |
| OLD | NEW |