Compare commits

..

No commits in common. "a26e1448abe394f87d20d6227bfd3d00e8baf642" and "ef5e34331ef78f21a768deb131aaacdc5b9c7533" have entirely different histories.

View File

@ -97,11 +97,17 @@ window.addEventListener('drop', e => {
const fileURL = URL.createObjectURL(file); const fileURL = URL.createObjectURL(file);
mediaElement.src = fileURL; mediaElement.src = fileURL;
mediaElement.load();
// 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 // 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);
}
// Store for future cleanup // Store for future cleanup
previousDropURL = fileURL; previousDropURL = fileURL;
@ -196,5 +202,3 @@ window.electron.receive("unload-addon", (fileURL) => {