0.3.1 • Published 2 years ago
rn-exoplayer v0.3.1
Android React native ExoPlayer
An Android React native video player that uses ExoPlayer behind the scenes.
How to install
yarn add rn-exoplayer
or
npm install rn-exoplayer
locate the build.gradle ( Project ) file and add
ext {
kotlin_version = '1.7.0' <--- add this line
...
Locate your android sdk path by creating a local.properties file in the root folder of android folder and insert this line:
Windows OS
sdk.dir=C\:\\Users\\<username>\\AppData\\Local\\Android\\Sdk
MacOs
sdk.dir=/Users/<username>/Library/Android/sdk
Run your app
npx react-native run-android
Implementation
<RnExoplayerView
url={url}
isPlaying
style={{
width: 300,
height: 300,
}}
/>
Props
Prop name | type | description |
---|---|---|
url | string | The media url |
style | ViewStyle | style properties |
isPlaying | boolean | determines whether the video is playing or not |
repeat | boolean | determines if the video is in loop mode or not |
destroyOnPause | boolean | Suspend the player when the video is paused |
useNativeControls | boolean | Showing up native video controls |
muted | boolean | determines whether the video is muted or not |