Various fixes

This commit is contained in:
Vanilagy
2026-03-06 15:49:24 +01:00
parent 22716b1f83
commit c088a31384
14 changed files with 506 additions and 142 deletions
+5 -2
View File
@@ -10,6 +10,7 @@ import {
WrappedAudioBuffer,
WrappedCanvas,
asc,
canDecodeAudio,
desc,
prefer,
} from 'mediabunny';
@@ -113,10 +114,10 @@ const initMediaPlayer = async (resource: File | string) => {
});
videoTrack = await input.getPrimaryVideoTrack({
filter: async track => (await track.resolve('displayHeight')) <= 720,
filter: async track => (await track.resolve('displayHeight')) < 1080,
});
audioTrack = await input.getPrimaryAudioTrack({
filter: track => !videoTrack || videoTrack.canBePairedWith(track),
sortBy: track => prefer(track.canBePairedWith(videoTrack)),
});
await videoTrack?.hydrate();
@@ -127,6 +128,8 @@ const initMediaPlayer = async (resource: File | string) => {
await audioTrack?.computeDuration() ?? 0,
);
console.log(videoTrack, audioTrack, totalDuration);
// https://test-streams.mux.dev/test_001/stream.m3u8
// https://test-streams.mux.dev/test_001/stream_1000k_48k_640x360_050.ts
} else {