共享屏幕在未观看时不接流
This commit is contained in:
parent
0702536b3c
commit
96d17e21a0
|
|
@ -260,6 +260,19 @@ const Meeting: React.FC = () => {
|
||||||
});
|
});
|
||||||
}, [currentVideoId, roomUserList]);
|
}, [currentVideoId, roomUserList]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let item = roomUserList.find((item: any) => currentVideoId == item.uid)
|
||||||
|
if (item) {
|
||||||
|
if (isShare) {
|
||||||
|
if (Number(item.screenShareId) === Number(isShare)) {
|
||||||
|
agora.muteRemoteAudioStream(Number(isShare), false)
|
||||||
|
} else {
|
||||||
|
agora.muteRemoteAudioStream(Number(isShare), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [currentVideoId, isShare]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onSignalr(async (item: any) => {
|
onSignalr(async (item: any) => {
|
||||||
const setting = JSON.parse(storage.getItem('setting') as string)
|
const setting = JSON.parse(storage.getItem('setting') as string)
|
||||||
|
|
@ -1082,7 +1095,8 @@ const Meeting: React.FC = () => {
|
||||||
// 获取桌面可共享屏幕的引用
|
// 获取桌面可共享屏幕的引用
|
||||||
const getDesktopCapturerVideo = (): void => {
|
const getDesktopCapturerVideo = (): void => {
|
||||||
agora.getDesktopCapturerVideo({ width: 300, height: 300 }, { width: 300, height: 300 }, true).then((res: any) => {
|
agora.getDesktopCapturerVideo({ width: 300, height: 300 }, { width: 300, height: 300 }, true).then((res: any) => {
|
||||||
res.forEach((item: any) => {
|
res.forEach((item: any, index: number) => {
|
||||||
|
item.sourceTitle = '桌面' + (index + 1)
|
||||||
if (item.thumbImage.buffer) {
|
if (item.thumbImage.buffer) {
|
||||||
item.thumbnailUrl = thumbImageBufferToBase64(item.thumbImage)
|
item.thumbnailUrl = thumbImageBufferToBase64(item.thumbImage)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -291,8 +291,13 @@ export const agora = {
|
||||||
await agora.stopCameraCapture();
|
await agora.stopCameraCapture();
|
||||||
await rtcEngine.leaveChannelEx({ channelId: option.channelId + 'a', localUid: Number('1' + option.screenShareId) })
|
await rtcEngine.leaveChannelEx({ channelId: option.channelId + 'a', localUid: Number('1' + option.screenShareId) })
|
||||||
},
|
},
|
||||||
|
// 取消或恢复订阅指定远端用户的音频流
|
||||||
|
muteRemoteAudioStream: async (uid: number, mute: boolean) => {
|
||||||
|
rtcEngine.muteRemoteAudioStream(uid, mute)
|
||||||
|
},
|
||||||
|
// 销毁视频渲染dom
|
||||||
destroyRendererByConfig: async (uid: number) => {
|
destroyRendererByConfig: async (uid: number) => {
|
||||||
rtcEngine.destroyRendererByConfig(VideoSourceType.VideoSourceRemote, option.channelId + 'a', uid);
|
await rtcEngine.destroyRendererByConfig(VideoSourceType.VideoSourceRemote, option.channelId + 'a', uid);
|
||||||
},
|
},
|
||||||
// ai降噪
|
// ai降噪
|
||||||
setAINSMode: async (enabled: boolean, mode: AudioAinsMode) => {
|
setAINSMode: async (enabled: boolean, mode: AudioAinsMode) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue