src/widgets/Slider.js
branchplayers-as-widgets
changeset 957 4da0a5740b6c
parent 909 aa0e42229784
child 960 9a278b9e3b05
equal deleted inserted replaced
956:7c1d08cf6956 957:4da0a5740b6c
    28         range: "min",
    28         range: "min",
    29         value: 0,
    29         value: 0,
    30         min: 0,
    30         min: 0,
    31         max: this.source.getDuration().milliseconds,
    31         max: this.source.getDuration().milliseconds,
    32         slide: function(event, ui) {
    32         slide: function(event, ui) {
    33             _this.player.popcorn.currentTime(ui.value / 1000);
    33             _this.media.setCurrentTime(ui.value);
    34             _this.player.popcorn.trigger("IriSP.Mediafragment.setHashToTime");
    34             _this.player.trigger("Mediafragment.setHashToTime");
    35         }
    35         }
    36     });
    36     });
    37     
    37     
    38     this.$handle = this.$slider.find('.ui-slider-handle');
    38     this.$handle = this.$slider.find('.ui-slider-handle');
    39     
    39     
    40     this.bindPopcorn("timeupdate","onTimeupdate");
    40     this.onMediaEvent("timeupdate","onTimeupdate");
    41     this.bindPopcorn("IriSP.PlayerWidget.MouseOver","onMouseover");
    41     this.onMdpEvent("PlayerWidget.MouseOver","onMouseover");
    42     this.bindPopcorn("IriSP.PlayerWidget.MouseOut","onMouseout");
    42     this.onMdpEvent("PlayerWidget.MouseOut","onMouseout");
    43     
    43     
    44     if (this.minimize_timeout) {
    44     if (this.minimize_timeout) {
    45         this.$slider.css(this.calculateSliderCss(this.minimized_height));
    45         this.$slider.css(this.calculateSliderCss(this.minimized_height));
    46         this.$handle.css(this.calculateHandleCss(this.minimized_height));
    46         this.$handle.css(this.calculateHandleCss(this.minimized_height));
    47         
    47         
    52         this.maximized = false;
    52         this.maximized = false;
    53         this.timeoutId = false;
    53         this.timeoutId = false;
    54     }
    54     }
    55 };
    55 };
    56 
    56 
    57 IriSP.Widgets.Slider.prototype.onTimeupdate = function() {
    57 IriSP.Widgets.Slider.prototype.onTimeupdate = function(_time) {
    58     var _time = 1000 * this.player.popcorn.currentTime();
       
    59     this.$slider.slider("value",_time);
    58     this.$slider.slider("value",_time);
    60     this.player.popcorn.trigger("IriSP.Arrow.updatePosition",{widget: this.type, time: _time});
    59     this.player.trigger("Arrow.updatePosition",{widget: this.type, time: _time});
    61 }
    60 }
    62 
    61 
    63 IriSP.Widgets.Slider.prototype.onMouseover = function() {
    62 IriSP.Widgets.Slider.prototype.onMouseover = function() {
    64     if (this.minimize_timeout) {
    63     if (this.minimize_timeout) {
    65         if (this.timeoutId) {
    64         if (this.timeoutId) {