Skip to content

Repository files navigation

react-native-mjpeg-player

  • Support only for android

Getting started

$ npm install react-native-mjpeg-player --save

Mostly automatic installation

$ react-native link react-native-mjpeg-player

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.segware.RNMjpegPlayerPackage; to the imports at the top of the file
  • Add new RNMjpegPlayerPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-mjpeg-player'
    project(':react-native-mjpeg-player').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mjpeg-player/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
     compile project(':react-native-mjpeg-player')
    

Usage

importReactfrom'react';importMjpegPlayerfrom'react-native-mjpeg-player';classMjpegPlayerComponentextendsReact.Component{render(){const{ url, width, height }=this.props;return(<MjpegPlayerref={ref=>{this.mjpegPlayer=ref;}}style={{width: `100%`,height: `100%`}}settings={{
url,
width,
height
}}/>);}}exportdefaultMjpegPlayerComponent;

Props

PropDescriptionTypeDefault
urlmjpeg url streamstringrequired
widthframe widthnumberrequired
heightframe heightnumberrequired

About

Mjpeg Player for React Native

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages