Socket
Socket
Sign inDemoInstall

expo-nexen-player

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    expo-nexen-player

next gen video player for expo project


Version published
Weekly downloads
4
Maintainers
1
Created
Weekly downloads
 

Readme

Source

expo-nexen-player

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

Preview

@

Installation

npm install --save expo-nexen-player

or

yarn add expo-nexen-player

Dependencies

yarn add expo-av expo-brightness react-native-svg

Usage

import NexenPlayer, { NexenPlayerRef } from 'expo-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
sourceAVPlaybackSource object from expo-av{}media source.
titlestring''video title.
posterstring''poster url.

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.
disableRelodbooleanfalsehide reload 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.
onLoopUpdatefuncundefinedcallback 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

Last updated on 29 Sep 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