Skip to content
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

Player throws error when this.player.play() fails #200

Closed
marcelofpalves opened this issue May 30, 2017 · 0 comments
Closed

Player throws error when this.player.play() fails #200

marcelofpalves opened this issue May 30, 2017 · 0 comments

Comments

@marcelofpalves
Copy link

Hello,
I'm getting this error:

Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

I guess that's because the play method returns a promise and the error is not caught.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play

A possible solution might be passing the error through the onError callback and let the caller handle it.

// FilePlayer.js
play () {
  const { onError } = this.props
  this.player.play().catch(onError)
}

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant