Gilshaan Jabbar
Gilshaan Jabbar

Reputation: 11

Is YouTube live streaming possible with ReactNative?

It is possible to upload a Video to Youtube in React Native using using Youtube Data API.Is YouTube live streaming possible with ReactNative?

Upvotes: 0

Views: 5467

Answers (2)

Imanshu
Imanshu

Reputation: 83

react-native-live-stream is available,

Install :

npm install react-native-live-stream --save

Sample Code:

import {LivePlayer} from "react-native-live-stream";
<LivePlayer
    source={{ uri: 'rtmp://a.rtmp.youtube.com/live2/FOO-KEY' }} //enter your url here
    ref={(ref) => { this.player = ref }}
    style={livestyle.video}
    paused={false}
    muted={false}
    bufferTime={300}
    maxBufferTime={1000}
    resizeMode={"contain"}
    onLoading={() => { console.log('loading...') }}
    onLoad={() => { console.log('onLoad') }}
    onEnd={() => { }}
/>

Upvotes: 1

Emre Karataşoğlu
Emre Karataşoğlu

Reputation: 1719

Youtube has RTMP endpoint ( and backup endpoint ) like rtmp://a.rtmp.youtube.com/live2. For rtmp live stream publish, you need a tool ( library ) such as ffmpeg, gstreamer, rtmplib etc. Then you can easily call the library's method from reactnative or native or javascript. Only need to get stream key, then call the method with valid parameters.

Upvotes: 1

Related Questions