]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
you can now toggle controls, and annotations
authorChristopher De Cairos <chris.decairos@gmail.com>
Wed, 8 Jun 2011 20:48:39 +0000 (16:48 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Wed, 8 Jun 2011 20:48:39 +0000 (16:48 -0400)
players/youtube/popcorn.youtube.js

index f42e09cf177ed7b73d764732cd723d446e9cdf5a..d0c5e12bfb662015463e90c1ae15e44af46a72a1 100644 (file)
@@ -120,22 +120,24 @@ var onYouTubePlayerReady;
     this.offsetParent = container.offsetParent;
     
     flashvars = {
-      playerapiid: this.playerId
+      playerapiid: this.playerId,
+      controls: this.controls,
+      iv_load_policy: this.iv_load_policy
     };
+
     params = {
       allowscriptaccess: 'always',
       allowfullscreen: 'true',
       // This is so we can overlay html on top of Flash
       wmode: 'transparent'
+      
     };
     
     attributes = {
-      id: this.playerId
+      id: this.player
     };
     
-    
-    console.log ("http://www.youtube.com/e/" + this.vidId +"?enablejsapi=1&playerapiid=" + this.playerId + "&controls=" + this.controls + "&iv_load_policy=" + this.iv_load_policy + "&version=3");
-    swfobject.embedSWF( "http://www.youtube.com/e/" + this.vidId +"?enablejsapi=1&playerapiid=" + this.playerId + "&controls=" + this.controls + "&iv_load_policy=" + this.iv_load_policy + "&version=3", 
+    swfobject.embedSWF( "http://www.youtube.com/e/" + this.vidId +"?enablejsapi=1&playerapiid=" + this.playerId + "&version=3", 
                       this.playerId, this.width, this.height, "8", null, flashvars, params, attributes );
   }
   
@@ -183,7 +185,7 @@ var onYouTubePlayerReady;
     options.height = options.height && (+options.height)+"px";
     
     // show controls on video. Integer value - 1 is for show, 0 is for hide
-    this.controls = +options.controls === 1 || +options.controls === 2 ? options.controls : 1; 
+    this.controls = +options.controls === 0 || +options.controls === 1 ? options.controls : 1; 
     
     // show video annotations, 1 is show, 3 is hide
     this.iv_load_policy = +options.annotations === 1 || +options.annotations === 3 ? options.annotations : 1;