Skip to content

A live video streaming app created with React Native and Mux

Notifications You must be signed in to change notification settings

blainerb4/React-Native-Mux-Stream

 
 

Repository files navigation

React-Native-Mux-Stream

A live video streaming app created with React Native and Mux.

Full tutorial is available at: http://pusher.com/tutorials/video-streaming-app-mux-react-native

Prerequisites

Getting Started

  1. Clone the repo:
git clone https://github.com/anchetaWern/React-Native-Mux-Stream.git
cd RNStream
  1. Install the app dependencies:
yarn
  1. Eject the project (re-creates the ios and android folders):
react-native eject
  1. Link the packages:
react-native link @react-native-community/async-storage
react-native link @react-native-community/netinfo
react-native link react-native-config
react-native link react-native-gesture-handler
react-native link react-native-nodemediaclient
react-native link react-native-permissions
react-native link react-native-video
  1. Put additional config on android/app/build.gradle file:
apply plugin: "com.android.application"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" // add this

And android/build.gradle file:

allprojects {
  repositories {
    mavenLocal()
    google()
    jcenter()
    maven {
      url "$rootDir/../node_modules/react-native/android"
    }

    // add this:
    maven {
      url 'https://jitpack.io'
    }
  }
}
  1. Add permissions to android/app/src/main/AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.rnstreamer">

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

  <!-- add the following -->
  <uses-feature android:name="android.hardware.camera"/>
  <uses-feature android:name="android.hardware.camera.autofocus"/>

  <uses-permission android:name="android.permission.CAMERA"/>
  <uses-permission android:name="android.permission.RECORD_AUDIO"/>
  <!-- end -->

  <application>
    ...
  </application>
</manifest>
  1. Update the .env file with your Mux and Channels app credentials, and the server/.env file with your Channels app credentials.

  2. Set up the server:

cd server
yarn
  1. Run the server:
yarn start
  1. Run ngrok:
./ngrok http 5000
  1. Update the src/screens/Index.js file with your ngrok HTTPS URL.

  2. Run the app:

react-native run-android
react-native run-ios

Built With

Donation

If this project helped you reduce time to develop, please consider buying me a cup of coffee :)

Buy Me A Coffee

About

A live video streaming app created with React Native and Mux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.9%
  • Java 11.4%
  • Shell 2.4%
  • Ruby 0.3%