This commit is contained in:
parent
10e5312584
commit
92ffd98bbc
|
|
@ -17,7 +17,7 @@ const option: any = {
|
|||
token: '',
|
||||
channelId: '',
|
||||
userid: '',
|
||||
sourceType: VideoSourceType.VideoSourceCameraPrimary,
|
||||
sourceType: '',
|
||||
}
|
||||
let iMediaRecorder: any = '';
|
||||
let rtcEngine: any = '';
|
||||
|
|
@ -78,7 +78,8 @@ const agora = {
|
|||
setupLocalVideo: (item: any) => {
|
||||
rtcEngine.setupLocalVideo({
|
||||
renderMode: RenderModeType.RenderModeFit,
|
||||
sourceType: option.sourceType,
|
||||
sourceType: VideoSourceType.VideoSourceCameraPrimary,
|
||||
// sourceType: option.isCamera ? VideoSourceType.VideoSourceCameraPrimary : VideoSourceType.VideoSourceScreen,
|
||||
uid: item.account,
|
||||
view: item.view,
|
||||
setupMode: VideoViewSetupMode.VideoViewSetupAdd,
|
||||
|
|
@ -141,16 +142,6 @@ const agora = {
|
|||
},
|
||||
// 摄像头采集
|
||||
setCameraCapture: (sourceType: number) => {
|
||||
option.sourceType = sourceType
|
||||
// agora.stopScreenCapture()
|
||||
// if (sourceType !== option.sourceType) {
|
||||
// rtcEngine.destroyRendererByConfig(option.sourceType, option.channelId, option.account)
|
||||
// agora.setupLocalVideo({
|
||||
// account: Number(option.userid),
|
||||
// view: document.getElementById(`video-${option.userid}`),
|
||||
// channelId: option.channelId,
|
||||
// })
|
||||
// }
|
||||
rtcEngine.startCameraCapture(VideoSourceType.VideoSourceCamera, {})
|
||||
},
|
||||
// 加入频道
|
||||
|
|
@ -166,17 +157,9 @@ const agora = {
|
|||
},
|
||||
// 共享屏幕采集
|
||||
setDesktopCapturerVideo: (targetSource: any, sourceType: number) => {
|
||||
if (sourceType !== option.sourceType) {
|
||||
rtcEngine.stopCameraCapture(option.sourceType)
|
||||
rtcEngine.destroyRendererByConfig(option.sourceType, option.channelId, option.account)
|
||||
option.sourceType = sourceType
|
||||
agora.setupLocalVideo({
|
||||
account: Number(option.userid),
|
||||
view: document.getElementById(`video-${option.userid}`),
|
||||
channelId: option.channelId,
|
||||
})
|
||||
}
|
||||
// rtcEngine.stopCameraCapture(VideoSourceType.VideoSourceCamera);
|
||||
agora.stopScreenCapture();
|
||||
// rtcEngine.destroyRendererByConfig(VideoSourceType.VideoSourceCameraPrimary, option.channelId, option.account)
|
||||
if (
|
||||
targetSource.type ===
|
||||
ScreenCaptureSourceType.ScreencapturesourcetypeScreen
|
||||
|
|
|
|||
Loading…
Reference in New Issue