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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 * @private | 674 * @private |
675 */ | 675 */ |
676 MediaControls.Slider.prototype.onInputDrag_ = function(on) { | 676 MediaControls.Slider.prototype.onInputDrag_ = function(on) { |
677 this.isDragging_ = on; | 677 this.isDragging_ = on; |
678 this.onDrag_(on); | 678 this.onDrag_(on); |
679 }; | 679 }; |
680 | 680 |
681 /** | 681 /** |
682 * Create a customized slider with animated thumb movement. | 682 * Create a customized slider with animated thumb movement. |
683 * | 683 * |
| 684 * @constructor |
684 * @param {HTMLElement} container The containing div element. | 685 * @param {HTMLElement} container The containing div element. |
685 * @param {number} value Initial value [0..1]. | 686 * @param {number} value Initial value [0..1]. |
686 * @param {number} range Number of distinct slider positions to be supported. | 687 * @param {number} range Number of distinct slider positions to be supported. |
687 * @param {function(number)} onChange Value change handler. | 688 * @param {function(number)} onChange Value change handler. |
688 * @param {function(boolean)} onDrag Drag begin/end handler. | 689 * @param {function(boolean)} onDrag Drag begin/end handler. |
689 * @param {function(number):string} formatFunction Value formatting function. | 690 * @param {function(number):string} formatFunction Value formatting function. |
690 */ | 691 */ |
691 MediaControls.AnimatedSlider = function( | 692 MediaControls.AnimatedSlider = function( |
692 container, value, range, onChange, onDrag, formatFunction) { | 693 container, value, range, onChange, onDrag, formatFunction) { |
693 MediaControls.Slider.apply(this, arguments); | 694 MediaControls.Slider.apply(this, arguments); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 } | 728 } |
728 }.bind(this), | 729 }.bind(this), |
729 MediaControls.AnimatedSlider.DURATION / MediaControls.AnimatedSlider.STEPS); | 730 MediaControls.AnimatedSlider.DURATION / MediaControls.AnimatedSlider.STEPS); |
730 }; | 731 }; |
731 | 732 |
732 /** | 733 /** |
733 * Create a customized slider with a precise time feedback. | 734 * Create a customized slider with a precise time feedback. |
734 * | 735 * |
735 * The time value is shown above the slider bar at the mouse position. | 736 * The time value is shown above the slider bar at the mouse position. |
736 * | 737 * |
| 738 * @constructor |
737 * @param {HTMLElement} container The containing div element. | 739 * @param {HTMLElement} container The containing div element. |
738 * @param {number} value Initial value [0..1]. | 740 * @param {number} value Initial value [0..1]. |
739 * @param {number} range Number of distinct slider positions to be supported. | 741 * @param {number} range Number of distinct slider positions to be supported. |
740 * @param {function(number)} onChange Value change handler. | 742 * @param {function(number)} onChange Value change handler. |
741 * @param {function(boolean)} onDrag Drag begin/end handler. | 743 * @param {function(boolean)} onDrag Drag begin/end handler. |
742 * @param {function(number):string} formatFunction Value formatting function. | 744 * @param {function(number):string} formatFunction Value formatting function. |
743 */ | 745 */ |
744 MediaControls.PreciseSlider = function( | 746 MediaControls.PreciseSlider = function( |
745 container, value, range, onChange, onDrag, formatFunction) { | 747 container, value, range, onChange, onDrag, formatFunction) { |
746 MediaControls.Slider.apply(this, arguments); | 748 MediaControls.Slider.apply(this, arguments); |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 AudioControls.prototype.onAdvanceClick_ = function(forward) { | 1131 AudioControls.prototype.onAdvanceClick_ = function(forward) { |
1130 if (!forward && | 1132 if (!forward && |
1131 (this.getMedia().currentTime > AudioControls.TRACK_RESTART_THRESHOLD)) { | 1133 (this.getMedia().currentTime > AudioControls.TRACK_RESTART_THRESHOLD)) { |
1132 // We are far enough from the beginning of the current track. | 1134 // We are far enough from the beginning of the current track. |
1133 // Restart it instead of than skipping to the previous one. | 1135 // Restart it instead of than skipping to the previous one. |
1134 this.getMedia().currentTime = 0; | 1136 this.getMedia().currentTime = 0; |
1135 } else { | 1137 } else { |
1136 this.advanceTrack_(forward); | 1138 this.advanceTrack_(forward); |
1137 } | 1139 } |
1138 }; | 1140 }; |
OLD | NEW |