|
|
@@ -122,7 +122,11 @@ function getConstraints(um, options) {
|
|
122
|
122
|
setResolutionConstraints(constraints, options.resolution);
|
|
123
|
123
|
}
|
|
124
|
124
|
if (um.indexOf('audio') >= 0) {
|
|
125
|
|
- if (!RTCBrowserType.isFirefox()) {
|
|
|
125
|
+ if (RTCBrowserType.isReactNative()) {
|
|
|
126
|
+ // The react-native-webrtc project that we're currently using
|
|
|
127
|
+ // expects the audio constraint to be a boolean.
|
|
|
128
|
+ constraints.audio = true;
|
|
|
129
|
+ } else if (!RTCBrowserType.isFirefox()) {
|
|
126
|
130
|
// same behaviour as true
|
|
127
|
131
|
constraints.audio = { mandatory: {}, optional: []};
|
|
128
|
132
|
if (options.micDeviceId) {
|
|
|
@@ -640,7 +644,10 @@ var RTCUtils = {
|
|
640
|
644
|
};
|
|
641
|
645
|
RTCSessionDescription = mozRTCSessionDescription;
|
|
642
|
646
|
RTCIceCandidate = mozRTCIceCandidate;
|
|
643
|
|
- } else if (RTCBrowserType.isChrome() || RTCBrowserType.isOpera() || RTCBrowserType.isNWJS()) {
|
|
|
647
|
+ } else if (RTCBrowserType.isChrome() ||
|
|
|
648
|
+ RTCBrowserType.isOpera() ||
|
|
|
649
|
+ RTCBrowserType.isNWJS() ||
|
|
|
650
|
+ RTCBrowserType.isReactNative()) {
|
|
644
|
651
|
this.peerconnection = webkitRTCPeerConnection;
|
|
645
|
652
|
var getUserMedia = navigator.webkitGetUserMedia.bind(navigator);
|
|
646
|
653
|
if (navigator.mediaDevices) {
|