move abort to before pausing segment loader (#810)
* Fixes an issue where playback can stall when going in/out of fullscreen
Showing
2 changed files
with
2 additions
and
2 deletions
... | @@ -159,6 +159,7 @@ export default class MasterPlaylistController extends videojs.EventTarget { | ... | @@ -159,6 +159,7 @@ export default class MasterPlaylistController extends videojs.EventTarget { |
159 | }); | 159 | }); |
160 | 160 | ||
161 | this.masterPlaylistLoader_.on('mediachanging', () => { | 161 | this.masterPlaylistLoader_.on('mediachanging', () => { |
162 | this.mainSegmentLoader_.abort(); | ||
162 | this.mainSegmentLoader_.pause(); | 163 | this.mainSegmentLoader_.pause(); |
163 | }); | 164 | }); |
164 | 165 | ||
... | @@ -166,8 +167,6 @@ export default class MasterPlaylistController extends videojs.EventTarget { | ... | @@ -166,8 +167,6 @@ export default class MasterPlaylistController extends videojs.EventTarget { |
166 | let media = this.masterPlaylistLoader_.media(); | 167 | let media = this.masterPlaylistLoader_.media(); |
167 | let requestTimeout = (this.masterPlaylistLoader_.targetDuration * 1.5) * 1000; | 168 | let requestTimeout = (this.masterPlaylistLoader_.targetDuration * 1.5) * 1000; |
168 | 169 | ||
169 | this.mainSegmentLoader_.abort(); | ||
170 | |||
171 | // If we don't have any more available playlists, we don't want to | 170 | // If we don't have any more available playlists, we don't want to |
172 | // timeout the request. | 171 | // timeout the request. |
173 | if (this.masterPlaylistLoader_.isLowestEnabledRendition_()) { | 172 | if (this.masterPlaylistLoader_.isLowestEnabledRendition_()) { | ... | ... |
... | @@ -1629,6 +1629,7 @@ QUnit.test('switching playlists with an outstanding key request aborts request a | ... | @@ -1629,6 +1629,7 @@ QUnit.test('switching playlists with an outstanding key request aborts request a |
1629 | keyXhr = this.requests.shift(); | 1629 | keyXhr = this.requests.shift(); |
1630 | QUnit.ok(!keyXhr.aborted, 'key request outstanding'); | 1630 | QUnit.ok(!keyXhr.aborted, 'key request outstanding'); |
1631 | 1631 | ||
1632 | this.player.tech_.hls.playlists.trigger('mediachanging'); | ||
1632 | this.player.tech_.hls.playlists.trigger('mediachange'); | 1633 | this.player.tech_.hls.playlists.trigger('mediachange'); |
1633 | 1634 | ||
1634 | QUnit.ok(keyXhr.aborted, 'key request aborted'); | 1635 | QUnit.ok(keyXhr.aborted, 'key request aborted'); | ... | ... |
-
Please register or sign in to post a comment