I am using TwilioVideo for video calling in a webapp. I am trying to record remoteParticipant audio and video and store it in a local drive.
Here is a link to my sample app, you can open two browser windows with the same url & provide two different userNames, but same roomName and connect.
After the video call is established through Twilio API between local and remote participants, I tried obtaining the remoteMediaStreams using the below method but I get undefined. Can someone please advise how I can obtain remoteParticiant stream (audio + video).
window.RTCPeerConnection.getRemoteStreams -> undefined
Twilio developer evangelist here.
The
RTCPeerConnectionclass doesn't have agetRemoteStreamsfunction, which is why that isundefined.Instances of
RTCPeerConnectionmay have agetRemoteStreamsfunction, but in this application you do not have direct access to the instance of theRTCPeerConnectionobject being used by the Twilio Video SDK, so you can't call on it. Also,getRemoteStreamsis also non-standard and deprecated in favour ofgetReceivers.It looks like you are using this Twilio Video example application. To get hold of the remote streams you will need to hook into the room's participants and their audio and video tracks. I recommend you take a look through the various components and hooks in the application to understand how to access the media streams for each of the participants.