is there an JavaScript event triggered, if a HTML5 video is ready for playback?
I assume that ready for playback means that the readyState
property is equal to HAVE_ENOUGH_DATA
constant (numeric value 4). According to the doc, when the readyState property turn to this value, a canplay
event should be fired.
Good discussion here...
http://tiffanybbrown.com/2010/07/05/the-html5-video-progress-event/
Especially the first comment.
Basically, this was in the spec and was removed because it didn't exactly go hand in hand with the way media is rendered. Instead, .buffered was added.
Here is an example of buffered in use:
http://hacks.mozilla.org/2010/08/html5-video-buffered-property-available-in-firefox-4/
You have 2 events to handle when a video is ready to play.
Just came across this question and although it is a little old I am posting this for future readers (who; like me, probably come from Google).
So as of today this is the event list for html5 media (according to W3C):
Dantz was looking for oncanplaythrough.
Hope this helps.
I have found http://www.w3.org/TR/html5/video.html#mediaevents to be extremely useful as it lists all the events that are available when it comes to html5 media tags.