videocontrols don't properly change play button state after video has ended

RESOLVED FIXED in mozilla1.9.2a1

Status

()

Toolkit
Video/Audio Controls
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: Dolske, Assigned: Dolske)

Tracking

({fixed1.9.1})

unspecified
mozilla1.9.2a1
fixed1.9.1
Points:
---
Bug Flags:
blocking1.9.1 -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
Spun off from bug 496147.

When clicking the play button after a video has ended, playback resumes from the beginning but the play button's icon does not change. It should display "||" while playing, but is instead showing "|>". If you click twice more (to pause and then unpause), the icon then changes to the expected "||".

Note that to avoid the problem in bug 496147, you'll need to seek before the video ends. Then you see the problem here.

When the playback first ends, .paused is false. When clicking play, the controls a "play" event to fire but it doesn't (the controls just see, in order: waiting, seeking, timeupdate --> 0.0, canplay, playing, canplaythrough, seeked, timeupdates...).

I'm not sure if the core is supposed to be firing "play" here or not. It sure seems like calling play() after playback has ended should result in a play event. But the video is technically still playing (.paused == false) after the end, it just can't advance the position, and so play() is effectively just a seek to 0.0 during ongoing playback (in which case a play event wouldn't be expected). Perhaps the controls should change state upon "playing" in addition to just "play"?
Flags: blocking1.9.1?
> Perhaps the controls should change state upon "playing" in addition
to just "play"?

Not in addition, I don't think.  You'll always get the playing event, so you can just use that.  See bug 488287 and http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-March/019012.html.

I think this bug and bug 490114 are the same, so we can probably close bug 490114 as a dupe.
See http://www.whatwg.org/specs/web-apps/current-work/#dom-media-play. play() only fires "play" if we are currently paused --- but we aren't.

When we seek back to the beginning, "playing" should fire, so yes, that's what you should listen for.

So this bug is invalid as filed, I think.
Flags: blocking1.9.1? → blocking1.9.1-
(Assignee)

Comment 3

9 years ago
(In reply to comment #2)

> So this bug is invalid as filed, I think.

I'm going to morph it to be for making the videocontrols use the right event.
Summary: calling .play() after a video ends doesn't trigger a "play" event. → videocontrols should user "playing" event to change play button state, not "play"
(Assignee)

Updated

9 years ago
Duplicate of this bug: 490114
Possible to fix as stability update?
Flags: wanted1.9.1.x?
Oh, and I'd take a patch if one came along ... and all the tests still passed ...
(Assignee)

Comment 7

9 years ago
(In reply to comment #1)

> Not in addition, I don't think.  You'll always get the playing event, so you
> can just use that.  See bug 488287 and
> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-March/019012.html.

Hmm, well, here's the problem. The "playing" event might not fire until long after the play button is clicked, but we want the UI (button icon) to change state immediately. The "play" and "pause" events are normally very convenient to use for this.

I guess another way of looking at the problem is that the "ended" event is convenient for detecting when the video ends (which the button icon treats as a "pause"), but there's no directly analogous event for not-ended  (to treat as a "play"). Seems like this might be useful to add to the spec...

I should be able to add a check in the timeupdate handler... It feels a bit like overkill, but there should be an immediate timeupdate event fired when a video is played (or, more generally, seeked to a playable position) after it has ended. (using "seeking" is tempting, because it's fired less often, but it the spec makes it sound like this isn't always fired when changing the playback position -- 4.8.10.10 Seeking, step 9).
(Assignee)

Comment 8

9 years ago
Created attachment 381447 [details] [diff] [review]
Patch v.1

Like so?
Assignee: nobody → dolske
Attachment #381447 - Flags: review?(roc)
Comment on attachment 381447 [details] [diff] [review]
Patch v.1

I'll take comment #6 as preemptive approval
Attachment #381447 - Flags: approval1.9.1+
(Assignee)

Comment 11

9 years ago
Pushed http://hg.mozilla.org/mozilla-central/rev/f4a9e6f39872
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Summary: videocontrols should user "playing" event to change play button state, not "play" → videocontrols don't properly change play button state after video has ended
Whiteboard: [needs landing]
Target Milestone: --- → mozilla1.9.2a1
Flags: wanted1.9.1.x?
(Assignee)

Comment 12

9 years ago
Pushed to 191: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/db15a52a4fd4
Keywords: fixed1.9.1
(Assignee)

Updated

8 years ago
Component: Video/Audio → Video/Audio Controls
Product: Core → Toolkit
QA Contact: video.audio → video.audio
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.