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

Fix BUFFER_EMPTY never fired #2612

Merged

Conversation

aescarcha
Copy link
Contributor

Fix BUFFER_EMPTY never firing if buffer level never went above safe distance, also will check buffer when native video element triggers stalled or playing.

Fixes #2607

…istance, also will check buffer when native video element triggers stalled or playing
@@ -553,7 +564,12 @@ function BufferController(config) {
}

function notifyBufferStateChanged(state) {
if (bufferState === state || (type === Constants.FRAGMENTED_TEXT && !textController.isTextEnabled())) return;
if (bufferState === state ||
(state === BUFFER_EMPTY && playbackController.getTime() === 0) || // Don't trigger BUFFER_EMPTY if it's initial loading
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's only for VOD streams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should work in every stream, that check is only to avoid triggering BUFFER_EMPTY while loading the first segments

@davemevans
Copy link
Contributor

FYI, Chrome is deprecating stalled for media elements using MSE in v69. Will this fix still work without that event?

See https://www.chromestatus.com/feature/6338037575319552.

@epiclabsDASH epiclabsDASH added this to the 2.8 milestone Jun 4, 2018
@aescarcha
Copy link
Contributor Author

@bbcrddave yes, the main issue was that it started as BUFFER_EMPTY, so if it never had enough buffer to be considered safe (12 seconds) and trigger BUFFER_LOADED, the state was always the same as the previous one and never fired.

The two new events add more frequency to the buffer check, and that's good, but not the most important part.

@epiclabsDASH epiclabsDASH merged commit 02afe25 into Dash-Industry-Forum:development Jun 13, 2018
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.

None yet

4 participants