Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Commit

Permalink
Fix qualityLevels integration where a player is created from a video
Browse files Browse the repository at this point in the history
with a source.

Defer setQualityLevels_ until tech is ready.
  • Loading branch information
ddunkin committed Jan 26, 2017
1 parent 91dcdb1 commit 2cfd7eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/videojs-contrib-hls.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ class HlsHandler extends Component {
this.ignoreNextSeekingEvent_ = true;
});

this.setupQualityLevels_();
this.tech_.ready(this.setupQualityLevels_.bind(this));

// do nothing if the tech has been disposed already
// this can occur if someone sets the src in player.ready(), for instance
Expand Down
2 changes: 2 additions & 0 deletions test/videojs-contrib-hls.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2350,6 +2350,7 @@ QUnit.test('populates quality levels list when available', function(assert) {
src: 'manifest/master.m3u8',
type: 'application/vnd.apple.mpegurl'
});
openMediaSource(this.player, this.clock);

assert.ok(this.player.tech_.hls.qualityLevels_, 'added quality levels');

Expand Down Expand Up @@ -2379,6 +2380,7 @@ QUnit.test('populates quality levels list when available', function(assert) {
src: 'http://example.com/media.m3u8',
type: 'application/vnd.apple.mpegurl'
});
openMediaSource(this.player, this.clock);

assert.ok(this.player.tech_.hls.qualityLevels_, 'added quality levels from video with source');
});
Expand Down

0 comments on commit 2cfd7eb

Please sign in to comment.