parent
c3e394255a
commit
86724ced8f
|
|
@ -28,7 +28,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
||||||
var data = Get.arguments;
|
var data = Get.arguments;
|
||||||
state.roomNumber.value = data["roomNumber"];
|
state.roomNumber.value = data["roomNumber"];
|
||||||
|
|
||||||
doHttpGetMeetingToken();
|
doHttpGetMeetingToken(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -43,12 +43,14 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 获取会议室Token
|
/// 获取会议室Token
|
||||||
Future<void> doHttpGetMeetingToken() async {
|
Future<void> doHttpGetMeetingToken(bool isInit) async {
|
||||||
BaseStructureResult<String> res = await getClient().getMeetingToken(state.roomNumber.value);
|
BaseStructureResult<String> res = await getClient().getMeetingToken(state.roomNumber.value);
|
||||||
state.meetingToken.value = res.data!;
|
state.meetingToken.value = res.data!;
|
||||||
|
|
||||||
initRtc();
|
if(isInit == true){
|
||||||
signalRSocket();
|
initRtc();
|
||||||
|
signalRSocket();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 合并请求
|
/// 合并请求
|
||||||
|
|
@ -492,7 +494,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -502,7 +503,12 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
||||||
ClientRoleType oldRole,
|
ClientRoleType oldRole,
|
||||||
ClientRoleType newRole,
|
ClientRoleType newRole,
|
||||||
ClientRoleOptions newRoleOptions){
|
ClientRoleOptions newRoleOptions){
|
||||||
debugPrint("wgs输出===:RTC-切换用户角色");
|
debugPrint("wgs输出===:RTC-切换用户角色为:${newRole == ClientRoleType.clientRoleBroadcaster ? "主播" : "观众"}");
|
||||||
|
},
|
||||||
|
|
||||||
|
// token即将在30秒内过期
|
||||||
|
onTokenPrivilegeWillExpire: (RtcConnection connection, String token){
|
||||||
|
doHttpGetMeetingToken(false);
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue