Skip to content

Commit

Permalink
fix(experimentalBufferBasedABR): start ABR timer on main playlist load (
Browse files Browse the repository at this point in the history
#1026)

Start the timer later, so we don't try to call simpleSelector without a playlist. However, we should add a null-check there just in case.

Fixes #1025
  • Loading branch information
gkatsev authored Dec 7, 2020
1 parent a29e241 commit 27de9a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/master-playlist-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class MasterPlaylistController extends videojs.EventTarget {
this.setupSegmentLoaderListeners_();

if (this.experimentalBufferBasedABR) {
this.startABRTimer_();
this.masterPlaylistLoader_.one('loadedplaylist', () => this.startABRTimer_());
this.tech_.on('pause', () => this.stopABRTimer_());
this.tech_.on('play', () => this.startABRTimer_());
}
Expand Down
5 changes: 5 additions & 0 deletions src/playlist-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ export const simpleSelector = function(
limitRenditionByPlayerDimensions
) {

// If we end up getting called before `master` is available, exit early
if (!master) {
return;
}

const options = {
bandwidth: playerBandwidth,
width: playerWidth,
Expand Down

0 comments on commit 27de9a5

Please sign in to comment.