Opens Camera but streaming doesn't start on IOS and Camera doesn't open on Android

Hi all,
I am implementing Live streaming with following details,
React-Native: 0.55.4

Android:
buildToolsVersion : 27.0.3

IOS:
Deployment Target: 9

Problem:

  1. In Android, when i perform action to open camera, nothing happens.(Tried on Android 6 and 8)
  2. In IOS, when i perform action to open camera, camera is opened but Streaming doesn’t start.

I have followed every configuration steps mentioned in the document. Below is my code:

selectCamera(){
const configuration = { “iceServers”: [{ “url”: “rtmp://live.mux.com/app/XXXXXXX” }] };
const pc = new RTCPeerConnection(configuration);
const { isFront } = this.state;
mediaDevices.enumerateDevices().then(sourceInfos => {
console.log(‘MediaStreamTrack.getSources’, sourceInfos);
let videoSourceId;
for (let i = 0; i < sourceInfos.length; i++) {
const sourceInfo = sourceInfos[i];
if (sourceInfo.kind === ‘video’ && sourceInfo.facing === (isFront ? ‘front’ : ‘back’)) {
videoSourceId = sourceInfo.id;
}
}
mediaDevices.getUserMedia({
audio: true,
// THIS IS FOR SIMULATOR ONLY
// In fact, you better test on real iOS/Android device
// We just can test audio on simulator, so i set video = false
// video: Platform.OS === ‘ios’ ? false : {
video: {
mandatory: {
minWidth: 500, // Provide your own width, height and frame rate here
minHeight: 300,
minFrameRate: 30
},
facingMode: (isFront ? ‘user’ : ‘environment’),
optional: (videoSourceId ? [{ sourceId: videoSourceId }] : )
}
}, (stream) => {
console.log(‘Streaming OK’, stream);
this.setState({
videoURL: stream.toURL()
});
pc.addStream(stream);
}, error => {
console.log(‘Oops, we getting error’, error.message);
throw error;
});
});
}