| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 var closeButton = document.querySelector('.close-button'); | 211 var closeButton = document.querySelector('.close-button'); |
| 212 closeButton.addEventListener( | 212 closeButton.addEventListener( |
| 213 'click', | 213 'click', |
| 214 function(event) { | 214 function(event) { |
| 215 close(); | 215 close(); |
| 216 event.stopPropagation(); | 216 event.stopPropagation(); |
| 217 }.wrap(null)); | 217 }.wrap(null)); |
| 218 closeButton.addEventListener('mousedown', preventDefault); | 218 closeButton.addEventListener('mousedown', preventDefault); |
| 219 | 219 |
| 220 var castButton = document.querySelector('.cast-button'); | |
| 221 cr.ui.decorate(castButton, cr.ui.MenuButton); | |
| 222 castButton.addEventListener( | |
| 223 'click', | |
| 224 function(event) { | |
| 225 event.stopPropagation(); | |
| 226 }.wrap(null)); | |
| 227 castButton.addEventListener('mousedown', preventDefault); | |
| 228 | |
| 229 var menu = document.querySelector('#cast-menu'); | 220 var menu = document.querySelector('#cast-menu'); |
| 230 cr.ui.decorate(menu, cr.ui.Menu); | 221 cr.ui.decorate(menu, cr.ui.Menu); |
| 231 | 222 |
| 232 this.controls_ = new FullWindowVideoControls( | 223 this.controls_ = new FullWindowVideoControls( |
| 233 document.querySelector('#video-player'), | 224 document.querySelector('#video-player'), |
| 234 document.querySelector('#video-container'), | 225 document.querySelector('#video-container'), |
| 235 document.querySelector('#controls')); | 226 document.querySelector('#controls')); |
| 236 | 227 |
| 237 var reloadVideo = function(e) { | 228 var reloadVideo = function(e) { |
| 238 if (this.controls_.decodeErrorOccured && | 229 if (this.controls_.decodeErrorOccured && |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 var initPromise = Promise.all( | 662 var initPromise = Promise.all( |
| 672 [new Promise(initVideos.wrap(null)), | 663 [new Promise(initVideos.wrap(null)), |
| 673 new Promise(initStrings.wrap(null)), | 664 new Promise(initStrings.wrap(null)), |
| 674 new Promise(util.addPageLoadHandler.wrap(null))]); | 665 new Promise(util.addPageLoadHandler.wrap(null))]); |
| 675 | 666 |
| 676 initPromise.then(function(results) { | 667 initPromise.then(function(results) { |
| 677 var videos = results[0]; | 668 var videos = results[0]; |
| 678 player.prepare(videos); | 669 player.prepare(videos); |
| 679 return new Promise(player.playFirstVideo.wrap(player)); | 670 return new Promise(player.playFirstVideo.wrap(player)); |
| 680 }.wrap(null)); | 671 }.wrap(null)); |
| OLD | NEW |