Update renderer.js

This commit is contained in:
Anirudh Sevugan 2025-02-23 17:53:19 +05:30 committed by GitHub
parent 9deed0b8b8
commit b0544db1a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,10 +7,14 @@ function loadMedia(fileURL) {
dialogOverlay.style.display = 'none';
const mediaElement = document.getElementById("mediaPlayer");
mediaElement.oncanplay = null;
if (mediaElement) {
mediaElement.src = fileURL; // ✅ Safe, properly encoded URL
mediaElement.oncanplay = () => {
if (autoplayCheckbox && autoplayCheckbox.checked) {
mediaElement.play();
mediaElement.play().catch(error => console.warn("Playback issue:", error));
}
};
}
}