先采集再加入频道

This commit is contained in:
yj 2024-07-17 11:31:34 +08:00
parent 136a3f023a
commit 05fb261275
2 changed files with 3 additions and 3 deletions

View File

@ -118,12 +118,12 @@ const Meeting: React.FC = () => {
if (isInit) {
let userInfo = JSON.parse(storage.getItem('user') as string)
agora.init()
agora.setCameraCapture(VideoSourceType.VideoSourceCameraPrimary)
agora.setJoinChannel({
channelId: state.channelId,
userid: userInfo.account,
token: state.token,
})
agora.setCameraCapture(VideoSourceType.VideoSourceCameraPrimary)
setCurrentVideoId(userInfo.account)
setUser(userInfo)
setIsInit(false)

View File

@ -153,8 +153,8 @@ const agora = {
rtcEngine.muteLocalVideoStream(mute)
},
// 摄像头采集
setCameraCapture: (sourceType: number) => {
rtcEngine.startCameraCapture(VideoSourceType.VideoSourceCamera, {})
setCameraCapture:async (sourceType: number) => {
await rtcEngine.startCameraCapture(VideoSourceType.VideoSourceCamera, {})
},
// 加入频道
setJoinChannel: (data: any) => {