The default bug view has changed. See this FAQ.

play event does not fire when playing a video again after it has ended

RESOLVED INVALID

Status

()

Core
Audio/Video
RESOLVED INVALID
8 years ago
6 years ago

People

(Reporter: thehans, Unassigned)

Tracking

({dev-doc-complete})

Trunk
dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
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
I'm seeing this too on Windows on a current trunk build. This is causing problems with a demo I'm trying to build.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86_64 → All
Component: General → Video/Audio
Product: Firefox → Core
QA Contact: general → video.audio
Version: unspecified → Trunk
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.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
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."
Keywords: dev-doc-needed
Documentation updated.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.