Not entering "onAddTrack" function
See original GitHub issueObserved Behavior
Connection is not able to reach to “onAddTrack”. this happens after i upgraded RN to 0.70.6 and the webrtc plugin to beta 7, same issue on beta 6. but this wasn’t happening on my code before the upgrade. also i’m not sure if its 100% plugin issue or in my code but i’m not able to know what can go wrong.
i did some logs here they are :
public WritableMap peerConnectionAddTrack(int id,
String trackId,
ReadableMap options) {
try {
return (WritableMap) ThreadUtils.submitToExecutor((Callable<Object>) () -> {
PeerConnectionObserver pco = mPeerConnectionObservers.get(id);
Log.d(TAG, "peerConnectionAddTrack() " + "A");
if (pco == null) {
Log.d(TAG, "peerConnectionAddTrack() peerConnection is null");
return null;
}
MediaStreamTrack track = getLocalTrack(trackId);
if (track == null) {
Log.w(TAG, "peerConnectionAddTrack() couldn't find track " + trackId);
return null;
}
Log.d(TAG, "peerConnectionAddTrack() " + "B");
List<String> streamIds = new ArrayList<>();
if (options.hasKey("streamIds")) {
ReadableArray rawStreamIds = options.getArray("streamIds");
if (rawStreamIds != null) {
for (int i = 0; i < rawStreamIds.size(); i++) {
Log.d(TAG, "peerConnectionAddTrack() " + i + rawStreamIds.getString(i));
streamIds.add(rawStreamIds.getString(i));
}
}
}
Log.d(TAG, "peerConnectionAddTrack() " + pco.getPeerConnection());
RtpSender sender = pco.getPeerConnection().addTrack(track, streamIds);
Log.d(TAG, "peerConnectionAddTrack() " + "C");
// Need to get the corresponding transceiver as well
RtpTransceiver transceiver = pco.getTransceiver(sender.id());
// We need the transceiver creation order to reorder the transceivers array
// in the JS layer.
WritableMap params = Arguments.createMap();
params.putInt("transceiverOrder", pco.getNextTransceiverId());
params.putMap("transceiver", SerializeUtils.serializeTransceiver(id, transceiver));
params.putMap("sender", SerializeUtils.serializeSender(id, sender));
Log.d(TAG, "peerConnectionAddTrack() " + "D");
return params;
}).get();
} catch (InterruptedException | ExecutionException e) {
Log.d(TAG, "peerConnectionAddTrack() " + e.getMessage());
return null;
}
}
Platform Information
- React Native Version: 0.70.6
- Plugin Version: beta-7
- OS: Android
- OS Version: 9/12/10
Issue Analytics
- State:
- Created 10 months ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
RTCPeerConnection.ontrack event not firing - Stack Overflow
ontrack event not firing whenever a new MediaStreamTrack object has been created (by the RTCPeerConnection.addTrack() function). Using the ...
Read more >MediaStream: addtrack event - Web APIs | MDN
The addtrack event is fired when a new MediaStreamTrack object has been added to a MediaStream . This event is not cancelable and...
Read more >Issues · react-native-webrtc/react-native-webrtc - GitHub
icefailed => try to create offer again, but not working ... Not entering "onAddTrack" function ... Remote stream is not visible on android...
Read more >872 - webrtc - Monorail
Issue 872: Implement Remote media stream events for MediaStreamTrackList:onaddtrack and onremovetrack ... Create a MediaStreamTrack object track ...
Read more >Media Capture and Streams - W3C
Firing a track event named e with a MediaStreamTrack track means that an event with the name e , which does not bubble...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure will do, thanks for your efforts
Beta 8 is out, can you give it another try?