Posted By

errkk on 02/04/10


Tagged

embed swfObject YouTube


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

wirenaught


Youtube with SWF object


 / Published in: JavaScript
 

For dynamic publishing without shitty markup

  1. //Swfobject Youtube Embedded video
  2. var youTubeEmbed = function(){
  3. var atts = {};
  4. atts.id = "vid";
  5. swfobject.embedSWF('http://www.youtube.com/v/'+ytVideoID+"&hl=en&fs=1&rel=0&color1=0x000000&color2=0x2d2d2d&enablejsapi=1&playerapiid=ytplayer",
  6. "vid", "640px", "385px", "8", null, null, atts);
  7. };
  8.  
  9. if(ytVideoID != ''){
  10. youTubeEmbed();
  11. }
  12.  
  13.  
  14.  
  15.  
  16.  
  17. <script>
  18. var ytVideoID = "fzzjgBAaWZw";
  19. </script>

Report this snippet  

You need to login to post a comment.