io.agora.rtc

## Interface IAgoraMediaPlayerSourceObserver

-     public interface IAgoraMediaPlayerSourceObserver

  Observer interface for Agora media player source events.

- - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `onAgoraCDNTokenWillExpire(AgoraMediaPlayerSource agora_media_player_source)` Called when the Agora CDN token is about to expire.
    `default void` | `onAudioVolumeIndication(AgoraMediaPlayerSource agora_media_player_source, int volume)` Called when audio volume indication is received.
    `default void` | `onCompleted(AgoraMediaPlayerSource agora_media_player_source)` Called when playback is completed.
    `default void` | `onMetaData(AgoraMediaPlayerSource agora_media_player_source, byte[] data, int length)` Called when metadata is received.
    `default void` | `onPlayBufferUpdated(AgoraMediaPlayerSource agora_media_player_source, long play_cached_buffer)` Called when the play buffer is updated.
    `default void` | `onPlayerEvent(AgoraMediaPlayerSource agora_media_player_source, int event, long elapsedTime, java.lang.String message)` Called when a player event occurs.
    `default void` | `onPlayerInfoUpdated(AgoraMediaPlayerSource agora_media_player_source, PlayerUpdatedInfo info)` Called when player info is updated.
    `default void` | `onPlayerSourceStateChanged(AgoraMediaPlayerSource agora_media_player_source, int state, int ec)` Called when the player source state changes.
    `default void` | `onPlayerSrcInfoChanged(AgoraMediaPlayerSource agora_media_player_source, SrcInfo from, SrcInfo to)` Called when the player source info changes.
    `default void` | `onPositionChanged(AgoraMediaPlayerSource agora_media_player_source, long position)` Called when the playback position changes.
    `default void` | `onPreloadEvent(AgoraMediaPlayerSource agora_media_player_source, java.lang.String src, int event)` Called when a preload event occurs.

- - ### Method Detail

    - #### onPlayerSourceStateChanged

          default void onPlayerSourceStateChanged(AgoraMediaPlayerSource agora_media_player_source,
                                                  int state,
                                                  int ec)

      Called when the player source state changes.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `state` - The player source state
        `ec` - Error code

    - #### onPositionChanged

          default void onPositionChanged(AgoraMediaPlayerSource agora_media_player_source,
                                         long position)

      Called when the playback position changes.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `position` - The playback position

    - #### onPlayerEvent

          default void onPlayerEvent(AgoraMediaPlayerSource agora_media_player_source,
                                     int event,
                                     long elapsedTime,
                                     java.lang.String message)

      Called when a player event occurs.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `event` - The event type
        `elapsedTime` - Elapsed time
        `message` - Event message

    - #### onMetaData

          default void onMetaData(AgoraMediaPlayerSource agora_media_player_source,
                                  byte[] data,
                                  int length)

      Called when metadata is received.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `data` - Metadata data
        `length` - Data length

    - #### onPlayBufferUpdated

          default void onPlayBufferUpdated(AgoraMediaPlayerSource agora_media_player_source,
                                           long play_cached_buffer)

      Called when the play buffer is updated.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `play_cached_buffer` - Cached buffer size

    - #### onPreloadEvent

          default void onPreloadEvent(AgoraMediaPlayerSource agora_media_player_source,
                                      java.lang.String src,
                                      int event)

      Called when a preload event occurs.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `src` - Source URL
        `event` - Event type

    - #### onCompleted

          default void onCompleted(AgoraMediaPlayerSource agora_media_player_source)

      Called when playback is completed.
      Parameters:
        `agora_media_player_source` - The media player source instance

    - #### onAgoraCDNTokenWillExpire

          default void onAgoraCDNTokenWillExpire(AgoraMediaPlayerSource agora_media_player_source)

      Called when the Agora CDN token is about to expire.
      Parameters:
        `agora_media_player_source` - The media player source instance

    - #### onPlayerSrcInfoChanged

          default void onPlayerSrcInfoChanged(AgoraMediaPlayerSource agora_media_player_source,
                                              SrcInfo from,
                                              SrcInfo to)

      Called when the player source info changes.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `from` - Previous source info
        `to` - New source info

    - #### onPlayerInfoUpdated

          default void onPlayerInfoUpdated(AgoraMediaPlayerSource agora_media_player_source,
                                           PlayerUpdatedInfo info)

      Called when player info is updated.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `info` - Updated player info

    - #### onAudioVolumeIndication

          default void onAudioVolumeIndication(AgoraMediaPlayerSource agora_media_player_source,
                                               int volume)

      Called when audio volume indication is received.
      Parameters:
        `agora_media_player_source` - The media player source instance
        `volume` - Audio volume