Closed Bug 886173 Opened 11 years ago Closed 11 years ago

Preserve playbackRate across pause/play

Categories

(Core :: Audio/Video, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: coyotebush, Assigned: padenot)

References

Details

Attachments

(2 files, 1 obsolete file)

Steps to reproduce:
 1. Open http://www.w3.org/2010/05/video/mediaevents.html test page in Nightly.
 2. Press "play()", then "playbackRate++".
 3. Observe that playbackRate = 2 is listed.
 4. Press "pause()", then "play()".

Expected result (works in Safari 6.0.5, WebKit nightly, Chrome Canary):
 Video continues playing at double speed.

Actual result:
 playbackRate resets to 1 on "play()", and the video plays at normal speed.

As a use case, consider Coursera.org video lectures with integrated quizzes. When the lecture resumes after a quiz, it should still be at the rate the user specified.
Quoting the spec [1]:

> 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.

hence the change in videocontrols.xml.

[1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#user-interface
Attachment #766633 - Flags: review?(cpearce)
Assignee: nobody → paul
Comment on attachment 766633 [details] [diff] [review]
Preserve playbackRate across pause/play. r=

Review of attachment 766633 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry for slow review. I've been traveling.
Attachment #766633 - Flags: review?(cpearce) → review+
(In reply to Paul Adenot (:padenot) from comment #1)
> Quoting the spec [1]:
> 
> > 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.
> 
> hence the change in videocontrols.xml.

While you're still looking at it, I'm curious about this part. This means it will reset to 1.0 when I use the play button on the default controller, right? Not sure why that would be wanted, and FWIW, the WebKit/Chrome players don't do that. But as long as it's in the spec, okay.
Well, 'playbackRate' is meant to implement fast forward-type feature: play a greater speed to reach some location in the media, or at low speed to precisely find some location. When you think about it that way, the behavior here is quite logical: on an old VCR, pressing "Play" would stop the fast-forward.

What you want here is to play with 'defaultPlaybackRate'.
So, I forgot to update the test. The spec now says:

> The defaultPlaybackRate is used by the user agent when it exposes a user
> interface to the user.

Indeed, in only says to "reset" the playbackRate to defaultPlaybackRate, when
using the UA controls, and on load(). I removed the defaultPlaybacKRate section,
and added some more specific tests for that.

Pushed to try at: http://tbpl.mozilla.org/?tree=Try&rev=a896a4bf2cd6
Attachment #774015 - Flags: review?(cpearce)
Attachment #774015 - Flags: review?(cpearce) → review+
Blocks: 858025
I have rebased the patch against yesterday's tip.
Attachment #766633 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/bb14995b3241
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: