activated youtube support. popcorn-port
authorhamidouk
Mon, 07 Nov 2011 15:27:12 +0100
branchpopcorn-port
changeset 198 8ffb1b7a9c6b
parent 197 a793a8a0c9d2
child 199 055cc2e81941
activated youtube support.
src/js/init.js
--- a/src/js/init.js	Fri Nov 04 16:30:22 2011 +0100
+++ b/src/js/init.js	Mon Nov 07 15:27:12 2011 +0100
@@ -23,6 +23,19 @@
           delete opts.container;
           pop = Popcorn.jwplayer("#" + containerDiv, "", opts);
         break;
+      
+      case "youtube":
+          var opts = IriSP.jQuery.extend({}, options);
+          delete opts.container;
+          opts.controls = 0;
+          opts.autostart = false;
+          templ = "width: {{width}}px; height: {{height}}px; margin-bottom: 5px;";
+          var str = Mustache.to_html(templ, {width: opts.width, height: opts.height});    
+          // Popcorn.youtube wants us to specify the size of the player in the style attribute of its container div.
+          IriSP.jQuery("#" + containerDiv).attr("style", str);
+          
+          pop = Popcorn.youtube("#" + containerDiv, opts.video, opts);
+        break;
         
       default:
         pop = undefined;