Update player.js

This commit is contained in:
Anirudh Sevugan 2025-04-24 19:21:44 -05:00 committed by GitHub
parent e3c8d282ed
commit 6bcd2fe261
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -198,6 +198,14 @@ submitUrlBtn.addEventListener('click', () => {
let previousObjectURL = null; // Store the last Object URL let previousObjectURL = null; // Store the last Object URL
fileInput.addEventListener('change', (event) => { fileInput.addEventListener('change', (event) => {
if (hls !== null) {
hls.destroy()
hls = null
}
if (player !== null) {
player.reset()
player = null
}
const file = event.target.files[0]; const file = event.target.files[0];
if (!file) return; if (!file) return;