[whatwg] Media play/playing event when replaying loaded resource

Matthew Gregan kinetik at flim.org
Thu Mar 12 19:11:45 PDT 2009


It's possible that neither a 'play' nor 'playing' event will be fired when a
media element that has ended playback is played again.  When first played,
paused is set to false.  When played again, playback has ended, so play()
seeks to the beginning, but paused does not change (as it's already false),
so the substeps that may fire play or playing are not run.

If the media resource is cached, the readyState remains at HAVE_FUTURE_DATA,
so any 'play' or 'playing' events triggered by state transitions are not

This behaviour seems reasonable if the media element has a loop attribute,
since playback never really stops (as it restarts immediately upon ending).
For non-looping media it seems strange that no event is raised to indicate
that playback has begun again.

Looking at the event summary table, it seems reasonable to expect a
'playing' event to be fired during the second play through, but this doesn't
happen because none of the steps that required the event to be fired are
reached during the second play through.

Is this the intended behaviour or a case the spec does not handle correctly?

Matthew Gregan                     |/
                                  /|                    kinetik at flim.org

More information about the whatwg mailing list