Fix video dispose problem for multiple video stream
This commit is contained in:
Родитель
39e34af998
Коммит
84966cd42f
|
@ -529,12 +529,14 @@ export const createDefaultCommonCallingHandlers = memoizeOne(
|
|||
if (!participant || !participant.videoStreams) {
|
||||
return;
|
||||
}
|
||||
const screenShareStream = Object.values(participant.videoStreams).find(
|
||||
const screenShareStreams = Object.values(participant.videoStreams).filter(
|
||||
(i) => i.mediaStreamType === 'ScreenSharing'
|
||||
);
|
||||
|
||||
if (screenShareStream && screenShareStream.view) {
|
||||
callClient.disposeView(call.id, participant.identifier, screenShareStream);
|
||||
for (const stream of screenShareStreams) {
|
||||
if (stream.view) {
|
||||
callClient.disposeView(call.id, participant.identifier, stream);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@ const useVideoStreamLifecycleMaintainer = (
|
|||
if (!isScreenSharingOn) {
|
||||
onDisposeStreamView?.();
|
||||
}
|
||||
} else {
|
||||
console.warn('Stream view element does not exist when disposing stream view');
|
||||
}
|
||||
};
|
||||
}, [
|
||||
|
|
Загрузка…
Ссылка в новой задаче