0

How to display the video/audio of already joined members to newly joined member of the room. Following is my code but when i am trying to access the track property it is returning null.

room.participants.forEach(participant => {
                    console.log(`Participant "${participant.identity}" is connected to the Room`);
                    participant.tracks.forEach(publication => {
                        console.log(publication.track);
                    });

                });

Getting Uncaught (in promise) TypeError: track.attach is not a function. When a new user joined the room, the existing members of the room are able to see the video of the newly joined member. But the newly joined member is not able to see the video of existing members.

harish durga
  • 494
  • 4
  • 12

1 Answers1

0

In the 2.x version there were some changes to how track will be accessed and attached. The above code will work with the 1.x version of the twilio js sdk. You can follow the following example to display the remote participants tracks. https://github.com/twilio/video-quickstart-js/blob/865fb51e9d363e6c6ee6406c7df28e2582888f9f/quickstart/src/index.js

harish durga
  • 494
  • 4
  • 12