From 49d639448759d07e806b8e5344977ff825335874 Mon Sep 17 00:00:00 2001 From: Thomas E Tuoti Date: Sun, 22 Dec 2024 18:38:09 -0700 Subject: [PATCH] Allow special characters in video titles to buffer and timeseek without error --- core/modules/parsers/videoparser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/parsers/videoparser.js b/core/modules/parsers/videoparser.js index 27c4f7e73..e25a0ccb7 100644 --- a/core/modules/parsers/videoparser.js +++ b/core/modules/parsers/videoparser.js @@ -128,10 +128,11 @@ var VideoParser = function (type, text, options) { xhr.send(); video.addEventListener('loadedmetadata', async () => { - // Use requestAnimationFrame instead of direct style changes requestAnimationFrame(async () => { const xhr = new XMLHttpRequest(); - xhr.open('HEAD', video.currentSrc); + // Encode the URL to handle spaces and special characters + const encodedUrl = encodeURI(video.currentSrc); + xhr.open('HEAD', encodedUrl); xhr.onload = () => { const observer = new MutationObserver((mutations) => {