android - 在 NodeCameraView React Native 中默认设置后置摄像头
问题描述
我试图在 react native 中使用名为react-native-nodemediaclient的包来让 Live Stream 工作并让它工作。
在这里,我们默认打开前置摄像头,我们可以切换摄像头视图。但是,我希望默认打开后置摄像头。
这是我使用的打开前置摄像头的摄像头设置。
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
/>
推荐阅读
- python - 如何从列表中的字典中获取键值对的值,其中键以非常特定的字母开头
- parsing - 将 Azure 门户中的 aspnet 设置解析为 Json 格式
- php - 通过键合并两个数组并将值从一个数组附加到另一个数组
- php - 只有登录用户才能编辑表单
- python - Python 属性错误;;
- xamarin - Xamarin 表单上的拨号盘
- angular - 如何使用 ViewChild 获取 HTML 元素?
- python-3.x - “找不到包初始化文件(或不是常规文件)” - 为命名空间包构建 sdist 时出错
- docker - 在 JetBrains Rider 中调试从 docker compose 运行的 .Net Core 3 应用程序
- sql-server - 使用 pyodbc 和 sqlalchemy 连接到 SQL 服务器,不能使用“use database_name;”