Skip to content

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

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions