web/libav: remove environment import to fix the worker

This commit is contained in:
wukko 2025-01-15 22:25:59 +06:00
parent 1ed2eef65a
commit 0e26424355
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -2,7 +2,6 @@ import mime from "mime";
import LibAV, { type LibAV as LibAVInstance } from "@imput/libav.js-remux-cli"; import LibAV, { type LibAV as LibAVInstance } from "@imput/libav.js-remux-cli";
import type { FFmpegProgressCallback, FFmpegProgressEvent, FFmpegProgressStatus, FileInfo, RenderParams } from "./types/libav"; import type { FFmpegProgressCallback, FFmpegProgressEvent, FFmpegProgressStatus, FileInfo, RenderParams } from "./types/libav";
import type { FfprobeData } from "fluent-ffmpeg"; import type { FfprobeData } from "fluent-ffmpeg";
import { browser } from "$app/environment";
export default class LibAVWrapper { export default class LibAVWrapper {
libav: Promise<LibAVInstance> | null; libav: Promise<LibAVInstance> | null;
@ -11,7 +10,7 @@ export default class LibAVWrapper {
constructor(onProgress?: FFmpegProgressCallback) { constructor(onProgress?: FFmpegProgressCallback) {
this.libav = null; this.libav = null;
this.concurrency = Math.min(4, browser ? navigator.hardwareConcurrency : 0); this.concurrency = Math.min(4, navigator.hardwareConcurrency || 0);
this.onProgress = onProgress; this.onProgress = onProgress;
} }