我尝试使用名为react-native-nodemediaclient的包让Live Stream工作在react native中,让它工作。
这里我们有我们的前置摄像头默认打开,我们可以切换摄像头视图。但是,我想让后置摄像头默认打开。
这是我使用的打开前置摄像头的相机设置。
videoSettings = {
preset: 12,
bitrate: 400000,
profile: 1,
fps: 15,
videoFrontMirror: false,
};
cameraSettings = {cameraId: 1, cameraFrontMirror: true};
我已经修改了相机Id和cameraFrontMirror选项,但它没有打开任何相机(既不是前面也不是后面)。
搜索谷歌,但没有得到任何工作。
请告诉我默认使用后置摄像头的设置。
提前感谢。
<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
/>