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

    Interface TrackUtilsApi

    interface TrackUtilsApi {
        convertTextTrack(
            source: Source,
            conversionOptions: TextTrackConversionOptions,
            loadOptions?: TextTrackLoadOptions,
        ): Observable<Track<TrackState, OmpEvent<any, any>>>;
        convertTextTrack(
            url: string,
            conversionOptions: TextTrackConversionOptions,
            loadOptions?: TextTrackLoadOptions,
        ): Observable<Track<TrackState, OmpEvent<any, any>>>;
        destroy(): void;
        downsampleTrack(
            id: string,
            options: DownsampleOptions,
        ): Observable<Track<TrackState, OmpEvent<any, any>>>;
        fetchTimedItems(id: string): Observable<void>;
        preloadTrack(id: string): Observable<Track<TrackState, OmpEvent<any, any>>>;
    }

    Hierarchy

    • Destroyable
      • TrackUtilsApi
    Index

    Methods

    • Fetches and populates timed items for the given track.

      Concurrent calls for the same track ID are deduplicated — subsequent subscribers receive the result of the in-flight request rather than starting a new one.

      Parameters

      • id: string

        The ID of the track whose timed items should be fetched.

      Returns Observable<void>

      An Observable that completes once the timed items have been loaded.

    • Preloads a track by resolving its segments into a self-contained, locally accessible form.

      For HLS audio tracks, segments are fetched and merged into a single blob URL. For HLS text tracks, VTT segments are concatenated and exposed as a blob URL. The resulting track is registered in the repository with a DERIVED_FROM relation pointing to the original track.

      Parameters

      • id: string

        The ID of the track to preload.

      Returns Observable<Track<TrackState, OmpEvent<any, any>>>

      An Observable that emits the newly created derived Track once preloading is complete.