muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
https://www.webrtc-experiment.com/RecordRTC/
MIT License
6.49k stars 1.75k forks source link

reset video stream audio issues #733

Open ravisarath opened 3 years ago

ravisarath commented 3 years ago

please update your resetvideostream audio issues in next version . on investigation i found that resetvideostream function in reocrdrtc not mix audios i uses the code below for update the audio


 function resetVideoStreams(streams) {
        videos = [];
        streams = streams || arrayOfMediaStreams;
        streams.forEach(stream => {
            if (stream.getTracks().filter(function (t) {
                return t.kind === 'video';
            }).length) {
                var video = getVideo(stream);
                video.stream = stream;
                videos.push(video);
            }

            if (stream.getTracks().filter(function (t) {
                return t.kind === 'audio';
            }).length && self.audioContext) {
                var audioSource = self.audioContext.createMediaStreamSource(stream);
                audioSource.connect(self.audioDestination);
                self.audioSources.push(audioSource);
            }
        });

    }

please fix these helps others thank you

ashwins93 commented 3 years ago

Thank you so much @ravisarath this was very helpful.