此代码显示YouTube视频。
<script type="text/javascript">
var params = { allowScriptAccess: "always" };
var atts = { id: "myytplayer" };
swfobject.embedSWF("http://www.youtube.com/v/P5_GlAOCHyE?enablejsapi=1&playerapiid=ytplayer&allowFullScreen=false&autoplay=0&loop=1&autohide=0&border=0&color2=0xCCCCCC",
"ytapiplayer", "480", "270", "8", null, null, params, atts)
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myytplayer");
}
</script>
此按钮开始在30秒位置播放视频 它在FireFox上运行正常但在Safari上运行不正常。
为什么呢?我该如何解决这个问题?
<button name="test" onclick="ytplayer.seekTo(30,true)">Start</button>
答案 0 :(得分:1)
在Safari for mac上工作正常,请参阅演示。
检查:
<head>
代码:http://code.google.com/p/swfobject/issues/detail?id=222