### Install CocoaPods Dependencies Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/example/README.md Installs the necessary dependencies for iOS development using CocoaPods. This is typically run once when setting up the project or after updating native dependencies. ```sh # Install CocoaPods itself (if not already installed) bundle install # Install project-specific dependencies bundle exec pod install ``` -------------------------------- ### Start Metro Bundler Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/example/README.md Starts the Metro JavaScript bundler, which is essential for running React Native applications. This command should be executed from the root of your React Native project. ```sh # Using npm npm start # OR using Yarn yarn start ``` -------------------------------- ### Run Android App Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/example/README.md Builds and runs the React Native application on an Android device or emulator. This command is executed after the Metro bundler has started. ```sh # Using npm npm run android # OR using Yarn yarn android ``` -------------------------------- ### Install react-native-create-thumbnail Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/README.md Instructions for installing the library using npm or yarn package managers. ```bash npm i react-native-create-thumbnail or yarn add react-native-create-thumbnail ``` -------------------------------- ### Run iOS App Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/example/README.md Builds and runs the React Native application on an iOS simulator or device. This command requires that CocoaPods dependencies have been installed. ```sh # Using npm npm run ios # OR using Yarn yarn ios ``` -------------------------------- ### Configure Android SDK and NDK (`local.properties`) Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/android/README.md Specifies the paths to the Android SDK and NDK installations required for building the library. This file is crucial for Gradle to locate the necessary build tools. ```Properties ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle sdk.dir=/Users/{username}/Library/Android/sdk ``` -------------------------------- ### Generate Thumbnail Usage Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/README.md Example of how to use the `createThumbnail` function to generate a thumbnail from a video file, including basic error handling. ```javascript import { createThumbnail } from "react-native-create-thumbnail"; createThumbnail({ url: '', timeStamp: 10000, }) .then(response => console.log({ response })) .catch(err => console.log({ err })); ``` -------------------------------- ### Publish Library as Maven Dependency Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/android/README.md Command to install the library archives into the local Maven repository. This step is part of the process to publish the library as a Maven dependency. ```Shell ./gradlew installArchives ``` -------------------------------- ### Create Thumbnail API Documentation Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/README.md Detailed documentation for the `createThumbnail` function, outlining its request parameters, their types, defaults, and descriptions, including platform-specific options. ```APIDOC createThumbnail(options) - Generates a thumbnail image from a video file. Parameters: options: Object (required) - url: String (required) Path to video file (local or remote). - timeStamp: Number (optional, default: 0) Thumbnail timestamp in milliseconds. - format: String (optional, default: 'jpeg') Thumbnail format, can be 'jpeg' or 'png'. - maxWidth: Number (optional, default: 512) Maximum thumbnail width in pixels. - maxHeight: Number (optional, default: 512) Maximum thumbnail height in pixels. - dirSize: Number (optional, default: 100) Maximum size of the cache directory in megabytes. When full, older thumbnails are deleted. - headers: Object (optional) Headers to load the video with, e.g., { Authorization: 'someAuthToken' }. - cacheName: String (optional) Cache name to avoid duplicate generation. If a thumbnail with this name exists, it's returned. - timeToleranceMs: Number (optional, default: 2000, Only iOS) Time tolerance in ms for the system to pick the best matching video frame. - onlySyncedFrames: Boolean (optional, default: true, Only Android) For Android: If true, retrieves a sync frame closest to the timestamp. If false, retrieves any frame closest to the timestamp. Returns: Promise - path: String Path to the generated thumbnail. - size: Number Size (in bytes) of the thumbnail. - mime: String Mimetype of the thumbnail. - width: Number Thumbnail width. - height: Number Thumbnail height. ``` -------------------------------- ### Link Native Code Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/README.md Steps to link the native module for React Native projects, covering autolinking for newer versions and manual linking for older ones. ```bash cd ios && pod install # For pre 0.60 versions: react-native link react-native-create-thumbnail ``` -------------------------------- ### Android Permissions Source: https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/README.md Required Android permissions for accessing storage to read and write video files for thumbnail generation. ```bash READ_EXTERNAL_STORAGE WRITE_EXTERNAL_STORAGE ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.