I am trying to play and control a youtube video via java开发者_JAVA百科script using the swfobject.js library. The video plays fine in IE6 and IE7, but I only get audio using firefox. I don't even get a flash object showing up, and the innerHTML attribute doesn't give me any .
Are you using the code examples from the YouTube API page? They seem to work (most) of the time when you recreate them on your own server, but can be a bit buggy.
It took me a while to make sense of it, but setting the
var atts = { id: "myytplayer" }; and understanding that it replaces the div took some head scratching.
Demo http://code.google.com/apis/youtube/youtube_player_demo.html?playerType=embedded&playerVersion=as3
Function Reference http://code.google.com/apis/youtube/js_api_reference.html
精彩评论