Catalog npm
PACKAGE EXPLORERView in registry

42-react-native-reanimated-player

npm

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

androidcontroliosreact-nativereact-native-gesture-handlereact-native-reanimtedscrubberslidervideo
Versions collected5
Direct dependencies31From release 2.2.5
Last observed20 Oct, 19:59 UTC

README

Current package documentation
`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.

▶️ 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@2

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 show❌false
onEnterFullscreenfunctionon enter fullscreen callback❌undefined
onExitFullscreenfunctionon exit fullscreen callback❌undefined
controlTimeoutnubmerHow long to hide the control view after showing❌2000
videoDefaultHeightnumbervideo default height❌screenWidth * (9 / 16)
headerBarTitlestringheader bar title on fullscreen mode❌undefined
onTapBackfunctiontap header bar Icon-'Back' callback❌undefined
navigationanynavigation❌undefined
autoPlaybooleanauto play❌false
onToggleAutoPlayfunctionon toggle auto play❌undefined
onTapMorefunctiontap headerbar Icon-'More' callback❌undefined
doubleTapIntervalnumberdouble tap interval❌undefined
pausedbooleanvideo paused✅undefined
onPausedChangebooleanon change video paused❌undefined
onTapPausefunctionon tap video paused❌undefined
sliderPropsobjectreact-native-awesome-slider props❌undefined
videoHeightAnimated.SharedValuevideo height✅ width * (9 / 16);
customAnimationStyleAnimated Viewstylevideo height❌width * (9 / 16);
onCustomPanGesturePanGesturecustom pan gesture❌width * (9 / 16);
isFullScreenAnimated ShareValuefullScreen status✅undefined
disableControlbooleancontrol view status❌undefined
renderBackIconJSXcustom back icon❌undefined
renderFullScreenBackIconJSXcustom full's fullscreen icon❌undefined
renderMoreJSXcustom more icon❌undefined
renderFullScreenJSXcustom fullscreen icon❌undefined

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 5

Collected releases
VersionPublishedDirect dependenciesOpen version
2.2.5Registry latest16 Jan 202331
2.2.425 Nov 202231
2.2.325 Nov 202231
2.2.224 Nov 202231
2.2.122 Nov 202231

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
xz870603611/42-react-native-reanimated-player

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:59 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:9568cd9df2c70efaac45ac54f1b1963c7ac3236e376efe762918fe3808dac026