@byomakase/omakase-player
    Preparing search index...

    Interface MainMedia

    Primary media entity representing the loaded video or audio source.

    A MainMedia holds the media source, its associated tracks, load lifecycle state, and runtime attributes (DRM, duration, frame rate, timecode model). Extends MediaEntity with mediaType always set to MediaEntityType.MAIN_MEDIA.

    interface MainMedia {
        id: string;
        loadStage: OpStage;
        mainMediaType: MainMediaType;
        mediaType: MediaEntityType;
        onEvent$: Observable<MainMediaEvent>;
        source: Source;
        sourceFileFormatType: FileFormatType | undefined;
        state: MainMediaState;
        tracks: Track<TrackState, OmpEvent<any, any>>[];
        get duration(): number | undefined;
        get ffomTimecodeModel(): TimecodeModel | undefined;
        get frameRateModel(): FrameRateModel | undefined;
        get initialDuration(): number | undefined;
        get initSegmentTimeOffset(): number | undefined;
        get isDrm(): boolean | undefined;
        addTrack(track: Track): void;
        addTracks(tracks: Track<TrackState, OmpEvent<any, any>>[]): void;
        loadError(error: string | undefined): void;
        loadStart(): void;
        loadSuccess(): void;
        updateAttrs(attrs: MainMediaUpdateableAttrs): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    id: string

    Unique identifier (UUID).

    loadStage: OpStage

    Current load lifecycle stage (idle → loading → success / failure).

    mainMediaType: MainMediaType

    The format of the media source (HLS, MP4, or AUDIO_FILE).

    mediaType: MediaEntityType

    Discriminator indicating whether this entity is a main media or a track.

    onEvent$: Observable<MainMediaEvent>

    Observable stream of lifecycle events (loading, loaded, error, updated).

    source: Source

    The resolved media source.

    sourceFileFormatType: FileFormatType | undefined

    The resolved file format type of the source.

    Serializable state snapshot.

    tracks: Track<TrackState, OmpEvent<any, any>>[]

    Tracks associated with this media (video, audio, text, markers, etc.).

    Accessors

    • get duration(): number | undefined

      Current media duration in seconds. May be updated at runtime.

      Returns number | undefined

    • get ffomTimecodeModel(): TimecodeModel | undefined

      FFOM (First Frame of Media) timecode model derived from load options.

      Returns TimecodeModel | undefined

    • get frameRateModel(): FrameRateModel | undefined

      Frame rate model derived from load options or the media source.

      Returns FrameRateModel | undefined

    • get initialDuration(): number | undefined

      The duration originally reported at load time, before any runtime updates.

      Returns number | undefined

    • get initSegmentTimeOffset(): number | undefined

      Time offset of the initialization segment, if applicable.

      Returns number | undefined

    • get isDrm(): boolean | undefined

      Whether the media source is DRM-protected.

      Returns boolean | undefined

    Methods