I’ve followed the documentation and I’m calling a getLocalStream function in my componentDidMount().
However, inside that function mediaDevices.enumeratedDevices() and mediaDevices.getUserMedia() are not being called. My console.logs in either are not being called. I do know that getLocalStream is being called. As such my RTCView is just a white box as there’s no streamURL.
This shows console logs for the application one running on an emulated device - android/ios - and the other on a physical android device. The media stream is returned only in the simulated devices.
I can’t test the app on an iPhone device. It builds but when it opens it shows the react native screen then immediately closes. And I get an Xcode error saying failed to launch. No build or runtime errors in the logs though.
No errors show for the android device. My only thought is it’s quite an old phone from my university department so I’m going to go try it on a more modern android phone.
I tested it on my housemate’s Android phone running 8.0.0 and it has worked Its now finding the local stream and displaying properly in the RTCView, and my socket.io server is pinging correctly. Next step is learning how to connect peers.
One final question regarding iOS. I managed to get the app launching on my phone and it’s logging correctly that it’s getting the streaming etc. However when it tries to set the url it gets this error? doesn’t occur on the emulator, I assume due to the fact that it doesn’t access the camera only audio. My thought is that it’s to do with the constraints from looking at the repository and googling.