OLD | NEW |
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 Loading... |
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 // Re-start playing the video when the seek bar is moved from ending point. |
| 349 if (this.media_.ended) |
| 350 this.play(); |
| 351 |
348 var current = this.media_.duration * value; | 352 var current = this.media_.duration * value; |
349 this.media_.currentTime = current; | 353 this.media_.currentTime = current; |
350 this.updateTimeLabel_(current); | 354 this.updateTimeLabel_(current); |
351 }; | 355 }; |
352 | 356 |
353 /** | 357 /** |
354 * @private | 358 * @private |
355 */ | 359 */ |
356 MediaControls.prototype.onProgressDrag_ = function() { | 360 MediaControls.prototype.onProgressDrag_ = function() { |
357 if (!this.media_) | 361 if (!this.media_) |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 } else { | 1088 } else { |
1085 this.container_.removeAttribute('fullscreen'); | 1089 this.container_.removeAttribute('fullscreen'); |
1086 } | 1090 } |
1087 | 1091 |
1088 if (this.fullscreenButton_) { | 1092 if (this.fullscreenButton_) { |
1089 this.fullscreenButton_.setAttribute('aria-label', | 1093 this.fullscreenButton_.setAttribute('aria-label', |
1090 fullscreen ? str('VIDEO_PLAYER_EXIT_FULL_SCREEN_BUTTON_LABEL') | 1094 fullscreen ? str('VIDEO_PLAYER_EXIT_FULL_SCREEN_BUTTON_LABEL') |
1091 : str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));; | 1095 : str('VIDEO_PLAYER_FULL_SCREEN_BUTTON_LABEL'));; |
1092 } | 1096 } |
1093 }; | 1097 }; |
OLD | NEW |