Add InputTrack.number

This commit is contained in:
Vanilagy
2026-01-22 09:18:43 +01:00
parent e1e32c9505
commit e20f779ede
14 changed files with 118 additions and 13 deletions
+10
View File
@@ -32,6 +32,7 @@ export type PacketStats = {
export interface InputTrackBacking {
getId(): number;
getNumber(): number;
getCodec(): MediaCodec | null;
getInternalCodecId(): string | number | Uint8Array | null;
getName(): string | null;
@@ -94,6 +95,15 @@ export abstract class InputTrack {
return this._backing.getId();
}
/**
* The 1-based index of this track among all tracks of the same type in the input file. For example, the first
* video track has number 1, the second video track has number 2, and so on. The index refers to the order in
* which the tracks are returned by {@link Input.getTracks()}.
*/
get number() {
return this._backing.getNumber();
}
/**
* The identifier of the codec used internally by the container. It is not homogenized by Mediabunny
* and depends entirely on the container format.