src/js/widgets/playerWidget.js
branchpopcorn-port
changeset 802 c74de6ba5d11
parent 732 823fa16807d4
child 820 7968346b9689
equal deleted inserted replaced
801:f64087bcaf46 802:c74de6ba5d11
    83    the jwplayer window) we have to change the icon without playing/pausing
    83    the jwplayer window) we have to change the icon without playing/pausing
    84 */
    84 */
    85 IriSP.PlayerWidget.prototype.playButtonUpdater = function() {
    85 IriSP.PlayerWidget.prototype.playButtonUpdater = function() {
    86   var status = this._Popcorn.media.paused;
    86   var status = this._Popcorn.media.paused;
    87   
    87   
    88   if ( status == true ){        
    88   if ( status == true ){
       
    89     /* the background sprite is changed by adding/removing the correct classes */
    89     this.selector.find(".Ldt-CtrlPlay").attr("title", "Play");
    90     this.selector.find(".Ldt-CtrlPlay").attr("title", "Play");
    90    
    91     this.selector.find(".Ldt-CtrlPlay").removeClass("Ldt-CtrlPlay-PauseState").addClass("Ldt-CtrlPlay-PlayState");
    91     // we use templToHTML because it has some predefined
       
    92     // vars like where to get the images
       
    93     var templ = IriSP.templToHTML("url({{img_dir}}/play_sprite.png)");
       
    94     this.selector.find(".Ldt-CtrlPlay").css("background-image", templ);
       
    95 
       
    96   } else {
    92   } else {
    97     this.selector.find(".Ldt-CtrlPlay").attr("title", "Pause");
    93     this.selector.find(".Ldt-CtrlPlay").attr("title", "Pause");
    98 
    94     this.selector.find(".Ldt-CtrlPlay").removeClass("Ldt-CtrlPlay-PlayState").addClass("Ldt-CtrlPlay-PauseState");
    99     // we use templToHTML because it has some predefined
       
   100     // vars like where to get the images
       
   101     var templ = IriSP.templToHTML("url({{img_dir}}/pause_sprite.png)");
       
   102     this.selector.find(".Ldt-CtrlPlay").css("background-image", templ);
       
   103   }  
    95   }  
   104 
    96 
   105   return;
    97   return;
   106 };
    98 };
   107 
    99 
   127 IriSP.PlayerWidget.prototype.muteButtonUpdater = function() {
   119 IriSP.PlayerWidget.prototype.muteButtonUpdater = function() {
   128   var status = this._Popcorn.media.muted;
   120   var status = this._Popcorn.media.muted;
   129   
   121   
   130   if ( status == true ){        
   122   if ( status == true ){        
   131     this.selector.find(".Ldt-CtrlSound").attr("title", "Unmute");
   123     this.selector.find(".Ldt-CtrlSound").attr("title", "Unmute");
   132    
   124     this.selector.find(".Ldt-CtrlSound").removeClass("Ldt-CtrlSound-MuteState").addClass("Ldt-CtrlSound-SoundState");    
   133     // we use templToHTML because it has some predefined
       
   134     // vars like where to get the images
       
   135     var templ = IriSP.templToHTML("url({{img_dir}}/sound_sprite.png)");
       
   136     this.selector.find(".Ldt-CtrlSound").css("background-image", templ);
       
   137 
       
   138   } else {
   125   } else {
   139     this.selector.find(".Ldt-CtrlSound").attr("title", "Mute");
   126     this.selector.find(".Ldt-CtrlSound").attr("title", "Mute");
   140 
   127     this.selector.find(".Ldt-CtrlSound").removeClass("Ldt-CtrlSound-SoundState").addClass("Ldt-CtrlSound-MuteState");
   141     // we use templToHTML because it has some predefined
       
   142     // vars like where to get the images
       
   143     var templ = IriSP.templToHTML("url({{img_dir}}/mute_sprite.png)");
       
   144     this.selector.find(".Ldt-CtrlSound").css("background-image", templ);
       
   145   }  
   128   }  
   146 
   129 
   147   return;
   130   return;
   148 };
   131 };
   149 
   132