| 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 }.wrap(null)); | 633 }.wrap(null)); |
| 634 } | 634 } |
| 635 | 635 |
| 636 var player = new VideoPlayer(); | 636 var player = new VideoPlayer(); |
| 637 | 637 |
| 638 /** | 638 /** |
| 639 * Initializes the strings. | 639 * Initializes the strings. |
| 640 * @param {function()} callback Called when the sting data is ready. | 640 * @param {function()} callback Called when the sting data is ready. |
| 641 */ | 641 */ |
| 642 function initStrings(callback) { | 642 function initStrings(callback) { |
| 643 chrome.fileBrowserPrivate.getStrings(function(strings) { | 643 chrome.fileManagerPrivate.getStrings(function(strings) { |
| 644 loadTimeData.data = strings; | 644 loadTimeData.data = strings; |
| 645 callback(); | 645 callback(); |
| 646 }.wrap(null)); | 646 }.wrap(null)); |
| 647 } | 647 } |
| 648 | 648 |
| 649 var initPromise = Promise.all( | 649 var initPromise = Promise.all( |
| 650 [new Promise(initVideos.wrap(null)), | 650 [new Promise(initVideos.wrap(null)), |
| 651 new Promise(initStrings.wrap(null)), | 651 new Promise(initStrings.wrap(null)), |
| 652 new Promise(util.addPageLoadHandler.wrap(null))]); | 652 new Promise(util.addPageLoadHandler.wrap(null))]); |
| 653 | 653 |
| 654 initPromise.then(function(results) { | 654 initPromise.then(function(results) { |
| 655 var videos = results[0]; | 655 var videos = results[0]; |
| 656 player.prepare(videos); | 656 player.prepare(videos); |
| 657 return new Promise(player.playFirstVideo.wrap(player)); | 657 return new Promise(player.playFirstVideo.wrap(player)); |
| 658 }.wrap(null)); | 658 }.wrap(null)); |
| OLD | NEW |