【问题标题】:How to broadcast a live video to YouTube channel using ReactNative in Ios/Android?如何在 Ios/Android 中使用 ReactNative 将实时视频广播到 YouTube 频道?
【发布时间】:2020-03-27 01:47:09
【问题描述】:

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

【问题讨论】:

    标签: react-native react-native-android react-native-ios react-native-firebase youtube-livestreaming-api


    【解决方案1】:

    尝试使用这个库

    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"
    />
    

    【讨论】:

      猜你喜欢
      • 2023-03-16
      • 1970-01-01
      • 2012-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-22
      • 2015-07-12
      • 1970-01-01
      相关资源
      最近更新 更多