onUserVideoStateChanged method
void
onUserVideoStateChanged()
Implementation
void onUserVideoStateChanged(String userId, TUIVideoStreamType streamType, bool hasVideo, TUIChangeReason reason) {
if (streamType == TUIVideoStreamType.screenStream) {
if (hasVideo) {
userState.hasScreenStreamUserList.value.add(userId);
} else {
userState.hasScreenStreamUserList.value.remove(userId);
}
final LinkedHashSet<String> tempList = LinkedHashSet<String>();
tempList.addAll(userState.hasScreenStreamUserList.value);
userState.hasScreenStreamUserList.value = tempList;
return;
}
if (hasVideo) {
userState.hasVideoStreamUserList.value.add(userId);
} else {
userState.hasVideoStreamUserList.value.remove(userId);
}
final LinkedHashSet<String> tempList = LinkedHashSet<String>();
tempList.addAll(userState.hasVideoStreamUserList.value);
userState.hasVideoStreamUserList.value = tempList;
if (userId == userState.selfInfo.userId) {
mediaState.isCameraOpened.value = hasVideo;
}
}