web/libav: disable wasm multithreading on old ios
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run

This commit is contained in:
wukko 2025-06-19 23:58:30 +06:00
parent fef6ee1a17
commit 4da95e0a2b
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -5,6 +5,12 @@ import EncodeLibAV from "@imput/libav.js-encode-cli";
import type { FfprobeData } from "fluent-ffmpeg";
import type { FFmpegProgressCallback, FFmpegProgressEvent, FFmpegProgressStatus, RenderParams } from "$lib/types/libav";
const ua = navigator.userAgent.toLowerCase();
const iPhone = ua.includes("iphone os");
const iPad = !iPhone && ua.includes("mac os") && navigator.maxTouchPoints > 0;
const iOS = iPhone || iPad;
const modernIOS = iOS && Number(ua.match(/iphone os (\d+)_/)?.[1]) >= 18;
export default class LibAVWrapper {
libav: Promise<LibAVInstance> | null;
concurrency: number;
@ -32,7 +38,7 @@ export default class LibAVWrapper {
this.libav = constructor({
...options,
variant: undefined,
yesthreads: true,
yesthreads: !iOS || modernIOS,
base: '/_libav'
});
}