Chromium Code Reviews| 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 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 Loading... | |
| 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 }; |
| OLD | NEW |