简体   繁体   中英

Setting Back camera by default in NodeCameraView React Native

I tried to get the Live Stream to work using package named react-native-nodemediaclient in react native and got it to work.

Here We have our Front camera to open by default and we can able to switch the camera view. But, I want Back camera to be opened by default.

Here's the camera setting I used which opens front camera.

videoSettings = {
  preset: 12,
  bitrate: 400000,
  profile: 1,
  fps: 15,
  videoFrontMirror: false,
};

cameraSettings = {cameraId: 1, cameraFrontMirror: true};

I have modified the camera Id and cameraFrontMirror option but it didn't opened any camera (neither front nor back).

Searched google but didn't get anything to work.

Kindly let me know the settings to use back camera by default.

Thanks in advance.

<NodeCameraView 
  style={{ width: WIDTH, height: HEIGHT }}

  ref={(vb) => {
        setVbRef(vb);
            }}

 outputUrl={rtmpUrl}

 camera={{ 
   cameraId: 0, 
   cameraFrontMirror: false 
}}

audio={{
  bitrate: 32000,
  profile: 1, 
  samplerate: 44100 
}}

video={{
  preset: 12,
  bitrate: 400000,
  profile: 1,
  fps: 30,
  videoFrontMirror: false,
}}
 autopreview
    />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM