Socket
Socket
Sign inDemoInstall

react-native-reanimated-player

Package Overview
Dependencies
783
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-reanimated-player

A react-native video player that interacts like Youtube player, built upon Reanimted v2 & react-native-gesture-handle


Version published
Weekly downloads
19
increased by11.76%
Maintainers
1
Created
Weekly downloads
 

Readme

Source
`JSThread` to `JSThread`, `UIThread` to `UIThread`.

React Native Reanimated Player

Reanimated v2 version npm npm runs with expo

100% written in Typescript video player component, interaction is like Youtube player.

Basic
YouTube Player(advanced)
basic usageCustom usage
▶️ Watch example video

⚠️ Expo

This is the react-native-video version, If you use Expo, please check out expo-reanimated-av-player!

Installation

First you have to follow installation instructions of:

If react-native-gesture-handler version >= 2:

yarn add react-native-reanimated-player

else use v1:

yarn add react-native-reanimated-player@1

Example usage

import VideoPlayer from 'react-native-reanimated-player';
import { useSharedValue } from 'react-native-reanimated';
export const Example = () => {
  const videoHeight = useSharedValue(0);
  const isFullScreen = useSharedValue(false);
  const { paused, setPaused } = useContext(false);

  return (
    <VideoPlayer
      source={uri}
      headerTitle={'Title in full screen mode'}
      onTapBack={() => {
        Alert.alert('onTapBack');
      }}
      onTapMore={() => {
        Alert.alert('onTapMore');
      }}
      onPausedChange={state => {
        Alert.alert(`onPausedChange: ${state}`);
        setPaused(state);
      }}
      videoHeight={videoHeight}
      paused={paused}
      isFullScreen={isFullScreen}
    />
  );
};

Features

  • 100% written in TypeScript.
  • 100% built upon react-native-reanimated and react-native-gusture-handler.
  • Support gestures switch full screen.
  • Support double tap seek to back or ahead.
  • ...

TODO list

  • Add more custom props
  • Add Previous & Next button
  • Rewrite the gesture section with react-native-gusture-handle V2
  • Add expo-av support
  • ...and more

Configuration

The <VideoPlayer/> component has the following configuration properties:

NameTypeDescriptionRequiredDefault Value
themeobjectThe slider theme color { // Color to fill the progress in the seekbar minimumTrackTintColor: string, // Color to fill the background in the seekbar maximumTrackTintColor: string, // Color to fill the cache in the seekbar cacheTrackTintColor: string, // Color to fill the bubble backgroundColor disableMinTrackTintColor: string, // Disabled color to fill the progress in the seekbar bubbleBackgroundColor: string }
showOnStartbooleancontrol view init showfalse
onEnterFullscreenfunctionon enter fullscreen callbackundefined
onExitFullscreenfunctionon exit fullscreen callbackundefined
controlTimeoutnubmerHow long to hide the control view after showing2000
videoDefaultHeightnumbervideo default heightscreenWidth * (9 / 16)
headerBarTitlestringheader bar title on fullscreen modeundefined
onTapBackfunctiontap header bar Icon-'Back' callbackundefined
navigationanynavigationundefined
autoPlaybooleanauto playfalse
onToggleAutoPlayfunctionon toggle auto playundefined
onTapMorefunctiontap headerbar Icon-'More' callbackundefined
doubleTapIntervalnumberdouble tap intervalundefined
pausedbooleanvideo pausedundefined
onPausedChangebooleanon change video pausedundefined
onTapPausefunctionon tap video pausedundefined
sliderPropsobjectreact-native-awesome-slider propsundefined
videoHeightAnimated.SharedValuevideo height width * (9 / 16);
customAnimationStyleAnimated Viewstylevideo heightwidth * (9 / 16);
onCustomPanGesturePanGesturecustom pan gesturewidth * (9 / 16);
isFullScreenAnimated ShareValuefullScreen statusundefined
disableControlbooleancontrol view statusundefined
renderBackIconJSXcustom back iconundefined
renderFullScreenBackIconJSXcustom full's fullscreen iconundefined
renderMoreJSXcustom more iconundefined
renderFullScreenJSXcustom fullscreen iconundefined
childrenJSXchild components to be rendered under video player controlsundefined
onPostProgressfunctioncallback function that is called every progressUpdateInterval milliseconds with info about which position the media is currently playingundefined
onPostSeekfunctioncallback function that is called when a seek completesundefined

Keywords

FAQs

Last updated on 19 Aug 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc