如何在 Ios/Android 中使用 ReactNative 将直播视频广播到 YouTube 频道?



是否可以在 Ios/Android 中使用 ReactNative 将直播视频广播到 YouTube 频道?

尝试使用此库

https://www.npmjs.com/package/react-native-nodemediaclient https://github.com/NodeMedia/react-native-nodemediaclient

import {  NodeCameraView } from 'react-native-nodemediaclient';
......
<NodeCameraView 
style={{ height: 400 }}
ref={(vb) => { this.vb = vb }}
outputUrl = {"rtmp://192.168.0.10/live/stream"}//   out put to youTube 
camera={{ cameraId: 1, cameraFrontMirror: true }}
audio={{ bitrate: 32000, profile: 1, samplerate: 44100 }}
video={{ preset: 12, bitrate: 400000, profile: 1, fps: 15, videoFrontMirror: false }}
autopreview={true}
/>
<Button
onPress={() => {
if (this.state.isPublish) {
this.setState({ publishBtnTitle: 'Start Publish', isPublish: false });
this.vb.stop();
} else {
this.setState({ publishBtnTitle: 'Stop Publish', isPublish: true });
this.vb.start();
}
}}
title={this.state.publishBtnTitle}
color="#841584"
/>

最新更新