prep for 2.1.4

This commit is contained in:
Anirudh Sevugan 2025-09-10 21:37:38 -05:00 committed by GitHub
parent 5d49c97662
commit 808c275167
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,6 +86,7 @@ window.addEventListener('drop', e => {
if (previousDropURL) {
URL.revokeObjectURL(previousDropURL);
window.previousDropURL = previousDropURL;
previousDropURL = null;
}
// Revoke previous file picker Object URL
@ -96,12 +97,18 @@ window.addEventListener('drop', e => {
// Create a new Object URL
const fileURL = URL.createObjectURL(file);
mediaElement.src = fileURL;
mediaElement.load();
// Autoplay if checkbox is checked
// Only attempt to play if the browser thinks it can handle this type
if (mediaElement.canPlayType(file.type)) {
mediaElement.load();
// Autoplay if checkbox is checked
if (autoplayCheckbox.checked) {
mediaElement.play().catch(err => console.warn(err));
}
} else {
console.warn("SimpliPlay does not support this video type:", file.type);
}
// Store for future cleanup
previousDropURL = fileURL;
@ -194,3 +201,4 @@ window.electron.receive("unload-addon", (fileURL) => {
unloadAddon(fileURL);
});