New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 687099 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Compat



Sign in to add a comment

Media events vs. play promise rejections seem out of order

Reported by tim.dep...@zentrick.com, Jan 31 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36

Example URL:
https://jsfiddle.net/7d06nfaf/

Steps to reproduce the problem:
Per [1], upon a call to .pause(), a media element must, among other things, queue a task to:

- Fire an event named "pause" at the element.
- Reject pending play promises with promises and an "AbortError" DOMException.

In my fiddle at [2], I call play(), pause(), play(), and pause() synchronously. I expected this to produce a sequence of interleaved pause events and promise rejections. However, instead, the promise rejections always occur (or at least log) after _all_ the event listeners have been called.

Under the assumption that the unavoidable .then() on the promises was introducing additional scheduling, I introduced a Promise.resolve() into the event listener on line 13, thinking that that would defer the logging until after the promise has been rejected. However, the events always seem to take precedence. Moreover, nesting multiple Promise.resolve()s still doesn't seem to affect the order.

I may just be misunderstanding the standard w.r.t. task queues and/or the semantics of promises here, in which case I apologize for the invalid issue, but shouldn't the promises resolve sooner?

[1] https://html.spec.whatwg.org/multipage/embedded-content.html#internal-pause-steps
[2] https://jsfiddle.net/7d06nfaf/

What is the expected behavior?
pause - reject - pause - reject

What went wrong?
pause - pause - reject - reject

Does it occur on multiple sites: No

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 56.0.2924.76  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 24.0 r0

 
Components: Internals>Media
Labels: Needs-Triage-M56
Cc: kavvaru@chromium.org
Labels: Needs-Feedback
Unable to reproduce the issue on windows 7 using chrome 56.0.2924.87 and canary 58.0.2997.0.with the below steps

1. Opened the URL https://jsfiddle.net/7d06nfaf/
2.Observed the output as Play pause play pause ...

Please find the attached screen shot and confirm if anything missed here.
Please provide steps to reproduce the issue from test team end.

Thanks,
687099.png
179 KB View Download
The play events are irrelevant. The issue pertains to the sequence of pause events vs. promise rejections.
Components: -Internals>Media Internals>Media>Source
Owner: wolenetz@chromium.org
Status: Assigned (was: Unconfirmed)
matt, this is events bug. can you take a look?

Sign in to add a comment