src/widgets/Slider.js
branchnew-model
changeset 887 6a04bd37da0a
parent 881 f11b234497f7
child 909 aa0e42229784
equal deleted inserted replaced
884:10233337f6da 887:6a04bd37da0a
    29     
    29     
    30     this.$slider.slider({
    30     this.$slider.slider({
    31         range: "min",
    31         range: "min",
    32         value: 0,
    32         value: 0,
    33         min: 0,
    33         min: 0,
    34         max: this.source.getDuration().getSeconds(),
    34         max: this.source.getDuration().milliseconds,
    35         slide: function(event, ui) {
    35         slide: function(event, ui) {
    36             _this.player.popcorn.currentTime(ui.value);
    36             _this.player.popcorn.currentTime(ui.value / 1000);
    37             _this.player.popcorn.trigger("IriSP.Mediafragment.setHashToTime");
    37             _this.player.popcorn.trigger("IriSP.Mediafragment.setHashToTime");
    38         }
    38         }
    39     });
    39     });
    40     
    40     
    41     this.$handle = this.$slider.find('.ui-slider-handle');
    41     this.$handle = this.$slider.find('.ui-slider-handle');
    49     this.maximized = false;
    49     this.maximized = false;
    50     this.timeoutId = false;
    50     this.timeoutId = false;
    51 };
    51 };
    52 
    52 
    53 IriSP.Widgets.Slider.prototype.onTimeupdate = function() {
    53 IriSP.Widgets.Slider.prototype.onTimeupdate = function() {
    54     var _time = this.player.popcorn.currentTime();
    54     var _time = 1000 * this.player.popcorn.currentTime();
    55     this.$slider.slider("value",_time);
    55     this.$slider.slider("value",_time);
    56     this.player.popcorn.trigger("IriSP.Arrow.updatePosition",{widget: this.type, time: 1000 * _time});
    56     this.player.popcorn.trigger("IriSP.Arrow.updatePosition",{widget: this.type, time: _time});
    57 }
    57 }
    58 
    58 
    59 IriSP.Widgets.Slider.prototype.onMouseover = function() {
    59 IriSP.Widgets.Slider.prototype.onMouseover = function() {
    60     if (this.timeoutId) {
    60     if (this.timeoutId) {
    61         window.clearTimeout(this.timeoutId);
    61         window.clearTimeout(this.timeoutId);