nicholasess / react-native-thumbnail-video

Easily show thumbnails for videos on react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-thumbnail-video

Easily show thumbnails for videos.

Demo

 

See the demo on Expo: @lucasbento/react-native-thumbnail-video-example

Installation

yarn add react-native-thumbnail-video

Usage

import Thumbnail from 'react-native-thumbnail-video';

// ...
  render() {
    return (
      <Thumbnail url="https://www.youtube.com/watch?v=lgj3D5-jJ74" />
    )
  }
// ...

Props

url (string)

URL of the video

type ([string])

Can be either default, high, medium, standard or maximum.

imageWidth (number)

Width of the image. Defaults to the device width.

imageHeight (number)

Height of the image. Defaults to 200.

containerStyle (ViewPropTypes.style)

Style of the container using TouchableOpacity.

Style of the icon image.

onPress (function)

Function to be called when the user presses the thumbnail. Defaults to opening the video URL.

onPress (function)

Function to be called when there's an error on the default onPress function.

children (component)

Custom component to render inside of the thumbnail.

License

MIT © Lucas Bento

About

Easily show thumbnails for videos on react-native

License:MIT License


Languages

Language:JavaScript 100.0%