leoasis / leoasis/react-sound

AbortError: The fetching process for the media resource was aborted by the user agent at the user's request.

Open
#89 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
490
Forks
80
PR merge metrics
No merged PRs in 30d

Description

Every now and then, when I cancel the currently playing audio in Firefox, I get an:

AbortError: The fetching process for the media resource was aborted by the user agent at the user's request.

on this line of the html5Unload function:

https://github.com/scottschiller/SoundManager2/blob/f432aa9ed96a0f9022e72fc4a1b977ba0643ed71/script/soundmanager2.js#L4195

Note that the comments within that function talk a lot about Firefox in particular.

It is a difficult to reproduce issue because it is flaky when this happens. Unfortunately, it happens often enough to be disturbing.

The problem is that I have difficulties catching that AbortError in React.

That AbortError is probably not expected by the SoundManager2 code either: There is still clean up code below that line that will never be executed, leaving SoundManager2 in an inconsistent state.

How can I catch this error in react-sound?

Any help is greatly appreciated.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at script/soundmanager2.js, particularly the html5Unload function around line 4195, and investigate the Firefox AbortError when cancelling currently playing audio. Reproduce the flaky cancellation if possible and determine how the error affects the cleanup below that line; done means the error is handled without leaving SoundManager2 inconsistent and the behavior is usable from React.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.