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

Side by Side Diff: ui/file_manager/video_player/js/media_controls.js

Issue 2263033002: Let a video resume automatically when changing the playback position after the playback has finished (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 * @fileoverview MediaControls class implements media playback controls 6 * @fileoverview MediaControls class implements media playback controls
7 * that exist outside of the audio/video HTML element. 7 * that exist outside of the audio/video HTML element.
8 */ 8 */
9 9
10 /** 10 /**
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 if (!this.media_) 338 if (!this.media_)
339 return; // Media is detached. 339 return; // Media is detached.
340 340
341 if (!this.media_.seekable || !this.media_.duration) { 341 if (!this.media_.seekable || !this.media_.duration) {
342 console.error('Inconsistent media state'); 342 console.error('Inconsistent media state');
343 return; 343 return;
344 } 344 }
345 345
346 this.setSeeking_(false); 346 this.setSeeking_(false);
347 347
348 if (this.media_.ended)
fukino 2016/08/22 07:22:01 nit: Please add a comment explaining that we shoul
harukam1 2016/08/22 08:34:03 Acknowledged.
349 this.play();
350
348 var current = this.media_.duration * value; 351 var current = this.media_.duration * value;
349 this.media_.currentTime = current; 352 this.media_.currentTime = current;
350 this.updateTimeLabel_(current); 353 this.updateTimeLabel_(current);
351 }; 354 };
352 355
353 /** 356 /**
354 * @private 357 * @private
355 */ 358 */
356 MediaControls.prototype.onProgressDrag_ = function() { 359 MediaControls.prototype.onProgressDrag_ = function() {
357 if (!this.media_) 360 if (!this.media_)
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 } else { 1087 } else {
1085 this.container_.removeAttribute('fullscreen'); 1088 this.container_.removeAttribute('fullscreen');
1086 } 1089 }
1087 1090
1088 if (this.fullscreenButton_) { 1091 if (this.fullscreenButton_) {
1089 this.fullscreenButton_.setAttribute('aria-label', 1092 this.fullscreenButton_.setAttribute('aria-label',
1090 fullscreen ? str('VIDEO_PLAYER_EXIT_FULL_SCREEN_BUTTON_LABEL') 1093 fullscreen ? str('VIDEO_PLAYER_EXIT_FULL_SCREEN_BUTTON_LABEL')
1091 : str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));; 1094 : str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));;
1092 } 1095 }
1093 }; 1096 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698