Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature
Makes the html5 'stalled' event visible to clients. This is mentioned in passing in #1081, and allows UIs to provide appropriate feedback if the source is no longer available (e.g. a mobile device has lost connection to the server). In such a scenario, the html5
loaderror
event does not fire, but thestalled
event does.Related Issues
#1081 mentions the stalled event as a partial solution to the use case in that ticket.
Solution
The
stalled
event copies the pattern established by theloaderror
event, withonstalled
added as an option to theHowl
prototype.Reproduction/Testing
My testing consisted of a Python Flask application that served my HTML, JS and mp3 files, and
dist/howler.js
from this PR. This allowed the following test procedure:Approx 3s later (seemingly the amount of time it takes the html5
stalled
event to fire), my JS applicationonstalled
event handler was invoked, allowing the UI to update accordingly.Breaking Changes
N/A