actually fixes #10 #11

This commit is contained in:
ayaka 2025-01-06 16:34:17 +13:00
parent fedd76877c
commit 86cafe134e

View File

@ -17,7 +17,7 @@ let downloadsvg = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24
var autoplay = oldVideo.classList.contains("hls_autoplay");
// If HLS is supported natively then don't use hls.js
if (oldVideo.canPlayType(source.type) === "probably") {
if (oldVideo.canPlayType(source.type) === "probably" && !downloadsEnabled) {
if (autoplay) {
oldVideo.play();
}
@ -119,7 +119,7 @@ let downloadsvg = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24
var filename = toSlug(videoElement.parentNode.parentNode.id || document.title)
const data = await ffmpeg.readFile('output.mp4');
saveAs(new Blob([data.buffer]),filename, {type: 'video/mp4'});
saveAs(new Blob([data.buffer], {type: 'video/mp4'}),filename);
return
}
function saveAs(blob, filename) { // Yeah ok...