This commit is contained in:
yj 2024-08-30 10:32:54 +08:00
parent c28481e3ba
commit ed4106d6e0
3 changed files with 4 additions and 3 deletions

View File

@ -77,6 +77,7 @@ const UserVideo: React.FC = () => {
}; };
// 获取轮训用户 // 获取轮训用户
const getPolling = async (): Promise<void> => { const getPolling = async (): Promise<void> => {
setUserList([])
GetPolling(state.channelId?.split('1')[0] as string, from.viewPeopleValue).then((res: any) => { GetPolling(state.channelId?.split('1')[0] as string, from.viewPeopleValue).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
setUserList(res.data) setUserList(res.data)

View File

@ -571,7 +571,7 @@ const Meeting: React.FC = () => {
tokenA: state.tokenA, tokenA: state.tokenA,
}) })
if (userInfo.roleId === '1') { if (userInfo.roleId === '1') {
await agora.allJoinChannelEx() await agora.allJoinChannelEx(true)
} }
} }
// 状态更新 // 状态更新

View File

@ -236,13 +236,13 @@ export const agora = {
); );
}, },
// 所有用户加入的第二个房间 // 所有用户加入的第二个房间
allJoinChannelEx: async () => { allJoinChannelEx: async (bool: boolean = false) => {
await agora.startCameraCapture() await agora.startCameraCapture()
await rtcEngine.joinChannelEx( await rtcEngine.joinChannelEx(
option.tokenA, option.tokenA,
{ channelId: option.channelId + '1', localUid: Number('1' + option.screenShareId) }, { channelId: option.channelId + '1', localUid: Number('1' + option.screenShareId) },
{ {
clientRoleType: ClientRoleType.ClientRoleBroadcaster, //用户角色 ClientRoleBroadcaster 主播 ClientRoleAudience 观众 clientRoleType: bool ? ClientRoleType.ClientRoleAudience : ClientRoleType.ClientRoleBroadcaster , //用户角色 ClientRoleBroadcaster 主播 ClientRoleAudience 观众
autoSubscribeAudio: false,//设置是否自动订阅所有音频流 autoSubscribeAudio: false,//设置是否自动订阅所有音频流
autoSubscribeVideo: true,//设置是否自动订阅所有视频流 autoSubscribeVideo: true,//设置是否自动订阅所有视频流
publishMicrophoneTrack: false,//设置是否发布麦克风采集到的音频 publishMicrophoneTrack: false,//设置是否发布麦克风采集到的音频