react-native-twilio-video-webrtc icon indicating copy to clipboard operation
react-native-twilio-video-webrtc copied to clipboard

Extraneous DataTrack published by client

Open josefpohl opened this issue 5 years ago • 2 comments

Expected behaviour

Since no data tracks are, in theory, published from the RN client, no data tracks should be picked up on the JS/web side.

Actual behaviour

On the remote client a remoteParticipant data track is subscribed to which is never explicitly published on the react-native-twilio-video side. This has caused track.attach()/track.detach() errors.

There is a disconnect here in my mind since there is no data track events from react-native-twilio-video-webrtc side, that I can see. I don't listen for them (and hence have no code to show) But this publish/subscribe event does not occur on web to web connections. (twilio-video v2.5.1). This also does not occur in earlier (v 1.01?) versions of the react native side. (It was only when I updated on May 19, 2020 that I first noticed this issue. And that was against an older version of the JS client.)

So my question would be does anyone have any thoughts on where this data track is coming from. Is there a way for me to keep the RN client from publishing them, assuming they are actually being published from there? Here are a few logged snippets on the attach event. (some content redacted) Participant RemoteParticipant {audioTracks: Map(1), dataTracks: Map(1), …} audioTracks: Map(1) [[Entries]] 0: {"MT7dbd8d2114c800acb1971545e33fb43f" => RemoteAudioTrackPublication} size: (...) __proto__: Map dataTracks: Map(0) [[Entries]] No properties size: (...) ....

Track RemoteDataTrack {kind: "data", name: "f37dFcC2337A42c9bBe9afeF4847dcFF", isEnabled: true, maxPacketLifeTime: null, …} isEnabled: true isSwitchedOff: (...) kind: "data" maxPacketLifeTime: null maxRetransmits: null name: "f37dFcC2337A42c9bBe9afeF4847dcFF" ordered: true priority: (...) reliable: true sid: "MT81263dc3897d0f2819f8b039d2dc91ef" _events: {} ...

RoomActions.js:107 Uncaught (in promise) TypeError: track.attach is not a function at attachTrack (RoomActions.js:107) at RemoteDataTrackPublication.<anonymous> (RoomActions.js:61) at RemoteDataTrackPublication.emit (events.js:152) at RemoteDataTrackPublication._subscribed (remotetrackpublication.js:140) at RemoteParticipant._addTrack (remoteparticipant.js:84) at trackSignalingSubscribed (participant.js:372) at RemoteTrackPublicationV2.<anonymous> (participant.js:320) at RemoteTrackPublicationV2.emit (events.js:157) at RemoteTrackPublicationV2.setTrackTransceiver (track.js:125) at room.js:938

Thanks! Joe

Environment

  • Node.js version:
  • React Native version: 0.59.8
  • React Native platform + platform version: iOS 11.0

react-native-twilio-video-webrtc

Version: "master" (TwilioVideo ~> 3.2.3)

josefpohl avatar Jul 01 '20 17:07 josefpohl

Hi there, on further investigation, I noticed, even though I commented out the call to _startLocalVideo() in componentWillMount in TwilioVideo.ios.js that now I am getting the video stream as well. This was probably hidden by the error thrown by the issue referenced above. This issue was solved in the #253 (yes, I still have to issue the PR...sheepishly saying I am sorry...). So it looks like I am not doing something quite right. Again, I can capture (like I did the data tracks) and ignore them on the remote client but it now prompts once again for the Camera usage which my clients are probably a little unnerved by.

Any thoughts would be greatly appreciated. Thanks -- Joe

josefpohl avatar Jul 01 '20 22:07 josefpohl

Looks like a legit potential issue with the way we're creating the data track here: https://github.com/blackuy/react-native-twilio-video-webrtc/blob/master/ios/RCTTWVideoModule.m#L384

We are creating it at attaching it all the time. We might want to add an "enableData" field the same way we handle audio and video thanks to @Balasnest .

slycoder avatar Jul 03 '20 20:07 slycoder