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

Guard against exceptions caused by destroying player in buffer stall error callbacks #4786

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Jul 15, 2022

This PR will...

Guard against exceptions caused by destroying player in buffer stall error callbacks.

Why is this Pull Request needed?

The media property of GapController is cleared when the player is destroyed. Some applications choose to do this on BUFFER_STALLED_ERROR events. Improved type handling and some early returns correct this behavior.

Other changes?

Prior to triggering BUFFER_STALLED_ERROR, log the full BufferInfo object rather than just the buffer length from currentTime. This will help identify stalls in Chrome that occur ~1s after playing through buffer gaps (a new buffered range "start"). This is for issues like #4470.

Resolves issues:

Fixes #4525
Related to #4478

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch requested a review from itsjamie July 15, 2022 00:31
@robwalch robwalch added this to the 1.2.0 milestone Jul 15, 2022
@robwalch robwalch requested a review from tjenkinson July 16, 2022 00:09
@robwalch robwalch merged commit 4e184ad into master Jul 19, 2022
@robwalch robwalch deleted the bugfix/gap-controller-null-media-after-callback branch July 19, 2022 23:27
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

Successfully merging this pull request may close these issues.

hls.js:8701 Uncaught TypeError: Cannot read properties of null (reading 'currentTime')
1 participant