From c19a0da9a8d5407c84fab4235001b017097b7a10 Mon Sep 17 00:00:00 2001 From: Christopher De Cairos Date: Wed, 8 Jun 2011 16:48:39 -0400 Subject: [PATCH] you can now toggle controls, and annotations --- players/youtube/popcorn.youtube.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/players/youtube/popcorn.youtube.js b/players/youtube/popcorn.youtube.js index f42e09c..d0c5e12 100644 --- a/players/youtube/popcorn.youtube.js +++ b/players/youtube/popcorn.youtube.js @@ -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; -- 2.43.0