slightly change the code the change the button. popcorn-port
authorhamidouk
Thu, 08 Dec 2011 15:51:46 +0100
branchpopcorn-port
changeset 440 bf9307640e55
parent 439 1c1eebd0d080
child 441 99b7c5192330
slightly change the code the change the button.
src/js/widgets/playerWidget.js
--- a/src/js/widgets/playerWidget.js	Thu Dec 08 12:53:51 2011 +0100
+++ b/src/js/widgets/playerWidget.js	Thu Dec 08 15:51:46 2011 +0100
@@ -23,6 +23,7 @@
   // handle clicks by the user on the video.
   this._Popcorn.listen("play", IriSP.wrap(this, this.playButtonUpdater));
   this._Popcorn.listen("pause", IriSP.wrap(this, this.playButtonUpdater));
+
   this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.timeDisplayUpdater));
   this._Popcorn.listen("IriSP.search.matchFound", IriSP.wrap(this, this.searchMatch));
   this._Popcorn.listen("IriSP.search.noMatchFound", IriSP.wrap(this, this.searchNoMatch));
@@ -74,13 +75,14 @@
 */
 IriSP.PlayerWidget.prototype.playButtonUpdater = function() {
   var status = this._Popcorn.media.paused;
+  console.log("called!");
   
   if ( status == true ){        
     this.selector.find(".Ldt-CtrlPlay").attr("title", "Play");
    
     // we use templToHTML because it has some predefined
     // vars like where to get the images
-    var templ = IriSP.templToHTML("url({{img_dir}}/pause_sprite.png)");
+    var templ = IriSP.templToHTML("url({{img_dir}}/play_sprite.png)");
     this.selector.find(".Ldt-CtrlPlay").css("background-image", templ);
 
   } else {
@@ -88,17 +90,17 @@
 
     // we use templToHTML because it has some predefined
     // vars like where to get the images
-    var templ = IriSP.templToHTML("url({{img_dir}}/play_sprite.png)");
+    var templ = IriSP.templToHTML("url({{img_dir}}/pause_sprite.png)");
     this.selector.find(".Ldt-CtrlPlay").css("background-image", templ);
   }  
+
+  return;
 };
 
 
 IriSP.PlayerWidget.prototype.playHandler = function() {
   var status = this._Popcorn.media.paused;
   
-  this.playButtonUpdater();
-  
   if ( status == true ){        
     this._Popcorn.play();   
   } else {