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

Side by Side Diff: ui/file_manager/video_player/js/media_controls.js

Issue 1987173002: Video Player: Support Media Router to cast Drive videos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 4 years, 7 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 unified diff | Download patch
OLDNEW
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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 function VideoControls( 854 function VideoControls(
855 containerElement, onMediaError, opt_fullScreenToggle, opt_stateIconParent) { 855 containerElement, onMediaError, opt_fullScreenToggle, opt_stateIconParent) {
856 MediaControls.call(this, containerElement, onMediaError); 856 MediaControls.call(this, containerElement, onMediaError);
857 857
858 this.container_.classList.add('video-controls'); 858 this.container_.classList.add('video-controls');
859 this.initPlayButton(); 859 this.initPlayButton();
860 this.initTimeControls(); 860 this.initTimeControls();
861 this.initVolumeControls(); 861 this.initVolumeControls();
862 this.initSubtitlesButton(); 862 this.initSubtitlesButton();
863 863
864 // Create the cast button. 864 // Create the cast menu button.
865 // We need to use <button> since cr.ui.MenuButton.decorate modifies prototype 865 // We need to use <button> since cr.ui.MenuButton.decorate modifies prototype
866 // chain, by which <files-icon-button> will not work correctly. 866 // chain, by which <files-icon-button> will not work correctly.
867 // TODO(fukino): Find a way to use files-icon-button consistently. 867 // TODO(fukino): Find a way to use files-icon-button consistently.
868 this.castButton_ = this.createControl( 868 this.castButton_ = this.createControl(
869 'cast media-button', undefined, 'button'); 869 'cast media-button', undefined, 'button');
870 this.castButton_.setAttribute('menu', '#cast-menu'); 870 this.castButton_.setAttribute('menu', '#cast-menu');
871 this.castButton_.setAttribute('aria-label', str('VIDEO_PLAYER_PLAY_ON')); 871 this.castButton_.setAttribute('aria-label', str('VIDEO_PLAYER_PLAY_ON'));
872 this.castButton_.setAttribute('state', MediaControls.ButtonStateType.DEFAULT); 872 this.castButton_.setAttribute('state', MediaControls.ButtonStateType.DEFAULT);
873 this.castButton_.appendChild(document.createElement('files-ripple')); 873 this.castButton_.appendChild(document.createElement('files-ripple'));
874 cr.ui.decorate(this.castButton_, cr.ui.MenuButton); 874 cr.ui.decorate(this.castButton_, cr.ui.MenuButton);
875 875
876 // Create the cast button, which is a normal button and is used when we cast
877 // videos usign Media Router.
878 this.createButton('cast-button');
879
876 if (opt_fullScreenToggle) { 880 if (opt_fullScreenToggle) {
877 this.fullscreenButton_ = 881 this.fullscreenButton_ =
878 this.createButton('fullscreen', opt_fullScreenToggle); 882 this.createButton('fullscreen', opt_fullScreenToggle);
879 this.fullscreenButton_.setAttribute('aria-label', 883 this.fullscreenButton_.setAttribute('aria-label',
880 str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL')); 884 str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));
881 } 885 }
882 886
883 if (opt_stateIconParent) { 887 if (opt_stateIconParent) {
884 this.stateIcon_ = this.createControl( 888 this.stateIcon_ = this.createControl(
885 'playback-state-icon', opt_stateIconParent); 889 'playback-state-icon', opt_stateIconParent);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 } else { 1084 } else {
1081 this.container_.removeAttribute('fullscreen'); 1085 this.container_.removeAttribute('fullscreen');
1082 } 1086 }
1083 1087
1084 if (this.fullscreenButton_) { 1088 if (this.fullscreenButton_) {
1085 this.fullscreenButton_.setAttribute('aria-label', 1089 this.fullscreenButton_.setAttribute('aria-label',
1086 fullscreen ? str('VIDEO_PLAYER_EXIT_FULL_SCREEN_BUTTON_LABEL') 1090 fullscreen ? str('VIDEO_PLAYER_EXIT_FULL_SCREEN_BUTTON_LABEL')
1087 : str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));; 1091 : str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));;
1088 } 1092 }
1089 }; 1093 };
OLDNEW
« no previous file with comments | « ui/file_manager/video_player/js/cast/caster.js ('k') | ui/file_manager/video_player/js/video_player.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698