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 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 /** | 1060 /** |
1061 * Toggles the looped mode with feedback. | 1061 * Toggles the looped mode with feedback. |
1062 * @param {boolean} on Whether enabled or not. | 1062 * @param {boolean} on Whether enabled or not. |
1063 */ | 1063 */ |
1064 VideoControls.prototype.toggleLoopedModeWithFeedback = function(on) { | 1064 VideoControls.prototype.toggleLoopedModeWithFeedback = function(on) { |
1065 if (!this.getMedia().duration) | 1065 if (!this.getMedia().duration) |
1066 return; | 1066 return; |
1067 this.toggleLoopedMode(on); | 1067 this.toggleLoopedMode(on); |
1068 if (on) { | 1068 if (on) { |
1069 // TODO(mtomasz): Simplify, crbug.com/254318. | 1069 // TODO(mtomasz): Simplify, crbug.com/254318. |
1070 this.showTextBanner_('GALLERY_VIDEO_LOOPED_MODE'); | 1070 this.showTextBanner_('VIDEO_PLAYER_LOOPED_MODE'); |
1071 } | 1071 } |
1072 }; | 1072 }; |
1073 | 1073 |
1074 /** | 1074 /** |
1075 * Toggles the looped mode. | 1075 * Toggles the looped mode. |
1076 * @param {boolean} on Whether enabled or not. | 1076 * @param {boolean} on Whether enabled or not. |
1077 */ | 1077 */ |
1078 VideoControls.prototype.toggleLoopedMode = function(on) { | 1078 VideoControls.prototype.toggleLoopedMode = function(on) { |
1079 this.getMedia().loop = on; | 1079 this.getMedia().loop = on; |
1080 }; | 1080 }; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 AudioControls.prototype.onAdvanceClick_ = function(forward) { | 1227 AudioControls.prototype.onAdvanceClick_ = function(forward) { |
1228 if (!forward && | 1228 if (!forward && |
1229 (this.getMedia().currentTime > AudioControls.TRACK_RESTART_THRESHOLD)) { | 1229 (this.getMedia().currentTime > AudioControls.TRACK_RESTART_THRESHOLD)) { |
1230 // We are far enough from the beginning of the current track. | 1230 // We are far enough from the beginning of the current track. |
1231 // Restart it instead of than skipping to the previous one. | 1231 // Restart it instead of than skipping to the previous one. |
1232 this.getMedia().currentTime = 0; | 1232 this.getMedia().currentTime = 0; |
1233 } else { | 1233 } else { |
1234 this.advanceTrack_(forward); | 1234 this.advanceTrack_(forward); |
1235 } | 1235 } |
1236 }; | 1236 }; |
OLD | NEW |