-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silence "The play() request was interrupted by a call to pause()" #3518
Conversation
// Catch/silence error when a pause interrupts a play request | ||
// on browsers which return a promise | ||
if (playPromise !== undefined) { | ||
playPromise.catch((e) => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch
might be an issue on IE8.
Also, we should probably verify this is a promise before proceeding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, reworked that.
@@ -517,3 +517,20 @@ QUnit.test('Html5#reset calls Html5.resetMediaElement when called', function() { | |||
|
|||
Html5.resetMediaElement = oldResetMedia; | |||
}); | |||
|
|||
QUnit.test('Exception in play promise should be caught', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test should be wrapped in a condition to check for Promise
support. When it gets merged and runs in a browser that doesn't support Promise
it will likely blow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're running es6-shim on tests, so, Promise is always available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. 👍
In that case, LGTM |
LGTM |
This fixes #3474 |
Description
On browsers that return a promise for
play()
(so far Chrome), anAbortError
DOMException is thrown if apause()
occurs before playback starts. This doesn't break anything, but logs an annoying error to the console.Specific Changes proposed
Just catch the exception and do nothing.
Requirements Checklist