Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Interface ISyncMediaObjectRendererContext

    Used internally by the framework. Used by ISyncMediaObjectRendererRuntime to communicate with ISyncMediaPlayer.

    interface ISyncMediaObjectRendererContext {
        onActiveSegmentFinished(segmentIndex: number): void;
        onPlaybackPositionUpdated(
            segmentIndex: number,
            newOffsetWithinSegmentMs: number,
        ): void;
        onPlayRequest(): void;
        onRangeEndReached(rangeId: number): void;
        onRuntimePaused(): void;
        onRuntimeReady(): void;
        onRuntimeWaiting(): void;
        onSegmentDurationChanged(segmentIndex: number, newDurationMs: number): void;
        onSegmentError(
            segmentIndex: number,
            errorType: SyncMediaPlayerErrorType,
            error: unknown,
            paused: boolean,
        ): void;
    }

    Methods

    • Called by the renderer when the currently active segment has finished playing.

      It should also be called immediately after setActiveSegmentIndex() has been called if playback of the active segment is not supported by the renderer.

      Must be called with the last segment index passed to SyncMediaObjectRendererRuntime.setActiveSegmentIndex() or seekToTimelinePosition().

      If the SyncMediaObjectRendererRuntime implementation calls this method with a segment index that has not yet been set active, the call is ignored.

      Parameters

      • segmentIndex: number

      Returns void

    • MAY be called continuously by the renderer indicating its current position on the timeline. The SyncMediaObjectRendererRuntime MAY report segmentIndex and offset further ahead than the current active segment during continuous playback.

      Parameters

      • segmentIndex: number
      • newOffsetWithinSegmentMs: number

      Returns void

    • Called by the SyncMediaObjectRendererRuntime if it wants to resume playback, for example because of a user interaction.

      Returns void

    • Called by the renderer when it has reached the end of a range set by playUntilRangeEnd(). The renderer MUST internally pause at the exact position of the endPosition, but MUST NOT call onRuntimePaused().

      Parameters

      • rangeId: number

      Returns void

    • Called by the SyncMediaObjectRendererRuntime when its pause state changes due to a user interaction causing the playback to stop. This method SHOULD NOT be called if the renderer runtime pauses due to an error, or if the pause() method is called.

      Returns void

    • Called by the SyncMediaObjectRendererRuntime when its ready state changes from waiting to ready. This means that it has enough data to perform continuous playback.

      The SyncMediaObjectRendererRuntime MUST wait for a call to play() before resuming playback.

      Returns void

    • Called by the SyncMediaObjectRendererRuntime when its ready state changes from ready to waiting. This means that it hasn't enough data to perform continuous playback.

      The SyncMediaObjectRendererRuntime MUST internally pause its playback before calling this method.

      Returns void

    • Called by the renderer when it has received additional information about a segment's duration (such as after loading the media) and it does not match with the approximated value.

      Parameters

      • segmentIndex: number
      • newDurationMs: number

      Returns void

    • Called when a segment error occurs. If the renderer is unable to play the segment due to the error, the renderer should pause itself and set the paused flag to true. The renderer SHOULD NOT call onRuntimePaused().

      Parameters

      • segmentIndex: number

        The segment index that failed to load/play

      • errorType: SyncMediaPlayerErrorType

        The type of error that occurred.

      • error: unknown

        An error object further describing the error.

      • paused: boolean

        If the error caused the renderer runtime to become paused.

      Returns void