updateSelfVideoState method

void updateSelfVideoState(
  1. bool hasVideo,
  2. TUIChangeReason reason, {
  3. bool? isScreenStream,
})

Implementation

void updateSelfVideoState(bool hasVideo, TUIChangeReason reason,
    {bool? isScreenStream}) {
  if (isScreenStream == true) {
    currentUser.hasScreenStream.value = hasVideo;
  } else {
    currentUser.hasVideoStream.value = hasVideo;
  }
  updateItemTouchableState();

  if (reason != TUIChangeReason.changedByAdmin) {
    return;
  }
  if (currentUser.hasVideoStream.value) {
    makeToast(
        msg: RoomContentsTranslations.translate('cameraTurnedOnByHostToast'));
  } else if (!roomInfo.isCameraDisableForAllUser) {
    if (isRoomNeedTakeSeat() && !currentUser.isOnSeat.value) {
      return;
    }
    makeToast(
        msg:
            RoomContentsTranslations.translate('cameraTurnedOffByHostToast'));
  }
}