Interface MKBufferAPI

Buffer Level refers to the amount of media data (audio, video) that has been preloaded and stored in the buffer of a media player relative to the current playback position. This includes both the forward buffer level, which is the duration or amount of media data buffered ahead of the current playback position and the backward buffer level, which is the duration or amount of media data buffered behind the current playback position. This measure indicates the readiness of the player to continue playing without interruption due to the need to fetch additional data from the source.

Hierarchy

  • MKBufferAPI

Methods

  • Returns the BufferLevel for the chosen buffer type and media type of the active Source. Returns a BufferLevel where BufferLevel.level and BufferLevel.targetLevel is 0.0 if there is no active playback session.

    Example:

    mkplayer.buffer.getLevel(MKBufferType.BackwardDuration, MKMediaType.Video)
    

    Parameters

    • type: MKBufferType

      the buffer type for which to get the buffer level for.

    • media: MKMediaType

      the media type for which to get the buffer level for.

    Returns MKBufferLevel

  • Sets the target buffer level for the chosen buffer type across all media types. The set target buffer levels persist across playback sessions.

    Example:

    mkplayer.buffer.setTargetLevel(MKBufferType.ForwardDuration, requiredLevel)
    

    Parameters

    • type: MKBufferType

      The buffer type to change the target buffer level for.

    • value: number

      The value to set.

    • media: MKMediaType

      The media type to change the target buffer level for.

    Returns void