🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@humanz/react-native-video-preview

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

@humanz/react-native-video-preview

A <VideoPreview /> element for react-native

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
10
Maintainers
1
Weekly downloads
 
Created
Source

react-native-video-preview

A <VideoPreview> component for react-native on Android.

iOS support is not included because react-native-video already shows a preview when loading a video that is paused.

Add it to your project

Run npm i -S git://github.com/chadsmith/react-native-video-preview.git

Then run react-native link react-native-video-preview

Inside your code, import the component by adding:

import VideoPreview from 'react-native-video-preview';

If necessary, make the following additions to the given files manually:

android/settings.gradle

include ':react-native-video-preview'
project(':react-native-video-preview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video-preview/android')

android/app/build.gradle

dependencies {
   ...
   compile project(':react-native-video-preview')
}

MainApplication.java

On top, import:

import com.github.chadsmith.RCTVideoPreview;

Under .addPackage(new MainReactPackage()):

.addPackage(new VideoPreviewPackage())

Usage

<VideoPreview
  source={{ uri: 'http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4' }} // Can be a URL or a local file.
  style={styles.preview}
  resizeMode="contain" />

// Later on in your styles..
var styles = StyleSheet.create({
  preview: {
    height: 180,
    width: 320,
  },
});

MIT Licensed

FAQs

Package last updated on 12 Oct 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