我有以下 Javascript 代码,但视频没有自动启动,为什么?
var params = { allowScriptAccess: "always" };
var atts = { id: "myvideoplayer"};
var flashvars = {autostart: true};
swfobject.embedSWF(
"http://www.youtube.com/v/MHRj8BYm240?enablejsapi=1&playerapiid=ytplayer&version=3", "ytplayer", "425", "365", "8", null, flashvars, params, atts);
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myvideoplayer");
//ytplayer.playVideo();
}
好的,也许我应该在 YouTube 播放器准备好后立即使用,playVideo()
但是其他 flashvars怎么样?displayclick
click