OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @param {Element} playerContainer Main container. | 8 * @param {Element} playerContainer Main container. |
9 * @param {Element} videoContainer Container for the video element. | 9 * @param {Element} videoContainer Container for the video element. |
10 * @param {Element} controlsContainer Container for video controls. | 10 * @param {Element} controlsContainer Container for video controls. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // The window is hidden if the video has not loaded yet. | 98 // The window is hidden if the video has not loaded yet. |
99 chrome.app.window.current().show(); | 99 chrome.app.window.current().show(); |
100 }; | 100 }; |
101 | 101 |
102 /** | 102 /** |
103 * Handles playback (decoder) errors. | 103 * Handles playback (decoder) errors. |
104 * @param {MediaError} error Error object. | 104 * @param {MediaError} error Error object. |
105 * @private | 105 * @private |
106 */ | 106 */ |
107 FullWindowVideoControls.prototype.onPlaybackError_ = function(error) { | 107 FullWindowVideoControls.prototype.onPlaybackError_ = function(error) { |
108 if (error.target && | 108 if (error.target && error.target.error && |
109 error.target.error.code === MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) { | 109 error.target.error.code === MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) { |
110 this.showErrorMessage('GALLERY_VIDEO_ERROR'); | 110 this.showErrorMessage('GALLERY_VIDEO_ERROR'); |
111 this.decodeErrorOccured = false; | 111 this.decodeErrorOccured = false; |
112 } else { | 112 } else { |
113 this.showErrorMessage('GALLERY_VIDEO_DECODING_ERROR'); | 113 this.showErrorMessage('GALLERY_VIDEO_DECODING_ERROR'); |
114 this.decodeErrorOccured = true; | 114 this.decodeErrorOccured = true; |
115 } | 115 } |
116 | 116 |
117 // Disable inactivity watcher, and disable the ui, by hiding tools manually. | 117 // Disable inactivity watcher, and disable the ui, by hiding tools manually. |
118 this.inactivityWatcher.disabled = true; | 118 this.inactivityWatcher.disabled = true; |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 var initPromise = Promise.all( | 621 var initPromise = Promise.all( |
622 [new Promise(initVideos.wrap(null)), | 622 [new Promise(initVideos.wrap(null)), |
623 new Promise(initStrings.wrap(null)), | 623 new Promise(initStrings.wrap(null)), |
624 new Promise(util.addPageLoadHandler.wrap(null))]); | 624 new Promise(util.addPageLoadHandler.wrap(null))]); |
625 | 625 |
626 initPromise.then(function(results) { | 626 initPromise.then(function(results) { |
627 var videos = results[0]; | 627 var videos = results[0]; |
628 player.prepare(videos); | 628 player.prepare(videos); |
629 return new Promise(player.playFirstVideo.wrap(player)); | 629 return new Promise(player.playFirstVideo.wrap(player)); |
630 }.wrap(null)); | 630 }.wrap(null)); |
OLD | NEW |