react-player icon indicating copy to clipboard operation
react-player copied to clipboard

AbortError: The play() request was interrupted by a call to pause()

Open amirghafouri opened this issue 1 year ago • 0 comments

Current Behavior

When the playing prop toggles between true and false in quick succession, or the url prop changes soon after the playing props is set to true, these errors are thrown many times in our production logs:

AbortError: The play() request was interrupted by a call to pause(). AbortError: The play() request was interrupted by a new load request.

Expected Behavior

This issue was reported here back when it was unhandled: https://github.com/cookpete/react-player/issues/200

And the solution was to throw the error to the onError handler rather than leave it unhandled, but I would argue that the player should not be throwing an error here at all. Any changes to the playing or url props should await the promise returned from video.play() before proceeding: https://developer.chrome.com/blog/play-request-was-interrupted/

amirghafouri avatar Nov 13 '23 18:11 amirghafouri