Allow negative timestamps in media sources, add negative timestamp support to ISOBMFF muxer

This commit is contained in:
Vanilagy
2026-09-04 11:48:50 +02:00
parent 6c88763a5c
commit 3c94d062d2
10 changed files with 207 additions and 63 deletions
+3
View File
@@ -128,6 +128,9 @@ const initMediaPlayer = async (resource: File | string) => {
isRelativeToUnixEpoch = (await Promise.all(tracks.map(t => t.isRelativeToUnixEpoch()))).some(Boolean);
playbackTimeAtStart = firstTimestamp;
// For degenerate cases where the end timestamp is less than 0
endTimestamp = Math.max(firstTimestamp, endTimestamp);
// Configure the time display elements accordingly
const timestampFontSize = isRelativeToUnixEpoch ? '12px' : '';
const timestampWhiteSpace = isRelativeToUnixEpoch ? 'pre' : '';