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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * @fileoverview MediaControls class implements media playback controls | 8 * @fileoverview MediaControls class implements media playback controls |
9 * that exist outside of the audio/video HTML element. | 9 * that exist outside of the audio/video HTML element. |
10 */ | 10 */ |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1019 }.bind(this), 0); | 1019 }.bind(this), 0); |
1020 }; | 1020 }; |
1021 | 1021 |
1022 /** | 1022 /** |
1023 * Shows a text banner. | 1023 * Shows a text banner. |
1024 * | 1024 * |
1025 * @param {string} identifier String identifier. | 1025 * @param {string} identifier String identifier. |
1026 * @private | 1026 * @private |
1027 */ | 1027 */ |
1028 VideoControls.prototype.showTextBanner_ = function(identifier) { | 1028 VideoControls.prototype.showTextBanner_ = function(identifier) { |
1029 var text = this.stringFunction_(identifier); | |
1030 | |
1029 this.textBanner_.removeAttribute('visible'); | 1031 this.textBanner_.removeAttribute('visible'); |
1030 this.textBanner_.textContent = this.stringFunction_(identifier); | 1032 this.textBanner_.textContent = text; |
1033 | |
1031 setTimeout(function() { | 1034 setTimeout(function() { |
1035 var onAnimationEnd = function(text, event) { | |
fukino
2014/09/29 08:04:29
This 'text' looks unused. Can we get rid of it?
yoshiki
2014/09/29 08:10:19
Done.
| |
1036 this.textBanner_.removeEventListener( | |
1037 'webkitAnimationEnd', onAnimationEnd); | |
1038 this.textBanner_.removeAttribute('visible'); | |
1039 }.bind(this, text); | |
1040 this.textBanner_.addEventListener('webkitAnimationEnd', onAnimationEnd); | |
1041 | |
1032 this.textBanner_.setAttribute('visible', 'true'); | 1042 this.textBanner_.setAttribute('visible', 'true'); |
1033 }.bind(this), 0); | 1043 }.bind(this), 0); |
1034 }; | 1044 }; |
1035 | 1045 |
1036 /** | 1046 /** |
1037 * Toggle play/pause state on a mouse click on the play/pause button. Can be | 1047 * Toggle play/pause state on a mouse click on the play/pause button. Can be |
1038 * called externally. | 1048 * called externally. |
1039 * | 1049 * |
1040 * @param {Event} event Mouse click event. | 1050 * @param {Event} event Mouse click event. |
1041 */ | 1051 */ |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1227 AudioControls.prototype.onAdvanceClick_ = function(forward) { | 1237 AudioControls.prototype.onAdvanceClick_ = function(forward) { |
1228 if (!forward && | 1238 if (!forward && |
1229 (this.getMedia().currentTime > AudioControls.TRACK_RESTART_THRESHOLD)) { | 1239 (this.getMedia().currentTime > AudioControls.TRACK_RESTART_THRESHOLD)) { |
1230 // We are far enough from the beginning of the current track. | 1240 // We are far enough from the beginning of the current track. |
1231 // Restart it instead of than skipping to the previous one. | 1241 // Restart it instead of than skipping to the previous one. |
1232 this.getMedia().currentTime = 0; | 1242 this.getMedia().currentTime = 0; |
1233 } else { | 1243 } else { |
1234 this.advanceTrack_(forward); | 1244 this.advanceTrack_(forward); |
1235 } | 1245 } |
1236 }; | 1246 }; |
OLD | NEW |