2

I am trying to pass Datatracks in twilio in react application. In web application while connecting to room we pass local video , audio and datatracks but I am not getting how to pass the same datatracks in react-native application. I am using react-native-twilio-webrtc package to generate Twilio Videotracks and connect in group rooms but not getting how to pass datatracks using this pakage and how to get remoteparticipant datatracks. I am new to react-native so if anyone can help me with this it will be very helpfull. Thank you

Vipul
  • 21
  • 1

1 Answers1

2

It appears that a DataTrack is automatically created for you by the React Native client, but it doesn't expose the track or ways to create it yourself.

You can send messages on the local DataTrack by calling on the sendString method on the TwilioVideo component. You can also handle remote DataTracks by passing functions for the properties onParticipantAddedDataTrack, onParticipantRemovedDataTrack, and onDataTrackMessageReceived.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Thanks @philnash for the answer. I am able to pass data from web to react-native client now but can you please suggest me how can I listen for event at web side when send datatracks using sendString method from react-native client. I am able to receive datatracks from web to mobile side but I am not able to receive datatracks from mobile to web side. – Vipul Aug 17 '22 at 07:16
  • Now I am able to pass datatracks from both side. Thank you so much for your help. I really appreciate it. Thank you – Vipul Aug 17 '22 at 07:21
  • That is great news. If this answer helped, please do mark it as correct so that others can see it was helpful too. Thanks! – philnash Aug 17 '22 at 07:29
  • Hi philnash, hope you are doing good. I am trying to add screen share feature in my react native ios application. So I need to pass screen media tracks to my web application. I am getting the media tracks using react-native-webrtc but not able to publish it. Can you please help me know how can I publish localtracks in react-native-twilio-video-webrtc. Thank you – Vipul Sep 05 '22 at 14:13
  • Hi @Vipul, best thing for you to do would be to ask a new question with the code showing what you are trying and what is going wrong. – philnash Sep 05 '22 at 23:11
  • Sure will do that, thanks – Vipul Sep 06 '22 at 04:26