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 /** | 5 /** |
6 * @param {!HTMLElement} playerContainer Main container. | 6 * @param {!HTMLElement} playerContainer Main container. |
7 * @param {!HTMLElement} videoContainer Container for the video element. | 7 * @param {!HTMLElement} videoContainer Container for the video element. |
8 * @param {!HTMLElement} controlsContainer Container for video controls. | 8 * @param {!HTMLElement} controlsContainer Container for video controls. |
9 * @constructor | 9 * @constructor |
10 * @struct | 10 * @struct |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 var oldTop = window.screenY; | 488 var oldTop = window.screenY; |
489 var oldWidth = window.outerWidth; | 489 var oldWidth = window.outerWidth; |
490 var oldHeight = window.outerHeight; | 490 var oldHeight = window.outerHeight; |
491 | 491 |
492 if (!oldWidth && !oldHeight) { | 492 if (!oldWidth && !oldHeight) { |
493 oldLeft = window.screen.availWidth / 2; | 493 oldLeft = window.screen.availWidth / 2; |
494 oldTop = window.screen.availHeight / 2; | 494 oldTop = window.screen.availHeight / 2; |
495 } | 495 } |
496 | 496 |
497 var appWindow = chrome.app.window.current(); | 497 var appWindow = chrome.app.window.current(); |
498 appWindow.resizeTo(newWidth, newHeight); | 498 appWindow.innerBounds.width = Math.round(newWidth); |
499 appWindow.moveTo(oldLeft - (newWidth - oldWidth) / 2, | 499 appWindow.innerBounds.height = Math.round(newHeight); |
500 oldTop - (newHeight - oldHeight) / 2); | 500 appWindow.outerBounds.left = Math.round(oldLeft - (newWidth - oldWidth) / 2); |
| 501 appWindow.outerBounds.top = Math.round(oldTop - (newHeight - oldHeight) / 2); |
501 appWindow.show(); | 502 appWindow.show(); |
502 | 503 |
503 this.videoElement_.play(); | 504 this.videoElement_.play(); |
504 }; | 505 }; |
505 | 506 |
506 /** | 507 /** |
507 * Advances to the next (or previous) track. | 508 * Advances to the next (or previous) track. |
508 * | 509 * |
509 * @param {boolean} direction True to the next, false to the previous. | 510 * @param {boolean} direction True to the next, false to the previous. |
510 * @private | 511 * @private |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 return new Promise(function(fulfill, reject) { | 692 return new Promise(function(fulfill, reject) { |
692 util.URLsToEntries(window.appState.items, function(entries) { | 693 util.URLsToEntries(window.appState.items, function(entries) { |
693 metrics.recordOpenVideoPlayerAction(); | 694 metrics.recordOpenVideoPlayerAction(); |
694 metrics.recordNumberOfOpenedFiles(entries.length); | 695 metrics.recordNumberOfOpenedFiles(entries.length); |
695 | 696 |
696 player.prepare(entries); | 697 player.prepare(entries); |
697 player.playFirstVideo(player, fulfill); | 698 player.playFirstVideo(player, fulfill); |
698 }.wrap()); | 699 }.wrap()); |
699 }.wrap()); | 700 }.wrap()); |
700 }.wrap()); | 701 }.wrap()); |
OLD | NEW |