Interface IMediaPlayerSourceObserver

Provides callbacks for media players.

Hierarchy

  • IMediaPlayerSourceObserver

Methods

  • Reports the volume of the media player.

    The SDK triggers this callback every 200 milliseconds to report the current volume of the media player.

    Parameters

    • volume: number

      The volume of the media player. The value ranges from 0 to 255.

    Returns void

  • Occurs when the media metadata is received.

    The callback occurs when the player receives the media metadata and reports the detailed information of the media metadata.

    Parameters

    • data: Uint8Array

      The detailed data of the media metadata.

    • length: number

      The data length (bytes).

    Returns void

  • Reports the playback duration that the buffered data can support.

    When playing online media resources, the SDK triggers this callback every two seconds to report the playback duration that the currently buffered data can support. When the playback duration supported by the buffered data is less than the threshold (0 by default), the SDK returns PlayerEventBufferLow (6). When the playback duration supported by the buffered data is greater than the threshold (0 by default), the SDK returns PlayerEventBufferRecover (7).

    Parameters

    • playCachedBuffer: number

      The playback duration (ms) that the buffered data can support.

    Returns void

  • Reports the statistics of the media file being cached.

    After you call the openWithMediaSource method and set enableCache as true, the SDK triggers this callback once per second to report the statistics of the media file being cached.

    Parameters

    • stats: CacheStatistics

      The statistics of the media file being cached. See CacheStatistics.

    Returns void

  • Reports the player events.

    After calling the seek method, the SDK triggers the callback to report the results of the seek operation.

    Parameters

    • eventCode: MediaPlayerEvent

      The player events. See MediaPlayerEvent.

    • elapsedTime: number

      The time (ms) when the event occurs.

    • message: string

      Information about the event.

    Returns void

  • Occurs when information related to the media player changes.

    When the information about the media player changes, the SDK triggers this callback. You can use this callback for troubleshooting.

    Parameters

    • info: PlayerUpdatedInfo

      Information related to the media player. See PlayerUpdatedInfo.

    Returns void

  • The statistics of the media file being played.

    The SDK triggers this callback once per second to report the statistics of the media file being played.

    Parameters

    Returns void

  • Reports the changes of playback state.

    When the state of the media player changes, the SDK triggers this callback to report the current playback state.

    Parameters

    • state: MediaPlayerState

      The playback state. See MediaPlayerState.

    • reason: MediaPlayerReason

      The reason for the changes in the media player status. See MediaPlayerReason.

    Returns void

  • Occurs when the video bitrate of the media resource changes.

    Parameters

    • from: SrcInfo

      Information about the video bitrate of the media resource being played. See SrcInfo.

    • to: SrcInfo

      Information about the changed video bitrate of media resource being played. See SrcInfo.

    Returns void

  • Reports the playback progress of the media file.

    When playing media files, the SDK triggers this callback every two second to report current playback progress.

    Parameters

    • positionMs: number

      The playback position (ms) of media files.

    • timestampMs: number

    Returns void

  • Reports the events of preloaded media resources.

    Parameters

    • src: string

      The URL of the media resource.

    • event: PlayerPreloadEvent

      Events that occur when media resources are preloaded. See PlayerPreloadEvent.

    Returns void

Generated using TypeDoc