From 03451fb8ae0d6d9d8affee715627e718244edcaf Mon Sep 17 00:00:00 2001 From: Jesus Date: Sat, 8 Mar 2025 16:39:37 -0500 Subject: fix: prevent error when closing avMerge if not a function --- youtube/static/js/watch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'youtube/static') diff --git a/youtube/static/js/watch.js b/youtube/static/js/watch.js index 95d9fa7..00803cf 100644 --- a/youtube/static/js/watch.js +++ b/youtube/static/js/watch.js @@ -5,8 +5,9 @@ function changeQuality(selection) { let videoPaused = video.paused; let videoSpeed = video.playbackRate; let srcInfo; - if (avMerge) + if (avMerge && typeof avMerge.close === 'function') { avMerge.close(); + } if (selection.type == 'uni'){ srcInfo = data['uni_sources'][selection.index]; video.src = srcInfo.url; -- cgit v1.2.3