AgoraRTCManager constructor

AgoraRTCManager(
  1. RTCEventHandler handler
)

Implementation

AgoraRTCManager(
  this.handler,
) {
  _handler = RtcEngineEventHandler(
    onUserEnableLocalVideo: (connection, remoteUid, enabled) {},
    onUserEnableVideo: (connection, remoteUid, enabled) {},
    onLocalVideoStats: (connection, stats) {},
    onVideoDeviceStateChanged: (deviceId, deviceType, deviceState) {},
    onVideoStopped: () {},
    onLocalVideoStateChanged: (source, state, error) {},
    onRemoteVideoStats: (connection, stats) {},
    onVideoPublishStateChanged:
        (source, channel, oldState, newState, elapseSinceLastState) {},
    onVideoSizeChanged:
        (connection, sourceType, uid, width, height, rotation) {},
    onVideoSubscribeStateChanged:
        (channel, uid, oldState, newState, elapseSinceLastState) {},
    onError: (err, msg) {
      handler.onError?.call(ErrorCodeType.errFailed, msg);
    },
    onJoinChannelSuccess: (connection, elapsed) {
      handler.onJoinChannelSuccess?.call();
    },
    onLeaveChannel: (connection, stats) {
      handler.onLeaveChannel?.call();
    },
    onUserJoined: (connection, remoteUid, elapsed) {
      handler.onUserJoined?.call(remoteUid);
    },
    onUserOffline: (connection, remoteUid, reason) {
      handler.onUserLeaved?.call(remoteUid);
    },
    onUserMuteVideo: (
      connection,
      remoteUid,
      muted,
    ) {
      handler.onUserMuteVideo?.call(remoteUid, muted);
    },
    onUserMuteAudio: (
      connection,
      remoteUid,
      muted,
    ) {
      handler.onUserMuteAudio?.call(remoteUid, muted);
    },
    onFirstRemoteVideoDecoded: (
      connection,
      remoteUid,
      width,
      height,
      elapsed,
    ) {
      handler.onFirstRemoteVideoDecoded?.call(remoteUid, width, height);
    },
    onRemoteVideoStateChanged: (
      connection,
      remoteUid,
      state,
      reason,
      elapsed,
    ) {
      handler.onRemoteVideoStateChanged?.call(remoteUid, state, reason);
    },
    onActiveSpeaker: (
      connection,
      uid,
    ) {
      handler.onActiveSpeaker?.call(uid);
    },
  );
}