Last Comment Bug 503828 - play event does not fire when playing a video again after it has ended
: play event does not fire when playing a video again after it has ended
Status: RESOLVED INVALID
: dev-doc-complete
Product: Core
Classification: Components
Component: Audio/Video (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-12 23:30 PDT by thehans
Modified: 2011-03-15 11:45 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description thehans 2009-07-12 23:30:38 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1) Gecko/20090701 Ubuntu/9.04 (jaunty) Shiretoko/3.5
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1) Gecko/20090701 Ubuntu/9.04 (jaunty) Shiretoko/3.5

When viewing watching HTML 5 video elements, the play event does not fire when the user starts a video over again, after the video has played fully to it's ending.

Reproducible: Always

Steps to Reproduce:
1. Open some page uses a video element.  (Ex. http://tinyvid.tv/show/7xq3b42nh844 )
2. Assign an observable function to the play event. For example paste the following into your location bar and hit enter: javascript:document.getElementsByTagName("video")[0].addEventListener("play",function(){alert("playing");},false);
3. Play the video until it reaches the end.
4. Click play button again.
Actual Results:  
Play event does not fire

Expected Results:  
Play event should fire
Comment 1 Brian Birtles (:birtles) 2010-10-07 18:18:54 PDT
I'm seeing this too on Windows on a current trunk build. This is causing problems with a demo I'm trying to build.
Comment 2 Matthew Gregan [:kinetik] 2010-10-07 18:31:26 PDT
This is because play is only fired when the element was previously paused.  When an element plays through to the end, it does not become paused when it ends.  So a second play-through will not fire a second play event.  I believe our behaviour is correct wrt to the spec.  play may fire before playback actually begins (e.g. if we need to wait for more data before we can play).

I think you want to be listening for the playing event, which fires every time the element actually begins playing.
Comment 3 Brian Birtles (:birtles) 2010-10-07 18:36:23 PDT
That sounds good.

We need to update https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox though

Both to add the playing event and fix the description of 'play' which is currently incorrect: "Sent when playback starts or resumes."
Comment 4 Eric Shepherd [:sheppy] 2011-03-15 11:45:54 PDT
Documentation updated.

Note You need to log in before you can comment on or make changes to this bug.