avmerge: Close streams to avoid errors while changing quality
If a fetchRange network request finished after the quality was changed, there would be a "InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable" because appendSegment was trying to append to the sourceBuffer that was unusable after the video src was changed to a new mediaSource. Adds a close method to the AVMerge class to properly clean and close everything so these sorts of errors won't happen. Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
@@ -119,6 +119,8 @@
|
||||
var videoPaused = video.paused;
|
||||
var videoSpeed = video.playbackRate;
|
||||
var videoSource;
|
||||
if (avMerge)
|
||||
avMerge.close();
|
||||
if (selection.type == 'uni'){
|
||||
videoSource = data['uni_sources'][selection.index];
|
||||
video.src = videoSource.url;
|
||||
|
||||
Reference in New Issue
Block a user