Update renderer.js
Some checks failed
Build Linux / build_x64 (push) Has been cancelled
Build Linux / build_arm64 (push) Has been cancelled
Build macOS / build (push) Has been cancelled
Build Windows / build-x64 (push) Has been cancelled
Build Windows / build-arm64 (push) Has been cancelled

This commit is contained in:
Anirudh Sevugan 2025-09-15 18:19:03 -05:00 committed by GitHub
parent 59a8d5c577
commit a26e1448ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,18 +97,11 @@ window.addEventListener('drop', e => {
const fileURL = URL.createObjectURL(file); const fileURL = URL.createObjectURL(file);
mediaElement.src = fileURL; mediaElement.src = fileURL;
// Only attempt to play if the browser thinks it can handle this type
if (mediaElement.canPlayType(file.type)) {
mediaElement.load(); mediaElement.load();
// Autoplay if checkbox is checked // Autoplay if checkbox is checked
if (autoplayCheckbox.checked) { if (autoplayCheckbox.checked) {
mediaElement.play().catch(err => console.warn(err)); mediaElement.play().catch(err => console.warn(err));
} }
} else {
console.warn("SimpliPlay does not support this video type:", file.type);
alert("SimpliPlay either can't play this file or the MIME type may be incorrect");
}
// Store for future cleanup // Store for future cleanup
previousDropURL = fileURL; previousDropURL = fileURL;
@ -204,3 +197,4 @@ window.electron.receive("unload-addon", (fileURL) => {