Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
| 6 * @fileoverview MediaControls class implements media playback controls | 6 * @fileoverview MediaControls class implements media playback controls |
| 7 * that exist outside of the audio/video HTML element. | 7 * that exist outside of the audio/video HTML element. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 612 this.textBanner_.removeAttribute('visible'); | 612 this.textBanner_.removeAttribute('visible'); |
| 613 | 613 |
| 614 // Reflect the media state in the UI. | 614 // Reflect the media state in the UI. |
| 615 this.onMediaDuration_(); | 615 this.onMediaDuration_(); |
| 616 this.onMediaPlay_(this.isPlaying()); | 616 this.onMediaPlay_(this.isPlaying()); |
| 617 this.onMediaProgress_(); | 617 this.onMediaProgress_(); |
| 618 if (this.volume_) { | 618 if (this.volume_) { |
| 619 /* Copy the user selected volume to the new media element. */ | 619 /* Copy the user selected volume to the new media element. */ |
| 620 this.savedVolume_ = this.media_.volume = this.volume_.ratio; | 620 this.savedVolume_ = this.media_.volume = this.volume_.ratio; |
| 621 } | 621 } |
| 622 if (this.media_.textTracks.length > 0) { | 622 if (this.media_.textTracks && this.media_.textTracks.length > 0) { |
|
yawano
2016/03/29 08:29:23
Very small optional nit: I don't think we need to
fukino
2016/03/29 08:48:28
If the media is CastVideoElement, the textTracks i
yawano
2016/03/29 08:59:14
I get it. Thank you!
No, I don't think we need to
| |
| 623 this.attachTextTrack_(this.media_.textTracks[0]); | 623 this.attachTextTrack_(this.media_.textTracks[0]); |
| 624 } else { | 624 } else { |
| 625 this.attachTextTrack_(null); | 625 this.attachTextTrack_(null); |
| 626 } | 626 } |
| 627 }; | 627 }; |
| 628 | 628 |
| 629 /** | 629 /** |
| 630 * Detach media event handlers. | 630 * Detach media event handlers. |
| 631 */ | 631 */ |
| 632 MediaControls.prototype.detachMedia = function() { | 632 MediaControls.prototype.detachMedia = function() { |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1041 } else { | 1041 } else { |
| 1042 this.container_.removeAttribute('fullscreen'); | 1042 this.container_.removeAttribute('fullscreen'); |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 if (this.fullscreenButton_) { | 1045 if (this.fullscreenButton_) { |
| 1046 this.fullscreenButton_.setAttribute('aria-label', | 1046 this.fullscreenButton_.setAttribute('aria-label', |
| 1047 fullscreen ? str('VIDEO_PLAYER_EXIT_FULL_SCREEN_BUTTON_LABEL') | 1047 fullscreen ? str('VIDEO_PLAYER_EXIT_FULL_SCREEN_BUTTON_LABEL') |
| 1048 : str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));; | 1048 : str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));; |
| 1049 } | 1049 } |
| 1050 }; | 1050 }; |
| OLD | NEW |