Fix Netlify export runtime error

This commit is contained in:
haixin.yang
2026-07-09 13:07:40 +08:00
parent 58cfec6e09
commit a7fd7b13a0
3 changed files with 17 additions and 1 deletions
+7
View File
@@ -6,3 +6,10 @@
from = "/*"
to = "/index.html"
status = 200
[[headers]]
for = "/*"
[headers.values]
Cross-Origin-Opener-Policy = "same-origin"
Cross-Origin-Embedder-Policy = "require-corp"
Cross-Origin-Resource-Policy = "same-origin"
+1
View File
@@ -50,6 +50,7 @@ import {
exportBrowserVideo,
extractAudioFromVideo,
getAudioRecordingFormat,
getSupportedRecordingFormat,
transcodeWebmToMp4,
} from "./lib/media.js";
+9 -1
View File
@@ -202,7 +202,15 @@ function drawPreviewFrame(context, visual, canvas, options) {
context.fillRect(110, height - 24, (width - 220) * progress, 6);
}
function getSupportedRecordingFormat() {
export function getSupportedRecordingFormat() {
if (typeof MediaRecorder === "undefined") {
return {
mimeType: "",
extension: "webm",
label: "默认视频",
};
}
const supportedFormat = EXPORT_RECORDING_FORMATS.find((format) =>
MediaRecorder.isTypeSupported(format.mimeType),
);