From e71a8bfc12a91460bc4bdf5b10d89c1a170efc80 Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Mon, 23 Oct 2023 17:36:03 +0900 Subject: [PATCH] =?UTF-8?q?Sora=20=E3=81=AE=E5=88=87=E6=96=AD=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=82=20Track=20=E3=81=AE=E8=A7=A3=E6=94=BE?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=81=AF=E3=83=87=E3=83=90=E3=82=A4=E3=82=B9?= =?UTF-8?q?=E7=84=A1=E5=8A=B9=E5=8C=96=E6=99=82=E3=81=A8=E5=90=8C=E3=81=98?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=82=92=E5=91=BC=E3=81=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/actions.ts | 64 ++++------------------------------------------ 1 file changed, 5 insertions(+), 59 deletions(-) diff --git a/src/app/actions.ts b/src/app/actions.ts index 387495f2..695526c0 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -872,65 +872,11 @@ function setSoraCallbacks( createSoraDevtoolsTimelineMessage('event-on-disconnect', message), ), ); - const { - fakeContents, - soraContents, - reconnect, - lightAdjustmentProcessor, - noiseSuppressionProcessor, - virtualBackgroundProcessor, - } = getState(); - const { localMediaStream, remoteMediaStreams } = soraContents; - let originalTrack; - if (lightAdjustmentProcessor && lightAdjustmentProcessor.isProcessing()) { - originalTrack = lightAdjustmentProcessor.getOriginalTrack(); - lightAdjustmentProcessor.stopProcessing(); - } - if (virtualBackgroundProcessor && virtualBackgroundProcessor.isProcessing()) { - if (originalTrack === undefined) { - originalTrack = virtualBackgroundProcessor.getOriginalTrack(); - } - virtualBackgroundProcessor.stopProcessing(); - } - if (originalTrack !== undefined) { - originalTrack.stop(); - dispatch( - slice.actions.setTimelineMessage( - createSoraDevtoolsMediaStreamTrackLog('stop', originalTrack), - ), - ); - } else { - if (localMediaStream) { - localMediaStream.getVideoTracks().forEach((track) => { - track.stop(); - dispatch( - slice.actions.setTimelineMessage(createSoraDevtoolsMediaStreamTrackLog('stop', track)), - ); - }); - } - } - - if (noiseSuppressionProcessor && noiseSuppressionProcessor.isProcessing()) { - const originalTrack = noiseSuppressionProcessor.getOriginalTrack(); - if (originalTrack) { - originalTrack.stop(); - dispatch( - slice.actions.setTimelineMessage( - createSoraDevtoolsMediaStreamTrackLog('stop', originalTrack), - ), - ); - } - noiseSuppressionProcessor.stopProcessing(); - } else { - if (localMediaStream) { - localMediaStream.getAudioTracks().forEach((track) => { - track.stop(); - dispatch( - slice.actions.setTimelineMessage(createSoraDevtoolsMediaStreamTrackLog('stop', track)), - ); - }); - } - } + // ローカルの MediaStream の Track と MediaProcessor を止める + stopLocalVideoTrack(dispatch, getState()); + stopLocalAudioTrack(dispatch, getState()); + const { fakeContents, soraContents, reconnect } = getState(); + const { remoteMediaStreams } = soraContents; remoteMediaStreams.forEach((mediaStream) => { mediaStream.getTracks().forEach((track) => { track.stop();