视频逻辑重新梳理

This commit is contained in:
fuenmao 2024-12-10 08:29:03 +08:00
parent 3b1fbc837c
commit 8d4979b484
2 changed files with 27 additions and 24 deletions

View File

@ -144,11 +144,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
///
Future<void> doHttpCancelSpeak() async {
await getClient().cancelSpeak(state.meetingRoomInfo.value!.id, state.meetingRoomInfo.value!.roomNum, UserStore.to.userInfoEntity.value!.uid);
/*setClientRole("观众");
setMicrophoneOpen(false);
setCameraOpen(false);
setScreenShareOpen(false);
changePageState(0);*/
}
/// ------------------------------------------------------------------------------
@ -159,22 +154,13 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
/// -------------------------------------------------------------------------------
///
Future<void> doHttpSetCamer() async {
await getClient().setCamera(state.roomNumber.value, state.isOpenCamera.value, UserStore.to.userInfoEntity.value!.uid);
Future<void> doHttpSetCamer(bool isOpenCamera) async {
await getClient().setCamera(state.roomNumber.value, isOpenCamera, UserStore.to.userInfoEntity.value!.uid);
}
///
void setCameraOpen(bool isOpen){
state.isOpenCamera.value = isOpen;
doHttpSetCamer();
}
///
void hangUpVideo(){
stopPreview();
state.isOpenCamera.value = false;
changePageState(0);
doHttpSetCamer();
}
///
@ -268,6 +254,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
if(UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid){
state.isSpeak.value = true;
state.isOpenMicrophone.value = true;
// SDK角色为主播
setClientRole("主播");
debugPrint("wgs输出===Socket-开启发言权限:主播");
}
@ -284,8 +271,19 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
state.isSpeak.value = false;
state.isOpenMicrophone.value = false;
state.isOpenCamera.value = false;
// SDK角色为观众
setClientRole("观众");
//
muteLocalVideoStream(true);
//
stopPreview();
//
state.floating.value?.close();
changePageState(0);
state.isSelf.value = false;
state.remoteUid.value = "";
debugPrint("wgs输出===Socket-关闭发言权限:观众");
}
}
@ -362,6 +360,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
for(var j = 0; j < state.cacheUsers.value.length; j++){
if(state.cacheUsers.value[j].uid == uidStr){
state.cacheUsers.value.removeAt(j);
doHttpGetTvAnchor();
}
}
}
@ -437,6 +436,12 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
if(meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid){
state.isOpenCamera.value = false;
//
if(state.isSelf.value == true){
changePageState(0);
state.isSelf.value = false;
}
//
muteLocalVideoStream(true);
//

View File

@ -484,9 +484,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
onTap: () {
if (state.isSpeak.value == true) {
if (state.isOpenCamera.value == true) {
logic.setCameraOpen(false);
logic.doHttpSetCamer(false);
} else {
logic.setCameraOpen(true);
logic.doHttpSetCamer(true);
}
}
},
@ -1530,7 +1530,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
),
)
: const CircularProgressIndicator(),
Positioned(
/*Positioned(
bottom: 110,
child: GestureDetector(
child: Image.asset(
@ -1539,10 +1539,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
height: 50.h,
),
onTap: () {
},
),
),
),*/
Positioned(
top: 16,
right: 16,
@ -1710,7 +1709,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
canvas: const VideoCanvas(uid: 0, setupMode: VideoViewSetupMode.videoViewSetupAdd),
),
),
Positioned(
/*Positioned(
bottom: 110,
child: GestureDetector(
child: Image.asset(
@ -1719,10 +1718,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
height: 50.h,
),
onTap: () {
},
),
),
),*/
Positioned(
top: 16,
right: 16,