This commit is contained in:
yj 2024-08-27 11:51:03 +08:00
parent 07aa661dba
commit edfaa9342b
2 changed files with 4 additions and 1 deletions

View File

@ -253,6 +253,7 @@ const Meeting: React.FC = () => {
agora.setJoinChannel({
channelId: state.channelId,
uid: userInfo.uid,
screenShareId: userInfo.screenShareId,
token: state.token,
tokenA: state.tokenA,
})

View File

@ -15,6 +15,7 @@ const option: any = {
tokenA: '',
channelId: '',
uid: '',
screenShareId: '',
}
let rtcEngine: any = '';
@ -221,7 +222,7 @@ const agora = {
allJoinChannelEx: async () => {
await rtcEngine.joinChannelEx(
option.tokenA,
{ channelId: option.channelId + 'a', localUid: Number(option.uid) },
{ channelId: option.channelId + 'a', localUid: Number('1' + option.screenShareId) },
{
autoSubscribeAudio: false,//设置是否自动订阅所有音频流
autoSubscribeVideo: false,//设置是否自动订阅所有视频流
@ -269,6 +270,7 @@ const agora = {
option.tokenA = data.tokenA;
option.channelId = data.channelId;
option.uid = Number(data.uid);
option.screenShareId = data.screenShareId;
await agora.joinChannel()
if (data.tokenA) {
await agora.allJoinChannelEx()