1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-06 15:30:26 +00:00

Allow special characters in video titles to buffer and timeseek without error

This commit is contained in:
Thomas E Tuoti 2024-12-22 18:38:09 -07:00
parent d0849440d2
commit 49d6394487

View File

@ -128,10 +128,11 @@ var VideoParser = function (type, text, options) {
xhr.send(); xhr.send();
video.addEventListener('loadedmetadata', async () => { video.addEventListener('loadedmetadata', async () => {
// Use requestAnimationFrame instead of direct style changes
requestAnimationFrame(async () => { requestAnimationFrame(async () => {
const xhr = new XMLHttpRequest(); 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 = () => { xhr.onload = () => {
const observer = new MutationObserver((mutations) => { const observer = new MutationObserver((mutations) => {