currentTime() does not work inside player.ready() in safari
http://jsbin.com/lizarefopo/edit?html,output
Explain in detail the exact steps necessary to reproduce the issue.
Video should start at 10s
Video starts at 0s
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Video.js Example Embed</title>
<link href="http://vjs.zencdn.net/6.2.8/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/6.2.8/video.js"></script>
</head>
<body>
<h1>Video.js Example Embed</h1>
<video id="my_video_1" class="video-js" muted controls preload="auto" width="640" height="268"
data-setup='{}'>
<source src="http://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
<source src="http://vjs.zencdn.net/v/oceans.webm" type='video/webm'>
</video>
<script>
var player = videojs('my_video_1').ready(function () {
this.currentTime(10)
this.play()
})
</script>
</body>
</html>
Yeah, this is because Safari is weird and you can't actually change the current time at least until loadedmetadata but sometimes even later like until canplay is fired.
Video.js should probably handle this better, though.
Tested on Chrome, Safari on iPhone. Both are not working.
Any suggestion how to work around it for now?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still currentTime() not working in 7+ version. ..
@scottgrayson Have you found the solution to make it work in Safari and iOS devices?
Most helpful comment
Still currentTime() not working in 7+ version. ..