This code shows YouTube video.
<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>
This button starts playing the video at 30 seconds position.
It's working fine on FireFox but not on Safari.
Why? and how can I fix this?
<button name="test" onclick="ytplayer.seekTo(30,true)">Start</button>
On Safari for mac works fine, see the demo.
Check that:
<head>
tag defined: http://code.google.com/p/swfobject/issues/detail?id=222