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
0
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-video-player

A <VideoPlayer /> component for React Native with controls

  • 0.15.0-beta.2
  • Source
  • npm
  • Socket score

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

What do you need from the video UI controls library?

As we approach the end of 2024, we've started working on the roadmap for this project. This means it's not dead—it was just waiting for the perfect moment! Please share your enthusiasm and feedback here: https://github.com/TheWidlarzGroup/react-native-video-player/discussions/186

react-native-video-player

🎬 <VideoPlayer /> component for React Native with a few controls. This player uses react-native-video under the hood

demo video

Installation

yarn add react-native-video-player

or

npm install --save react-native-video-player

Then, install pods

cd ios
pod install

Example

  import VideoPlayer, { type VideoPlayerRef } from 'react-native-video-player';

  const playerRef = useRef<VideoPlayerRef>(null);

  <VideoPlayer
    ref={playerRef}
    endWithThumbnail
    thumbnail={{
      uri: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg',
    }}
    source={{
      uri: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
    }}
    onError={(e) => console.log(e)}
    showDuration={true}
  />

Documentation

PropDescription
sourceThe video source to pass to react-native-video.
thumbnailAn Image source to use as thumbnail before the video gets loaded.
endThumbnailAn Image source to use as thumbnail after the video has ended.
videoWidthWidth of the video to calculate the player size.
videoHeightHeight of the video to calculate the player size.
durationDuration should always be set out of the box. if not, you can use this prop
showDurationShow duration in seek bar.
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.
repeatLoop 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. If an endThumbnail image is not specified then the image specified in thumbnail is shown.
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

Ref 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

Check out our Roadmap for what's coming up next! We're always working on new features and improvements, so stay tuned!

Community support

We have an discord server where you can ask questions and get help. Join the discord server

Enterprise Support

📱 react-native-video-player is provided as it is. For enterprise support or other business inquiries, please contact us 🤝. We can help you with the integration, customization and maintenance. We are providing both free and commercial support for this project. let's build something awesome together! 🚀

Keywords

FAQs

Package last updated on 26 Nov 2024

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