视频逻辑重新梳理
This commit is contained in:
parent
3b1fbc837c
commit
8d4979b484
|
|
@ -144,11 +144,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
||||||
/// 关闭发言权限
|
/// 关闭发言权限
|
||||||
Future<void> doHttpCancelSpeak() async {
|
Future<void> doHttpCancelSpeak() async {
|
||||||
await getClient().cancelSpeak(state.meetingRoomInfo.value!.id, state.meetingRoomInfo.value!.roomNum, UserStore.to.userInfoEntity.value!.uid);
|
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 {
|
Future<void> doHttpSetCamer(bool isOpenCamera) async {
|
||||||
await getClient().setCamera(state.roomNumber.value, state.isOpenCamera.value, UserStore.to.userInfoEntity.value!.uid);
|
await getClient().setCamera(state.roomNumber.value, isOpenCamera, UserStore.to.userInfoEntity.value!.uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 设置视频是否开启
|
/// 设置视频是否开启
|
||||||
void setCameraOpen(bool isOpen){
|
void setCameraOpen(bool isOpen){
|
||||||
state.isOpenCamera.value = 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){
|
if(UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid){
|
||||||
state.isSpeak.value = true;
|
state.isSpeak.value = true;
|
||||||
state.isOpenMicrophone.value = true;
|
state.isOpenMicrophone.value = true;
|
||||||
|
// 设置声网SDK角色为主播
|
||||||
setClientRole("主播");
|
setClientRole("主播");
|
||||||
debugPrint("wgs输出===:Socket-开启发言权限:主播");
|
debugPrint("wgs输出===:Socket-开启发言权限:主播");
|
||||||
}
|
}
|
||||||
|
|
@ -284,8 +271,19 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
||||||
state.isSpeak.value = false;
|
state.isSpeak.value = false;
|
||||||
state.isOpenMicrophone.value = false;
|
state.isOpenMicrophone.value = false;
|
||||||
state.isOpenCamera.value = false;
|
state.isOpenCamera.value = false;
|
||||||
|
|
||||||
|
// 设置声网SDK角色为观众
|
||||||
setClientRole("观众");
|
setClientRole("观众");
|
||||||
|
// 取消发布视频流
|
||||||
|
muteLocalVideoStream(true);
|
||||||
|
// 停止本地预览
|
||||||
|
stopPreview();
|
||||||
|
// 关闭本地预览悬浮窗
|
||||||
|
state.floating.value?.close();
|
||||||
changePageState(0);
|
changePageState(0);
|
||||||
|
state.isSelf.value = false;
|
||||||
|
state.remoteUid.value = "";
|
||||||
|
|
||||||
debugPrint("wgs输出===:Socket-关闭发言权限:观众");
|
debugPrint("wgs输出===:Socket-关闭发言权限:观众");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -362,6 +360,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
||||||
for(var j = 0; j < state.cacheUsers.value.length; j++){
|
for(var j = 0; j < state.cacheUsers.value.length; j++){
|
||||||
if(state.cacheUsers.value[j].uid == uidStr){
|
if(state.cacheUsers.value[j].uid == uidStr){
|
||||||
state.cacheUsers.value.removeAt(j);
|
state.cacheUsers.value.removeAt(j);
|
||||||
|
doHttpGetTvAnchor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -437,6 +436,12 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
||||||
if(meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid){
|
if(meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid){
|
||||||
state.isOpenCamera.value = false;
|
state.isOpenCamera.value = false;
|
||||||
|
|
||||||
|
// 当前全员观看是自己时
|
||||||
|
if(state.isSelf.value == true){
|
||||||
|
changePageState(0);
|
||||||
|
state.isSelf.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
// 取消发布视频流
|
// 取消发布视频流
|
||||||
muteLocalVideoStream(true);
|
muteLocalVideoStream(true);
|
||||||
// 停止本地预览
|
// 停止本地预览
|
||||||
|
|
|
||||||
|
|
@ -484,9 +484,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (state.isSpeak.value == true) {
|
if (state.isSpeak.value == true) {
|
||||||
if (state.isOpenCamera.value == true) {
|
if (state.isOpenCamera.value == true) {
|
||||||
logic.setCameraOpen(false);
|
logic.doHttpSetCamer(false);
|
||||||
} else {
|
} else {
|
||||||
logic.setCameraOpen(true);
|
logic.doHttpSetCamer(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1530,7 +1530,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: const CircularProgressIndicator(),
|
: const CircularProgressIndicator(),
|
||||||
Positioned(
|
/*Positioned(
|
||||||
bottom: 110,
|
bottom: 110,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
|
|
@ -1539,10 +1539,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),*/
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 16,
|
top: 16,
|
||||||
right: 16,
|
right: 16,
|
||||||
|
|
@ -1710,7 +1709,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
canvas: const VideoCanvas(uid: 0, setupMode: VideoViewSetupMode.videoViewSetupAdd),
|
canvas: const VideoCanvas(uid: 0, setupMode: VideoViewSetupMode.videoViewSetupAdd),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
/*Positioned(
|
||||||
bottom: 110,
|
bottom: 110,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
|
|
@ -1719,10 +1718,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),*/
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 16,
|
top: 16,
|
||||||
right: 16,
|
right: 16,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue