mirror of
https://github.com/A-Star100/simpliplay-desktop.git
synced 2025-09-17 22:29:38 +00:00
Update renderer.js
Some checks failed
Some checks failed
This commit is contained in:
parent
59a8d5c577
commit
a26e1448ab
@ -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) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user