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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * Display error message. | 8 * Display error message. |
9 * @param {string} message Message id. | 9 * @param {string} message Message id. |
10 */ | 10 */ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 * @param {Element} playerContainer Main container. | 44 * @param {Element} playerContainer Main container. |
45 * @param {Element} videoContainer Container for the video element. | 45 * @param {Element} videoContainer Container for the video element. |
46 * @param {Element} controlsContainer Container for video controls. | 46 * @param {Element} controlsContainer Container for video controls. |
47 * @constructor | 47 * @constructor |
48 */ | 48 */ |
49 function FullWindowVideoControls( | 49 function FullWindowVideoControls( |
50 playerContainer, videoContainer, controlsContainer) { | 50 playerContainer, videoContainer, controlsContainer) { |
51 VideoControls.call(this, | 51 VideoControls.call(this, |
52 controlsContainer, | 52 controlsContainer, |
53 onPlaybackError, | 53 onPlaybackError, |
54 this.toggleFullscreen_.bind(this), | 54 this.toggleFullScreen_.bind(this), |
55 videoContainer); | 55 videoContainer); |
56 | 56 |
57 this.playerContainer_ = playerContainer; | 57 this.playerContainer_ = playerContainer; |
58 | 58 |
59 this.updateStyle(); | 59 this.updateStyle(); |
60 window.addEventListener('resize', this.updateStyle.bind(this)); | 60 window.addEventListener('resize', this.updateStyle.bind(this)); |
61 | 61 |
62 document.addEventListener('keydown', function(e) { | 62 document.addEventListener('keydown', function(e) { |
63 if (e.keyIdentifier == 'U+0020') { // Space | 63 if (e.keyIdentifier == 'U+0020') { // Space |
64 this.togglePlayStateWithFeedback(); | 64 this.togglePlayStateWithFeedback(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (!this.decodeState()) { | 102 if (!this.decodeState()) { |
103 VideoControls.prototype.restorePlayState.apply(this, arguments); | 103 VideoControls.prototype.restorePlayState.apply(this, arguments); |
104 this.play(); | 104 this.play(); |
105 } | 105 } |
106 }; | 106 }; |
107 | 107 |
108 /** | 108 /** |
109 * Toggles the full screen mode. | 109 * Toggles the full screen mode. |
110 * @private | 110 * @private |
111 */ | 111 */ |
112 FullWindowVideoControls.prototype.toggleFullscreen_ = function() { | 112 FullWindowVideoControls.prototype.toggleFullScreen_ = function() { |
113 util.toggleFullScreen(this.playerContainer_.ownerDocument, | 113 util.toggleFullScreen(this.playerContainer_.ownerDocument, |
114 !util.isFullScreen()); | 114 !util.isFullScreen()); |
115 }; | 115 }; |
116 | 116 |
117 // TODO(mtomasz): Convert it to class members: crbug.com/171191. | 117 // TODO(mtomasz): Convert it to class members: crbug.com/171191. |
118 var decodeErrorOccured; | 118 var decodeErrorOccured; |
119 var video; | 119 var video; |
120 var controls; | 120 var controls; |
121 var metadataCache; | 121 var metadataCache; |
122 var volumeManager; | 122 var volumeManager; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 webkitResolveLocalFileSystemURL(src, | 270 webkitResolveLocalFileSystemURL(src, |
271 function(entry) { | 271 function(entry) { |
272 var video = document.querySelector('video'); | 272 var video = document.querySelector('video'); |
273 if (video.src != src) return; | 273 if (video.src != src) return; |
274 selectedItemFilesystemPath = entry.fullPath; | 274 selectedItemFilesystemPath = entry.fullPath; |
275 }); | 275 }); |
276 }); | 276 }); |
277 } | 277 } |
278 | 278 |
279 util.addPageLoadHandler(loadVideoPlayer); | 279 util.addPageLoadHandler(loadVideoPlayer); |
OLD | NEW |