Update player.js

This commit is contained in:
Anirudh Sevugan 2025-09-10 21:08:09 -05:00 committed by GitHub
parent 117d2950ea
commit b987f539f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -272,6 +272,7 @@ const { isHLS, isDASH } = await detectStreamType(url);
let previousObjectURL = null; // Store the last Object URL
window.objectURL = previousObjectURL
fileInput.addEventListener('change', (event) => {
if (hls !== null) {
@ -292,6 +293,12 @@ const { isHLS, isDASH } = await detectStreamType(url);
// Revoke the previous Object URL if it exists
if (previousObjectURL) {
URL.revokeObjectURL(previousObjectURL);
window.objectURL = previousObjectURL
}
// Revoke previous file picker Object URL
if (window.previousDropURL) {
URL.revokeObjectURL(window.previousDropURL);
}
// Create a new Object URL for the selected file