React Native bindings for RTMP broadcasting
$ npm install react-native-broadcast --save
$ react-native link react-native-broadcast
iOS: Add Privacy - Camera Usage Description
and Privacy - Microphone Usage Description
to your project's Info.plist
Android: Add the following permissions to your Android Manifest
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-broadcast
and add RNBroadcast.xcodeproj
libRNBroadcast.a
to your project's Build Phases
➜ Link Binary With Libraries
Cmd+R
)<libz
& libstdc++
into final projectandroid/app/src/main/java/[...]/MainActivity.java
import com.reactlibrary.RNBroadcastPackage;
to the imports at the top of the filenew RNBroadcastPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-broadcast'
project(':react-native-broadcast').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-broadcast/android')
android/app/build.gradle
:
compile project(':react-native-broadcast')
import BroadcastView from 'react-native-broadcast';
<BroadcastView
publish='rtmp://a.rtmp.youtube.com/live2/...'
cameraPosition='front'
/>