Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-advanced-video-player

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-advanced-video-player

TODO

  • 1.24.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native Advanced Video Player

Build Status

A video player for react native with advanced controls made for react native.

  • Swipe To Seek
  • Native Brightness & Volume Controls
  • Playing videos directly from a link or from a local path
  • Supports RTMP & HLS live streaming

Peer Dependencies

This packages depends on the below packages to function properly:

  • Orientation Locker - Uses to force the user include landscape/portrait mode
  • Safe aArea - Uses to calculate fullscreen dimensions for iOS with safe area insets
  • Home Indicator - Uses to hide iOS home indicator on newer gen iPhones

Installation

Install the dependencies at the root of your React Native project.

For React Native > 0.60
$ npm install --save react-native-advanced-video-player
For React Native < 0.59
$ npm install --save react-native-advanced-video-player
$ react-native link react-native-advanced-video-player

Additional Configurations

Android
MainApplication.java
import com.rn_advanced_video_player.AdvancedVideoPackage;

@Override
protected List<ReactPackage> getPackages() {
    List<ReactPackage> packages = new PackageList(this).getPackages();
    ...
    packages.add(new AdvancedVideoPackage());
    return packages;
}
iOS

Download the icons required for the iOS side to work from the link below:- https://drive.google.com/drive/folders/1MJgxymYo5_6rjimKgKXn5OIwSkckb0C3?usp=sharing

Paste the icons into your Project.xcworkspace/Images.xcassets directory

Basic Usage

import RNVideoPlayer from "react-native-advanced-video-player";

<RNVideoPlayer
    source={"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"}
    playerStyle={{
      width: 300,
      height: 450
    }}
/>

Props

PropertyTypeDefaultDescrption
sourcestringnullURL or path to video
playerStyleobject{}Styling for the player container
fullscreenbooleanfalseDetermines whether the button should show fullscreen or not at first
swipeToSeekbooleantrueWhen true, user can swipe on the container to seek the video. NOT AVAILABLE for RTMP stream
seekBarColorstring#ffffffCustom color for seekbar
showFullscreenControlsbooleantrueShows the fullscreen and back button
showLikeButtonbooleantrueShows the like button
showShareButtonbooleantrueShows the share button
showDownloadButtonbooleantrueShows the download button

Callbacks

PropertyDescrption
onFullscreenWhen the fullscreen button is pressed
onBackPressedWhen the back button is pressed
onLikePressedWhen the like button is pressed
onSharePressedWhen the share button is pressed
onDownloadPressedWhen the download button is pressed
onControlsShowWhen the controls overlay is shown
onControlsHideWhen the controls overlay is hidden
onEnterFullsceenWhen the video player enters fullscreen mode
onLeaveFullscreenWhen the video player leaves fullscreen mode

Methods

PropertyDescrption
pausePauses the videoplayer
playPlays the videoplayer
mutePlayerMutes the videoplayer
unmutePlayerUnmutes the videoplayer
showSystemHUDMethod to switch to showing native iOS volume bar HUD
killVideoPlayerKills video player instance, CALL to make sure video is stopped playing in background

Todos

  • Add more props to make it more configurable

License

MIT

Free Software, Hell Yeah!

Keywords

FAQs

Package last updated on 18 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc