Reputation: 11
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
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
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