ee7bb96c by Matthew Neil Committed by Jon-Carlos Rivera

move abort to before pausing segment loader (#810)

* Fixes an issue where playback can stall when going in/out of fullscreen
1 parent 96f78efc
......@@ -159,6 +159,7 @@ export default class MasterPlaylistController extends videojs.EventTarget {
});
this.masterPlaylistLoader_.on('mediachanging', () => {
this.mainSegmentLoader_.abort();
this.mainSegmentLoader_.pause();
});
......@@ -166,8 +167,6 @@ export default class MasterPlaylistController extends videojs.EventTarget {
let media = this.masterPlaylistLoader_.media();
let requestTimeout = (this.masterPlaylistLoader_.targetDuration * 1.5) * 1000;
this.mainSegmentLoader_.abort();
// If we don't have any more available playlists, we don't want to
// timeout the request.
if (this.masterPlaylistLoader_.isLowestEnabledRendition_()) {
......
......@@ -1629,6 +1629,7 @@ QUnit.test('switching playlists with an outstanding key request aborts request a
keyXhr = this.requests.shift();
QUnit.ok(!keyXhr.aborted, 'key request outstanding');
this.player.tech_.hls.playlists.trigger('mediachanging');
this.player.tech_.hls.playlists.trigger('mediachange');
QUnit.ok(keyXhr.aborted, 'key request aborted');
......