1.0.0 • Published 4 years ago

react-native-thumbnail-generator v1.0.0

Weekly downloads
98
License
MIT
Repository
github
Last release
4 years ago

react-native-thumbnail-generator

iOS/Android thumbnail generator with support for both local and remote videos

Getting started

  1. Install library from npm

    yarn add react-native-thumbnail-generator
  2. Link native code

    With autolinking (react-native 0.60+)

    cd ios && pod install

    Pre 0.60

    react-native link react-native-thumbnail-generator

Usage

import { createThumbnail } from "react-native-thumbnail-generator";

createThumbnail({
  url: "path to video file",
  timeStamp: 10
})
  .then(response => {
    console.log({ response });
    this.setState({
      status: "Thumbnail received",
      thumbnail: response.path
    });
  })
  .catch(err => console.log({ err }));

Request Object

PropertyTypeDescription
urlString (default "")Path to video file (local or remote).
timeStampNumber (default 1)Thumbnail time

Response Object

PropertyTypeDescription
pathStringPath to generated thumbnail.
widthNumberThumbnail width
heightNumberThumbnail height

License

MIT