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

react-native-video-player

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-video-player

A video player for React Native with controls

  • 0.10.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48K
decreased by-2.08%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Video Player

A React Native video player with a few controls. This player uses react-native-video for the video playback.

demo gif

Installation

npm install --save react-native-video-player react-native-video react-native-vector-icons
react-native link react-native-video
react-native link react-native-vector-icons

Props

PropDescription
videoThe video source to pass to react-native-video.
thumbnailAn Image source to use as thumbnail before the video gets loaded.
videoWidthWidth of the video to calculate the player size.
videoHeightHeight of the video to calculate the player size.
durationDuration can not always be figured out (e.g. when using hls), this can be used as fallback.
autoplayStart the video automatically.
defaultMutedStart the video muted, but allow toggling.
mutedStart the video muted and hide the mute toggle button.
controlsTimeoutTimeout when to hide the controls.
disableControlsAutoHideDisable auto hiding the controls.
disableFullscreenDisable the fullscreen button.
loopLoop the video after playback is done.
resizeModeThe video's resizeMode. defaults to contain and is passed to react-native-video.
hideControlsOnStartHides the controls on start video.
endWithThumbnailReturns to the thumbnail after the video ends.
disableSeekDisable video seeking.
pauseOnPressAutomatically pause/play when pressing the video player anywhere.
fullScreenOnLongPressAutomatically show video on fullscreen when doing a long press.
onStartCallback for when the start button is pressed.
onPlayPressCallback for when the play button is pressed.
onHideControlsCallback for when the controls are being hide.
onShowControlsCallback for when the controls are being shown.
customStylesThe player can be customized in this object, see customStyles for the options.

All other props are passed to the react-native-video component.

customStyles

  • wrapper
  • video
  • controls
  • playControl
  • controlButton
  • controlIcon
  • playIcon
  • seekBar
  • seekBarFullWidth
  • seekBarProgress
  • seekBarKnob
  • seekBarBackground
  • thumbnail
  • playButton
  • playArrow
  • videoWrapper

Methods

MethodPropsDescription
seektime: floatSeek the player to the given time.
stopStop the playback and reset back to 0:00.
pausePause the playback.
resumeResume the playback.

Future features

  • Make seek bar seekable.
  • Make player customizable.
  • Add volume control
  • Add fullscreen button
    • Add fullscreen button for Android (See PR #38 if you need fullscreen in Android)
  • Add loader
  • Add video duration/play time

Keywords

FAQs

Package last updated on 07 Nov 2018

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