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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 }.wrap(null)); | 652 }.wrap(null)); |
653 } | 653 } |
654 | 654 |
655 var player = new VideoPlayer(); | 655 var player = new VideoPlayer(); |
656 | 656 |
657 /** | 657 /** |
658 * Initializes the strings. | 658 * Initializes the strings. |
659 * @param {function()} callback Called when the sting data is ready. | 659 * @param {function()} callback Called when the sting data is ready. |
660 */ | 660 */ |
661 function initStrings(callback) { | 661 function initStrings(callback) { |
662 chrome.fileBrowserPrivate.getStrings(function(strings) { | 662 chrome.fileManagerPrivate.getStrings(function(strings) { |
663 loadTimeData.data = strings; | 663 loadTimeData.data = strings; |
664 callback(); | 664 callback(); |
665 }.wrap(null)); | 665 }.wrap(null)); |
666 } | 666 } |
667 | 667 |
668 var initPromise = Promise.all( | 668 var initPromise = Promise.all( |
669 [new Promise(initVideos.wrap(null)), | 669 [new Promise(initVideos.wrap(null)), |
670 new Promise(initStrings.wrap(null)), | 670 new Promise(initStrings.wrap(null)), |
671 new Promise(util.addPageLoadHandler.wrap(null))]); | 671 new Promise(util.addPageLoadHandler.wrap(null))]); |
672 | 672 |
673 initPromise.then(function(results) { | 673 initPromise.then(function(results) { |
674 var videos = results[0]; | 674 var videos = results[0]; |
675 player.prepare(videos); | 675 player.prepare(videos); |
676 return new Promise(player.playFirstVideo.wrap(player)); | 676 return new Promise(player.playFirstVideo.wrap(player)); |
677 }.wrap(null)); | 677 }.wrap(null)); |
OLD | NEW |