How to use the react-native-webrtc.getUserMedia function in react-native-webrtc

To help you get started, we’ve selected a few react-native-webrtc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WorldViews / JanusMobile / app / lib / JanusClient.js View on Github external
//     videoSourceId = sourceInfo.id;
          //     }
          // }
          let constraints = {
              audio: true,
              video: {
                mandatory: {
                    minWidth: 1280, // Provide your own width, height and frame rate here
                    minHeight: 720,
                    minFrameRate: 30
              },
              facingMode: (isFront ? "user" : "environment"),
              optional: (videoSourceId ? [{ sourceId: videoSourceId }] : [])
              }
          };
          getUserMedia(constraints, function (stream) {
              self.state.localStream = stream;
              self.initJanus(self.state.url, cb);
          }, console.log);
        });
    }
github DimitrisTzimikas / RCTWebRTCDemo2 / src / App.js View on Github external
minFrameRate: 30,
      },
      facingMode: isFront ? 'user' : 'environment',
    },
  };
  let getStream = stream => {
    localStream = stream;
    
    appClass.setState({
      streamURL: stream.toURL(),
      status: 'ready',
      info: 'Welcome to WebRTC demo',
    });
  };
  
  getUserMedia(constrains, getStream, logError);
};