Can't control Youtube embed even with document.getElementById('xyz').playVideo() - not a function?

后端 未结 4 622
悲哀的现实
悲哀的现实 2021-01-06 14:24

OK, I\'m stuck and I don\'t know what\'s wrong even after following Google\'s docs and reading suggestions here on Stackoverflow. Why can\'t I control Youtube embeds in my

4条回答
  •  星月不相逢
    2021-01-06 14:49

    What happens if you use the id "o1" instead of "e1"?

    OK well on this page: http://code.google.com/apis/youtube/js_api_reference.html it seems to me that the "swfobject" library needs to be included in order for that API to be available. I'll try it.

    [edit] OK here's what I've got:

    
      
        
        
        
      
      
        
    Foo

    This works, but oddly enough it only works when I serve it from a real web server. If I put that in a local file and load it up in the browser, it doesn't work. I don't know why but then I'm absolutely not a Flash expert, or a YouTube expert.

    See http://gutfullofbeer.net/youtube.html (same as what's typed in above)

提交回复
热议问题