Hi there, I already made an app with RTC using PeerJS, It works fine in web and in Android, but I cannot make it work on iOS. I am trying to use iosrtc plugin to use the navigator.mediaDevices.getUserMedia method but it does not work. It does not ask for permissions to use the camera or outputs the error. it simply does not execute navigator.mediaDevices.getUserMedia.
I installed the plugin and from what I undestand in the documentation it enables the use of WebRTC W3C JavaScript APIs directly.
Is there something else I have to do inside the app to make use of it?
getMedia() {
const constraints = {
video: true,
audio: true
};
const handleSuccess2 = (stream: MediaStream) => {
this.myStream = stream;
this.myEl.srcObject = stream;
};
const handleError2 = (error: any) => {
if (error.name === ‘ConstraintNotSatisfiedError’) {
const v = constraints.video;
// this.errorMsg(The resolution ${v.width.exact}x${v.height.exact} px is not supported by your device.
);
this.errorMsg(The resolution px is not supported by your device.
);
} else if (error.name === ‘PermissionDeniedError’) {
this.errorMsg('Permissions have not been granted to use your camera and ’ +
'microphone, you need to allow the page access to your devices in ’ +
‘order for the demo to work.’);
}
this.errorMsg(getUserMedia error3: ${error.name}
, error);
};
navigator.mediaDevices.getUserMedia(constraints).then(handleSuccess2).catch(handleError2);
}
1 post - 1 participant