getAudioVideoViewNotifier method

ValueNotifier<Widget?> getAudioVideoViewNotifier(
  1. String? userID, {
  2. ZegoStreamType streamType = ZegoStreamType.main,
})

get audio video view notifier

Implementation

ValueNotifier<Widget?> getAudioVideoViewNotifier(
  String? userID, {
  ZegoStreamType streamType = ZegoStreamType.main,
}) {
  if (userID == null ||
      userID == ZegoUIKitCore.shared.coreData.localUser.id) {
    switch (streamType) {
      case ZegoStreamType.main:
        return ZegoUIKitCore.shared.coreData.localUser.mainChannel.view;
      case ZegoStreamType.media:
      case ZegoStreamType.screenSharing:
      case ZegoStreamType.mix:
        return ZegoUIKitCore.shared.coreData.localUser.auxChannel.view;
    }
  } else {
    final targetUser = ZegoUIKitCore.shared.coreData.remoteUsersList
        .firstWhere((user) => user.id == userID,
            orElse: ZegoUIKitCoreUser.empty);
    switch (streamType) {
      case ZegoStreamType.main:
        return targetUser.mainChannel.view;
      case ZegoStreamType.media:
      case ZegoStreamType.screenSharing:
      case ZegoStreamType.mix:
        return targetUser.auxChannel.view;
      // return targetUser.thirdChannel.view;
    }
  }
}