How to use the react-native-webrtc.mediaDevices.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 baconcheese113 / react-native-webrtc-minimal / src / App.js View on Github external
const facing = isFront ? 'front' : 'back';
    const videoSourceId = devices.find(device => device.kind === 'videoinput' && device.facing === facing);
    const facingMode = isFront ? 'user' : 'environment';
    const constraints = {
      audio: true,
      video: {
        mandatory: {
          minWidth: 500, // Provide your own width, height and frame rate here
          minHeight: 300,
          minFrameRate: 30,
        },
        facingMode,
        optional: videoSourceId ? [{sourceId: videoSourceId}] : [],
      },
    };
    const newStream = await mediaDevices.getUserMedia(constraints);
    setLocalStream(newStream);
  };
github signalwire / signalwire-node / packages / common / src / util / webrtc / index.native.ts View on Github external
const _getUserMedia = (constraints: MediaStreamConstraints) => mediaDevices.getUserMedia(constraints)