src/js/widgets/playerWidget.js
branchpopcorn-port
changeset 226 d1f0e604bd06
parent 202 2e0205ee7ca9
child 238 6008172a0592
child 250 41683e7cb17a
equal deleted inserted replaced
225:53a712511a08 226:d1f0e604bd06
    52      //__IriSP.jQuery(this).slideUp(); 
    52      //__IriSP.jQuery(this).slideUp(); 
    53   } );
    53   } );
    54 
    54 
    55   var LdtpPlayerY = this.selector.children("#Ldt-PlaceHolder").attr("top");
    55   var LdtpPlayerY = this.selector.children("#Ldt-PlaceHolder").attr("top");
    56   var LdtpPlayerX = this.selector.children("#Ldt-PlaceHolder").attr("left");
    56   var LdtpPlayerX = this.selector.children("#Ldt-PlaceHolder").attr("left");
    57   
       
    58   this.selector.find("#slider-range-min").slider( { //range: "min",
       
    59     value: 0,
       
    60     min: 1,
       
    61     max: this._serializer.currentMedia().meta["dc:duration"]/1000,//1:54:52.66 = 3600+3240+
       
    62     step: 0.1,
       
    63     slide: function(event, ui) {     
       
    64       self._Popcorn.currentTime(ui.value);
       
    65     },
       
    66     /* change event is similar to slide, but it happens when the slider position is 
       
    67        modified programatically. We use it for unit tests */       
       
    68     change: function(event, ui) {      
       
    69       self._Popcorn.trigger("test.fixture", ui.value);
       
    70     }
       
    71     
    57     
    72   } );
       
    73   
       
    74   // handle clicks by the user on the video.
    58   // handle clicks by the user on the video.
    75   this._Popcorn.listen("play", IriSP.wrap(this, this.playButtonUpdater));
    59   this._Popcorn.listen("play", IriSP.wrap(this, this.playButtonUpdater));
    76   this._Popcorn.listen("pause", IriSP.wrap(this, this.playButtonUpdater));
    60   this._Popcorn.listen("pause", IriSP.wrap(this, this.playButtonUpdater));
    77   
    61   
    78   this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.sliderUpdater));
       
    79   this.selector.children("#amount").val(this.selector.children("#slider-range-min").slider("value")+" s");
    62   this.selector.children("#amount").val(this.selector.children("#slider-range-min").slider("value")+" s");
    80   this.selector.children(".Ldt-Control1 button:first").button({
    63   this.selector.children(".Ldt-Control1 button:first").button({
    81     icons: {
    64     icons: {
    82       primary: 'ui-icon-play'
    65       primary: 'ui-icon-play'
    83     },
    66     },
   151       this._Popcorn.mute(false);
   134       this._Popcorn.mute(false);
   152       this.selector.find( ".ui-icon-volume-on" ).css("background-position", "-144px -160px" );
   135       this.selector.find( ".ui-icon-volume-on" ).css("background-position", "-144px -160px" );
   153     }
   136     }
   154 };
   137 };
   155 
   138 
   156 /* updates the slider as time passes */
       
   157 IriSP.PlayerWidget.prototype.sliderUpdater = function() {  
       
   158   var currentPosition = this._Popcorn.currentTime();   
       
   159 	this.selector.find( "#slider-range-min" ).slider( "value", currentPosition);		
       
   160 };
       
   161 
       
   162 IriSP.PlayerWidget.prototype.searchButtonHandler = function() {
   139 IriSP.PlayerWidget.prototype.searchButtonHandler = function() {
   163     var self = this;
   140     var self = this;
   164 
   141 
   165     /* show the search field if it is not shown */
   142     /* show the search field if it is not shown */
   166   	if ( this._searchBlockOpen == false ) {
   143   	if ( this._searchBlockOpen == false ) {