io.agora.rtc

## Interface ILocalUserObserver

- All Known Implementing Classes:
    LocalUserObserverWrapper

      public interface ILocalUserObserver

  Observer interface for local user events.

- - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `onActiveSpeaker(AgoraLocalUser agoraLocalUser, java.lang.String userId)` Called when an active speaker is detected.
    `default void` | `onAudioMetaDataReceived(AgoraLocalUser agoraLocalUser, java.lang.String userId, byte[] metaData)` Called when audio metadata is received.
    `default void` | `onAudioPublishStateChanged(AgoraLocalUser agoraLocalUser, java.lang.String channel, int oldState, int newState, int elapseSinceLastState)` Called when audio publish state changes.
    `default void` | `onAudioSubscribeStateChanged(AgoraLocalUser agoraLocalUser, java.lang.String channel, java.lang.String userId, int oldState, int newState, int elapseSinceLastState)` Called when audio subscribe state changes.
    `default void` | `onAudioTrackPublicationFailure(AgoraLocalUser agoraLocalUser, AgoraLocalAudioTrack agoraLocalAudioTrack, int error)` Called when audio track publication fails.
    `default void` | `onAudioTrackPublishStart(AgoraLocalUser agoraLocalUser, AgoraLocalAudioTrack agoraLocalAudioTrack)` Called when audio track publish starts.
    `default void` | `onAudioTrackPublishSuccess(AgoraLocalUser agoraLocalUser, AgoraLocalAudioTrack agoraLocalAudioTrack)` Called when audio track publish succeeds.
    `default void` | `onAudioTrackUnpublished(AgoraLocalUser agoraLocalUser, AgoraLocalAudioTrack agoraLocalAudioTrack)` Called when audio track is unpublished.
    `default void` | `onAudioVolumeIndication(AgoraLocalUser agoraLocalUser, AudioVolumeInfo[] speakers, int totalVolume)` Called when audio volume indication is received.
    `default void` | `onFirstRemoteAudioDecoded(AgoraLocalUser agoraLocalUser, java.lang.String userId, int elapsed)` Called when the first remote audio frame is decoded.
    `default void` | `onFirstRemoteAudioFrame(AgoraLocalUser agoraLocalUser, java.lang.String userId, int elapsed)` Called when the first remote audio frame is received.
    `default void` | `onFirstRemoteVideoDecoded(AgoraLocalUser agoraLocalUser, java.lang.String userId, int width, int height, int elapsed)` Called when the first remote video frame is decoded.
    `default void` | `onFirstRemoteVideoFrame(AgoraLocalUser agoraLocalUser, java.lang.String userId, int width, int height, int elapsed)` Called when the first remote video frame is received.
    `default void` | `onFirstRemoteVideoFrameRendered(AgoraLocalUser agoraLocalUser, java.lang.String userId, int width, int height, int elapsed)` Called when the first remote video frame is rendered.
    `default void` | `onIntraRequestReceived(AgoraLocalUser agoraLocalUser)` Called when an intra request is received.
    `default void` | `onLocalAudioTrackStateChanged(AgoraLocalUser agoraLocalUser, AgoraLocalAudioTrack agoraLocalAudioTrack, int state, int error)` Called when local audio track state changes.
    `default void` | `onLocalAudioTrackStatistics(AgoraLocalUser agoraLocalUser, LocalAudioStats stats)` Called when local audio track statistics are updated.
    `default void` | `onLocalVideoTrackStateChanged(AgoraLocalUser agoraLocalUser, AgoraLocalVideoTrack agoraLocalVideoTrack, int state, int error)` Called when local video track state changes.
    `default void` | `onLocalVideoTrackStatistics(AgoraLocalUser agoraLocalUser, AgoraLocalVideoTrack agoraLocalVideoTrack, LocalVideoTrackStats stats)` Called when local video track statistics are updated.
    `default void` | `onRemoteAudioTrackStatistics(AgoraLocalUser agoraLocalUser, AgoraRemoteAudioTrack agoraRemoteAudioTrack, RemoteAudioTrackStats stats)` Called when remote audio track statistics are updated.
    `default void` | `onRemoteSubscribeFallbackToAudioOnly(AgoraLocalUser agoraLocalUser, java.lang.String userId, int isFallbackOrRecover)` Called when remote subscribe falls back to audio only or recovers.
    `default void` | `onRemoteVideoStreamInfoUpdated(AgoraLocalUser agoraLocalUser, RemoteVideoStreamInfo info)` Called when remote video stream info is updated.
    `default void` | `onRemoteVideoTrackStatistics(AgoraLocalUser agoraLocalUser, AgoraRemoteVideoTrack agoraRemoteVideoTrack, RemoteVideoTrackStats stats)` Called when remote video track statistics are updated.
    `default void` | `onStreamMessage(AgoraLocalUser agoraLocalUser, java.lang.String userId, int streamId, byte[] data)` Called when a stream message is received.
    `default void` | `onUserAudioTrackStateChanged(AgoraLocalUser agoraLocalUser, java.lang.String userId, AgoraRemoteAudioTrack agoraRemoteAudioTrack, int state, int reason, int elapsed)` Called when user audio track state changes.
    `default void` | `onUserAudioTrackSubscribed(AgoraLocalUser agoraLocalUser, java.lang.String userId, AgoraRemoteAudioTrack agoraRemoteAudioTrack)` Called when a user audio track is subscribed.
    `default void` | `onUserInfoUpdated(AgoraLocalUser agoraLocalUser, java.lang.String userId, int msg, int val)` Called when user info is updated.
    `default void` | `onUserStateChanged(AgoraLocalUser agoraLocalUser, java.lang.String userId, int state)` Called when user state changes.
    `default void` | `onUserVideoTrackStateChanged(AgoraLocalUser agoraLocalUser, java.lang.String userId, AgoraRemoteVideoTrack agoraRemoteVideoTrack, int state, int reason, int elapsed)` Called when user video track state changes.
    `default void` | `onUserVideoTrackSubscribed(AgoraLocalUser agoraLocalUser, java.lang.String userId, VideoTrackInfo info, AgoraRemoteVideoTrack agoraRemoteVideoTrack)` Called when a user video track is subscribed.
    `default void` | `onVideoPublishStateChanged(AgoraLocalUser agoraLocalUser, java.lang.String channel, int oldState, int newState, int elapseSinceLastState)` Called when video publish state changes.
    `default void` | `onVideoSizeChanged(AgoraLocalUser agoraLocalUser, java.lang.String userId, int width, int height, int rotation)` Called when video size changes.
    `default void` | `onVideoSubscribeStateChanged(AgoraLocalUser agoraLocalUser, java.lang.String channel, java.lang.String userId, int oldState, int newState, int elapseSinceLastState)` Called when video subscribe state changes.
    `default void` | `onVideoTrackPublicationFailure(AgoraLocalUser agoraLocalUser, AgoraLocalVideoTrack agoraLocalVideoTrack, int error)` Called when video track publication fails.
    `default void` | `onVideoTrackPublishStart(AgoraLocalUser agoraLocalUser, AgoraLocalVideoTrack agoraLocalVideoTrack)` Called when video track publish starts.
    `default void` | `onVideoTrackPublishSuccess(AgoraLocalUser agoraLocalUser, AgoraLocalVideoTrack agoraLocalVideoTrack)` Called when video track publish succeeds.
    `default void` | `onVideoTrackUnpublished(AgoraLocalUser agoraLocalUser, AgoraLocalVideoTrack agoraLocalVideoTrack)` Called when video track is unpublished.

- - ### Method Detail

    - #### onAudioTrackPublishSuccess

          default void onAudioTrackPublishSuccess(AgoraLocalUser agoraLocalUser,
                                                  AgoraLocalAudioTrack agoraLocalAudioTrack)

      Called when audio track publish succeeds.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalAudioTrack` - The local audio track

    - #### onAudioTrackPublicationFailure

          default void onAudioTrackPublicationFailure(AgoraLocalUser agoraLocalUser,
                                                      AgoraLocalAudioTrack agoraLocalAudioTrack,
                                                      int error)

      Called when audio track publication fails.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalAudioTrack` - The local audio track
        `error` - Error code

    - #### onLocalAudioTrackStateChanged

          default void onLocalAudioTrackStateChanged(AgoraLocalUser agoraLocalUser,
                                                     AgoraLocalAudioTrack agoraLocalAudioTrack,
                                                     int state,
                                                     int error)

      Called when local audio track state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalAudioTrack` - The local audio track
        `state` - Track state
        `error` - Error code

    - #### onLocalAudioTrackStatistics

          default void onLocalAudioTrackStatistics(AgoraLocalUser agoraLocalUser,
                                                   LocalAudioStats stats)

      Called when local audio track statistics are updated.
      Parameters:
        `agoraLocalUser` - The local user instance
        `stats` - Local audio statistics

    - #### onRemoteAudioTrackStatistics

          default void onRemoteAudioTrackStatistics(AgoraLocalUser agoraLocalUser,
                                                    AgoraRemoteAudioTrack agoraRemoteAudioTrack,
                                                    RemoteAudioTrackStats stats)

      Called when remote audio track statistics are updated.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraRemoteAudioTrack` - The remote audio track
        `stats` - Remote audio track statistics

    - #### onUserAudioTrackSubscribed

          default void onUserAudioTrackSubscribed(AgoraLocalUser agoraLocalUser,
                                                  java.lang.String userId,
                                                  AgoraRemoteAudioTrack agoraRemoteAudioTrack)

      Called when a user audio track is subscribed.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `agoraRemoteAudioTrack` - The remote audio track

    - #### onUserAudioTrackStateChanged

          default void onUserAudioTrackStateChanged(AgoraLocalUser agoraLocalUser,
                                                    java.lang.String userId,
                                                    AgoraRemoteAudioTrack agoraRemoteAudioTrack,
                                                    int state,
                                                    int reason,
                                                    int elapsed)

      Called when user audio track state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `agoraRemoteAudioTrack` - The remote audio track
        `state` - Track state
        `reason` - State change reason
        `elapsed` - Elapsed time

    - #### onAudioSubscribeStateChanged

          default void onAudioSubscribeStateChanged(AgoraLocalUser agoraLocalUser,
                                                    java.lang.String channel,
                                                    java.lang.String userId,
                                                    int oldState,
                                                    int newState,
                                                    int elapseSinceLastState)

      Called when audio subscribe state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `channel` - Channel name
        `userId` - User ID
        `oldState` - Previous state
        `newState` - New state
        `elapseSinceLastState` - Elapsed time since last state change

    - #### onAudioPublishStateChanged

          default void onAudioPublishStateChanged(AgoraLocalUser agoraLocalUser,
                                                  java.lang.String channel,
                                                  int oldState,
                                                  int newState,
                                                  int elapseSinceLastState)

      Called when audio publish state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `channel` - Channel name
        `oldState` - Previous state
        `newState` - New state
        `elapseSinceLastState` - Elapsed time since last state change

    - #### onFirstRemoteAudioFrame

          default void onFirstRemoteAudioFrame(AgoraLocalUser agoraLocalUser,
                                               java.lang.String userId,
                                               int elapsed)

      Called when the first remote audio frame is received.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `elapsed` - Elapsed time

    - #### onFirstRemoteAudioDecoded

          default void onFirstRemoteAudioDecoded(AgoraLocalUser agoraLocalUser,
                                                 java.lang.String userId,
                                                 int elapsed)

      Called when the first remote audio frame is decoded.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `elapsed` - Elapsed time

    - #### onVideoTrackPublishSuccess

          default void onVideoTrackPublishSuccess(AgoraLocalUser agoraLocalUser,
                                                  AgoraLocalVideoTrack agoraLocalVideoTrack)

      Called when video track publish succeeds.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalVideoTrack` - The local video track

    - #### onVideoTrackPublicationFailure

          default void onVideoTrackPublicationFailure(AgoraLocalUser agoraLocalUser,
                                                      AgoraLocalVideoTrack agoraLocalVideoTrack,
                                                      int error)

      Called when video track publication fails.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalVideoTrack` - The local video track
        `error` - Error code

    - #### onLocalVideoTrackStateChanged

          default void onLocalVideoTrackStateChanged(AgoraLocalUser agoraLocalUser,
                                                     AgoraLocalVideoTrack agoraLocalVideoTrack,
                                                     int state,
                                                     int error)

      Called when local video track state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalVideoTrack` - The local video track
        `state` - Track state
        `error` - Error code

    - #### onLocalVideoTrackStatistics

          default void onLocalVideoTrackStatistics(AgoraLocalUser agoraLocalUser,
                                                   AgoraLocalVideoTrack agoraLocalVideoTrack,
                                                   LocalVideoTrackStats stats)

      Called when local video track statistics are updated.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalVideoTrack` - The local video track
        `stats` - Local video track statistics

    - #### onUserVideoTrackSubscribed

          default void onUserVideoTrackSubscribed(AgoraLocalUser agoraLocalUser,
                                                  java.lang.String userId,
                                                  VideoTrackInfo info,
                                                  AgoraRemoteVideoTrack agoraRemoteVideoTrack)

      Called when a user video track is subscribed.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `info` - Video track info
        `agoraRemoteVideoTrack` - The remote video track

    - #### onUserVideoTrackStateChanged

          default void onUserVideoTrackStateChanged(AgoraLocalUser agoraLocalUser,
                                                    java.lang.String userId,
                                                    AgoraRemoteVideoTrack agoraRemoteVideoTrack,
                                                    int state,
                                                    int reason,
                                                    int elapsed)

      Called when user video track state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `agoraRemoteVideoTrack` - The remote video track
        `state` - Track state
        `reason` - State change reason
        `elapsed` - Elapsed time

    - #### onRemoteVideoTrackStatistics

          default void onRemoteVideoTrackStatistics(AgoraLocalUser agoraLocalUser,
                                                    AgoraRemoteVideoTrack agoraRemoteVideoTrack,
                                                    RemoteVideoTrackStats stats)

      Called when remote video track statistics are updated.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraRemoteVideoTrack` - The remote video track
        `stats` - Remote video track statistics

    - #### onAudioVolumeIndication

          default void onAudioVolumeIndication(AgoraLocalUser agoraLocalUser,
                                               AudioVolumeInfo[] speakers,
                                               int totalVolume)

      Called when audio volume indication is received.
      Parameters:
        `agoraLocalUser` - The local user instance
        `speakers` - Audio volume information array
        `totalVolume` - Total volume

    - #### onActiveSpeaker

          default void onActiveSpeaker(AgoraLocalUser agoraLocalUser,
                                       java.lang.String userId)

      Called when an active speaker is detected.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID of the active speaker

    - #### onRemoteVideoStreamInfoUpdated

          default void onRemoteVideoStreamInfoUpdated(AgoraLocalUser agoraLocalUser,
                                                      RemoteVideoStreamInfo info)

      Called when remote video stream info is updated.
      Parameters:
        `agoraLocalUser` - The local user instance
        `info` - Remote video stream info

    - #### onVideoSubscribeStateChanged

          default void onVideoSubscribeStateChanged(AgoraLocalUser agoraLocalUser,
                                                    java.lang.String channel,
                                                    java.lang.String userId,
                                                    int oldState,
                                                    int newState,
                                                    int elapseSinceLastState)

      Called when video subscribe state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `channel` - Channel name
        `userId` - User ID
        `oldState` - Previous state
        `newState` - New state
        `elapseSinceLastState` - Elapsed time since last state change

    - #### onVideoPublishStateChanged

          default void onVideoPublishStateChanged(AgoraLocalUser agoraLocalUser,
                                                  java.lang.String channel,
                                                  int oldState,
                                                  int newState,
                                                  int elapseSinceLastState)

      Called when video publish state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `channel` - Channel name
        `oldState` - Previous state
        `newState` - New state
        `elapseSinceLastState` - Elapsed time since last state change

    - #### onFirstRemoteVideoFrame

          default void onFirstRemoteVideoFrame(AgoraLocalUser agoraLocalUser,
                                               java.lang.String userId,
                                               int width,
                                               int height,
                                               int elapsed)

      Called when the first remote video frame is received.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `width` - Video width
        `height` - Video height
        `elapsed` - Elapsed time

    - #### onFirstRemoteVideoDecoded

          default void onFirstRemoteVideoDecoded(AgoraLocalUser agoraLocalUser,
                                                 java.lang.String userId,
                                                 int width,
                                                 int height,
                                                 int elapsed)

      Called when the first remote video frame is decoded.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `width` - Video width
        `height` - Video height
        `elapsed` - Elapsed time

    - #### onFirstRemoteVideoFrameRendered

          default void onFirstRemoteVideoFrameRendered(AgoraLocalUser agoraLocalUser,
                                                       java.lang.String userId,
                                                       int width,
                                                       int height,
                                                       int elapsed)

      Called when the first remote video frame is rendered.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `width` - Video width
        `height` - Video height
        `elapsed` - Elapsed time

    - #### onVideoSizeChanged

          default void onVideoSizeChanged(AgoraLocalUser agoraLocalUser,
                                          java.lang.String userId,
                                          int width,
                                          int height,
                                          int rotation)

      Called when video size changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `width` - Video width
        `height` - Video height
        `rotation` - Video rotation

    - #### onUserInfoUpdated

          default void onUserInfoUpdated(AgoraLocalUser agoraLocalUser,
                                         java.lang.String userId,
                                         int msg,
                                         int val)

      Called when user info is updated.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `msg` - Message type
        `val` - Value

    - #### onIntraRequestReceived

          default void onIntraRequestReceived(AgoraLocalUser agoraLocalUser)

      Called when an intra request is received.
      Parameters:
        `agoraLocalUser` - The local user instance

    - #### onRemoteSubscribeFallbackToAudioOnly

          default void onRemoteSubscribeFallbackToAudioOnly(AgoraLocalUser agoraLocalUser,
                                                            java.lang.String userId,
                                                            int isFallbackOrRecover)

      Called when remote subscribe falls back to audio only or recovers.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `isFallbackOrRecover` - Fallback or recover flag

    - #### onStreamMessage

          default void onStreamMessage(AgoraLocalUser agoraLocalUser,
                                       java.lang.String userId,
                                       int streamId,
                                       byte[] data)

      Called when a stream message is received.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `streamId` - Stream ID
        `data` - Message data

    - #### onUserStateChanged

          default void onUserStateChanged(AgoraLocalUser agoraLocalUser,
                                          java.lang.String userId,
                                          int state)

      Called when user state changes.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `state` - User state

    - #### onAudioTrackPublishStart

          default void onAudioTrackPublishStart(AgoraLocalUser agoraLocalUser,
                                                AgoraLocalAudioTrack agoraLocalAudioTrack)

      Called when audio track publish starts.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalAudioTrack` - The local audio track

    - #### onAudioTrackUnpublished

          default void onAudioTrackUnpublished(AgoraLocalUser agoraLocalUser,
                                               AgoraLocalAudioTrack agoraLocalAudioTrack)

      Called when audio track is unpublished.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalAudioTrack` - The local audio track

    - #### onVideoTrackPublishStart

          default void onVideoTrackPublishStart(AgoraLocalUser agoraLocalUser,
                                                AgoraLocalVideoTrack agoraLocalVideoTrack)

      Called when video track publish starts.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalVideoTrack` - The local video track

    - #### onVideoTrackUnpublished

          default void onVideoTrackUnpublished(AgoraLocalUser agoraLocalUser,
                                               AgoraLocalVideoTrack agoraLocalVideoTrack)

      Called when video track is unpublished.
      Parameters:
        `agoraLocalUser` - The local user instance
        `agoraLocalVideoTrack` - The local video track

    - #### onAudioMetaDataReceived

          default void onAudioMetaDataReceived(AgoraLocalUser agoraLocalUser,
                                               java.lang.String userId,
                                               byte[] metaData)

      Called when audio metadata is received.
      Parameters:
        `agoraLocalUser` - The local user instance
        `userId` - User ID
        `metaData` - Metadata bytes