diff --git a/entries/all.ts b/entries/all.ts index 8b00a03e..dce508c5 100644 --- a/entries/all.ts +++ b/entries/all.ts @@ -13,7 +13,10 @@ export * from '#/text-mp4'; export * from './types'; import * as DESCRIPTORS from '#/descriptor'; import { registerBoxes, registerDescriptors } from '#/registry'; + import * as BOXES from './all-boxes'; +export { BOXES }; +export * from '#/boxes/sampleentries'; export const BoxParser = registerBoxes(BOXES); diff --git a/src/boxes/sampleentries/sampleentry.ts b/src/boxes/sampleentries/sampleentry.ts index da769006..2c0abffc 100644 --- a/src/boxes/sampleentries/sampleentry.ts +++ b/src/boxes/sampleentries/sampleentry.ts @@ -25,7 +25,7 @@ function decimalToHex(d: number | string, padding?: number | null) { return hex; } -class avcCSampleEntryBase extends VisualSampleEntry { +export class avcCSampleEntryBase extends VisualSampleEntry { avcC: avcCBox; avcCs: Array; @@ -96,7 +96,7 @@ export class dav1SampleEntry extends VisualSampleEntry { static override readonly fourcc = 'dav1' as const; } -class hvcCSampleEntryBase extends VisualSampleEntry { +export class hvcCSampleEntryBase extends VisualSampleEntry { hvcC: hvcCBox; hvcCs: Array; @@ -191,7 +191,7 @@ export class dvheSampleEntry extends VisualSampleEntry { } /** @babel box-codecs.js */ -class vvcCSampleEntryBase extends VisualSampleEntry { +export class vvcCSampleEntryBase extends VisualSampleEntry { vvcC: vvcCBox; vvcCs: Array; getCodec() { @@ -269,7 +269,7 @@ export class vvcNSampleEntry extends VisualSampleEntry { static override readonly fourcc = 'vvcN' as const; } -class vpcCSampleEntryBase extends VisualSampleEntry { +export class vpcCSampleEntryBase extends VisualSampleEntry { vpcC: vpcCBox; vpcCs: Array; getCodec() { diff --git a/src/registry.ts b/src/registry.ts index a45e7904..ee80b007 100644 --- a/src/registry.ts +++ b/src/registry.ts @@ -58,6 +58,10 @@ export function registerBoxes(registry: Record) { // Check if SampleEntry class if (isSampleEntry(value)) { + if (key.endsWith('SampleEntryBase')) { + continue; + } + const fourcc = 'fourcc' in value ? (value.fourcc as string) : undefined; if (!fourcc) {