如何在Ios/Android中使用ReactNative将实时视频广播到YouTube频道? [英] How to broadcast a live video to YouTube channel using ReactNative in Ios/Android?

本文介绍了如何在Ios/Android中使用ReactNative将实时视频广播到YouTube频道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Is it possible to broadcast a live video to YouTube channel using ReactNative in Ios/Android?

推荐答案

尝试使用此库

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

这篇关于如何在Ios/Android中使用ReactNative将实时视频广播到YouTube频道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆