]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
initial work
authorChristopher De Cairos <chris.decairos@gmail.com>
Wed, 8 Jun 2011 15:40:44 +0000 (11:40 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Wed, 8 Jun 2011 15:40:44 +0000 (11:40 -0400)
players/youtube/popcorn.youtube.html
players/youtube/popcorn.youtube.js

index b340c165939ad33505a6d11516d1dd29e2fa22b5..c8dbf55b9c44fe36d14204c24334d21ae9b7e2fd 100644 (file)
@@ -22,9 +22,9 @@
           var paused = true,
               popcorn;
           
-          popcorn = Popcorn( Popcorn.youtube( 'video', 'http://www.youtube.com/watch?v=9oar9glUCL0', { width: 400 } ) );
+          popcorn = Popcorn( Popcorn.youtube( 'video', 'http://www.youtube.com/watch?v=9oar9glUCL0', { width: 400, controls: 0, annotations: 3 } ) );
           
-          popcorn = popcorn
+          /*popcorn = popcorn
             .footnote({
               start: 5, // seconds
               end: 40, // seconds
           .listen('pause', function() {
             paused = true;
             element( 'btn-play-pause' ).innerHTML = 'Play';
-          })
-          .mute()
+          })*/
+          popcorn.mute()
           .play();
             
           // Setup UI after loaded
index 4ef1185a0016a46caab0b77d77bbdc44a6cce941..f42e09cf177ed7b73d764732cd723d446e9cdf5a 100644 (file)
@@ -133,7 +133,9 @@ var onYouTubePlayerReady;
       id: this.playerId
     };
     
-    swfobject.embedSWF( "http://www.youtube.com/e/" + this.vidId +"?enablejsapi=1&playerapiid=" + this.playerId + "&version=3", 
+    
+    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", 
                       this.playerId, this.width, this.height, "8", null, flashvars, params, attributes );
   }
   
@@ -180,6 +182,12 @@ var onYouTubePlayerReady;
     options.width = options.width && (+options.width)+"px";
     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; 
+    
+    // show video annotations, 1 is show, 3 is hide
+    this.iv_load_policy = +options.annotations === 1 || +options.annotations === 3 ? options.annotations : 1;
+    
     this._target = document.getElementById( elementId );
     this._container = document.createElement( "div" );
     this._container.id = this.playerId;