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

react-native-nexen-player

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-nexen-player

next gen video player for react native

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-71.11%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-nexen-player

A next gen video player for react native app based on react-native-video. It provides advanced media control functionality.

Preview

@

Installation

npm install --save react-native-nexen-player

or

yarn add react-native-nexen-player

Dependencies

yarn add react-native-video react-native-svg

Usage

import NexenPlayer, { NexenPlayerRef } from 'react-native-nexen-player';

// ...

const [paused, setPaused] = React.useState(true);
const playerRef = React.useRef < NexenPlayerRef > null;

const onPausePress = () => {
  if (paused) {
    playerRef.current?.play();
  } else {
    playerRef?.current?.pause();
  }
  setPaused((prevState) => !prevState);
};

<NexenPlayer
  ref={playerRef}
  style={styles.player}
  source={{
    source: require('../assets/videos/Street_Fighter_V_Stop_Motion.mp4'),
    poster: 'https://img.youtube.com/vi/KrmxD8didgQ/0.jpg',
    title: "Ryu's Hurricane Kick and Hadoken",
  }}
/>;

// ...

Component props

proptypedefaultdescription
sourceNexenPlayer NexenSource object{}media source.
configNexenPlayer NexenConfig object{}vidoe player config.
playListobject{}can set video playlist for the player.
insetsobject{}edge insets for video controls. you can set insets from react-native-safe-area-context.
styleobject{}style for video player.
themeobject{}set theme for video player.

NexenSource

proptypedefaultdescription
sourceSource{}media source.
titlestringundefinedvideo title.
posterstringundefinedposter url.
textTracksTextTrack[]undefinedtext tracks (cations or subtitle) for the video.
selectedTextTrackSelectedTextTrackundefinedtext trak that will be shown for the video.
selectedAudioTrackSelectedAudioTrackundefinedaudio track that will be selected for the video.

NexenConfig

proptypedefaultdescription
loaderTextstring'Loading...'text for loader.
errorTextstring'Error...!'text for error message.
doubleTapTimenumber300msduration of double tap.
controlTimeoutnumber500msmain control will hide after this amount of time when controlHideMode set to 'auto'.
controlHideModestring'touch'hide options for main control - 'touch' or 'auto'.
layoutModestirng'basic'options for main control layout - 'basic', 'intermediate' or 'advanced'.
resizeModeResizeMode object'contain'video resize options.
posterResizeModeResizeMode object'cover'poster resize options.
volumenumber80volume of the video (0-100).
brightnessnumber25brightness of the video (0-100).
playbackSpeedPlaybackSpeed objecj'1.0'video playback speed.
mutedbooleanfalsemute video.
repeatbooleanfalserepeat video.
autoPlaybooleanfalseshould autoplay the video.
disableOnScreenPlayButtonbooleanfalsea large play button that appears on screen when video is paused.
disableBackbooleanfalsehide back button.
disableResizeModebooleanfalsehide aspect ration button.
disableVolumebooleanfalsehide volume button.
disableMorebooleanfalsehide more button.
disableSkipbooleanfalsehide skip buttons.
disableStopbooleanfalsehide stop button.
disableFullscreenbooleanfalsehide fullscreen button.
disablePlayListbooleanfalsehide video playlist button.
indexnumber0flatlist index (only for FlatList)
activeIndexnumber-1flatlist current video index (only for FlatList)
optimizebooleanfalsewheather you need flatlist optimization or not (only for FlatList)

Enevt props

proptypedefaultdescription
onBackPressedfuncundefinedcallback for back button.
onPlayfuncundefinedcallback for play button.
onPausefuncundefinedcallback for pause button.
onStopfuncundefinedcallback for stop button.
onSkipNextfuncundefinedcallback for skipNext event.
onSkipBackfuncundefinedcallback for skipBack event.
onReloadfuncundefinedcallback for reload event.
onVolumeUpdatefuncundefinedcallback for volume update event.
onBrightnessUpdatefuncundefinedcallback for brightness update event.
onMuteUpdatefuncundefinedcallback for mute button.
onRepeatUpdatefuncundefinedcallback for loop button.
onSpeedUpdatefuncundefinedcallback for playback speed update event.
onFullScreenModeUpdatefuncundefinedcallback for fullscreen mode update event.
onScreenLockUpdatefuncundefinedcallback for screen lock update event.
onPlayListItemSelectfuncundefinedcallback for video list item select event.
onLoadfuncundefinedcallback for video load event.
onErrorfuncundefinedcallback for video load error event.

Methods

proptypedefaultdescription
playfuncundefinedcall to play a video.
pausefuncundefinedcall to pause a video.
stopfuncundefinedcall to stop a video.
skipNextfuncundefinedskip to next video.
skipBackfuncundefinedskip to prvious video.
reloadfuncundefinedcall to reload a video.
loadfuncundefinedcall to load a video.
setFullScreenModefuncundefinedset fullscreen mode.

ToDo

  • Custom icon support
  • Improve fullscreen support
  • Better documentation

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

FAQs

Package last updated on 29 Sep 2022

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