Add compileSampleStats

This commit is contained in:
Vanilagy
2025-01-04 14:25:22 +01:00
parent 5bb9f8609c
commit b8c0d76503
5 changed files with 55 additions and 5 deletions
+5
View File
@@ -1673,6 +1673,11 @@ abstract class IsobmffTrackBacking<
throw new Error('Not implemented on base class.');
}
async getFirstTimestamp() {
const firstSample = await this.getFirstSample({ metadataOnly: true });
return firstSample?.timestamp ?? 0;
}
async computeDuration() {
const lastSample = await this.getSample(Infinity, { metadataOnly: true });
return (lastSample?.timestamp ?? 0) + (lastSample?.duration ?? 0);