Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2169)

Unified Diff: chrome/browser/resources/file_manager/foreground/js/media/media_controls.js

Issue 196383030: [VideoPlayer] dedicated video player app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add the script file to the whitelist. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/foreground/js/media/media_controls.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/media/media_controls.js b/chrome/browser/resources/file_manager/foreground/js/media/media_controls.js
index 174796c486af6affa1074152693253a9fdf4ebf8..f8c48b8efd6201c6f5015a8e4f8fa3abc7ee995d 100644
--- a/chrome/browser/resources/file_manager/foreground/js/media/media_controls.js
+++ b/chrome/browser/resources/file_manager/foreground/js/media/media_controls.js
@@ -490,8 +490,10 @@ MediaControls.prototype.encodeState = function() {
if (!this.media_.duration)
return;
- window.appState.time = this.media_.currentTime;
- util.saveAppState();
+ if (window.appState) {
+ window.appState.time = this.media_.currentTime;
+ util.saveAppState();
+ }
return;
};
@@ -500,11 +502,11 @@ MediaControls.prototype.encodeState = function() {
* @return {boolean} True if decode succeeded.
*/
MediaControls.prototype.decodeState = function() {
- if (!('time' in window.appState))
+ if (!window.appState || !('time' in window.appState))
return false;
// There is no page reload for apps v2, only app restart.
// Always restart in paused state.
- this.media_.currentTime = appState.time;
+ this.media_.currentTime = window.appState.time;
this.pause();
return true;
};
@@ -513,6 +515,9 @@ MediaControls.prototype.decodeState = function() {
* Remove current state from the page URL or the app state.
*/
MediaControls.prototype.clearState = function() {
+ if (!window.appState)
+ return;
+
if ('time' in window.appState)
delete window.appState.time;
util.saveAppState();
« no previous file with comments | « chrome/browser/resources/component_extension_resources.grd ('k') | chrome/browser/resources/video_player/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698