Closed Bug 875699 Opened 11 years ago Closed 11 years ago

'ratechange' event always fired when playback starts

Categories

(Core :: Audio/Video, defect)

20 Branch
x86
All
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: niklas, Assigned: padenot)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31 Steps to reproduce: Starting from Firefox 20.0 (beta) html5 video tag always emits the 'ratechange' event when playback starts. Reproduce: open http://www.w3.org/2010/05/video/mediaevents.html in Firefox, click play button in the video container. Actual results: ratechange event-counter in the table beneath the video gets increased by one Expected results: On other browsers and Firefox 19 and below starting playback doesn't trigger ratechange event. Is this an intentional feature change or a bug?
Component: Untriaged → Video/Audio
Product: Firefox → Core
Confirmed with Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 ID:20130806104538 CSet: 1e381c91885d Chrome 30/MSIE 11 do not fire the Event.
Blocks: 495040
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Mac OS X → All
Assignee: nobody → paul
Firefox's behavior is correct per spec: [1] > When the defaultPlaybackRate or playbackRate attributes change value (either by being set > by script or by being changed directly by the user agent, e.g. in response to user control) > the user agent must queue a task to fire a simple event named ratechange at the media > element. > The "play" function *in the user agent's interface* must set the playbackRate attribute to > the value of the defaultPlaybackRate attribute before invoking the play() method. When a > media element has a current media controller, the attributes and method with those names on > that MediaController object must be used. Otherwise, the attributes and method with those > names on the media element itself must be used. (emphasis mine) That is, when starting the playback using the built-in controls (in other terms, clicking on the "play" icon), 'ratechange' should be fired. When using the |play()| method in script, 'ratechange' should not be fired. [1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#media-elements
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
OK, but how about the fact that also by calling video.play() in script also fires this event on Firefox? It can be observed on the same page ( http://www.w3.org/2010/05/video/mediaevents.html ). Just hit the button beneath the actual media container, which just calls the play() -method. I can produce a minimal sample for this if needed.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
In the current trunk, using the |play()| method in script does not fire the "ratechange" event (clicking on the button that has the |play()|, label, as you say). Can you try on a Nightly build [1] if you can reproduce? It is very likely this has been fixed recently. [1]: https://nightly.mozilla.org/
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Flags: needinfo?(niklas)
Resolution: --- → INVALID
Yes you are correct, it's fixed in the nightly build. Thank you for looking into this!
Flags: needinfo?(niklas)
You need to log in before you can comment on or make changes to this bug.