From 763ba4a3f261ac56ea4f84fe65bcb1dadbfdde06 Mon Sep 17 00:00:00 2001 From: Christopher De Cairos Date: Wed, 8 Jun 2011 11:40:44 -0400 Subject: [PATCH] initial work --- players/youtube/popcorn.youtube.html | 8 ++++---- players/youtube/popcorn.youtube.js | 10 +++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/players/youtube/popcorn.youtube.html b/players/youtube/popcorn.youtube.html index b340c16..c8dbf55 100644 --- a/players/youtube/popcorn.youtube.html +++ b/players/youtube/popcorn.youtube.html @@ -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 @@ -101,8 +101,8 @@ .listen('pause', function() { paused = true; element( 'btn-play-pause' ).innerHTML = 'Play'; - }) - .mute() + })*/ + popcorn.mute() .play(); // Setup UI after loaded diff --git a/players/youtube/popcorn.youtube.js b/players/youtube/popcorn.youtube.js index 4ef1185..f42e09c 100644 --- a/players/youtube/popcorn.youtube.js +++ b/players/youtube/popcorn.youtube.js @@ -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; -- 2.43.0