{"_id":"@cygnet-umshah/react-native-create-thumbnail","_rev":"1-af1025c1e8b521745a043d5bad7b72c5","name":"@cygnet-umshah/react-native-create-thumbnail","dist-tags":{"latest":"1.6.6"},"versions":{"1.6.5":{"name":"@cygnet-umshah/react-native-create-thumbnail","title":"React Native Create Thumbnail","version":"1.6.5","description":"iOS/Android thumbnail generator with support for both local and remote videos","main":"index.js","repository":{"type":"git","url":"git+https://github.com/cygnet-umshah/react-native-create-thumbnail.git","baseUrl":"https://github.com/cygnet-umshah/react-native-create-thumbnail"},"keywords":["react-native"],"author":{"name":"Urvish Shah","email":"urvish.shah@cygnetinfotech.com"},"license":"MIT","licenseFilename":"LICENSE","peerDependencies":{"react-native":">=0.59.0"},"types":"./index.d.ts","gitHead":"43439042b78fb1cb9a8f0c58fd20ab930186d39e","bugs":{"url":"https://github.com/cygnet-umshah/react-native-create-thumbnail/issues"},"homepage":"https://github.com/cygnet-umshah/react-native-create-thumbnail#readme","_id":"@cygnet-umshah/react-native-create-thumbnail@1.6.5","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-7JBM/YPV17sWP3qlGi7Jb7kq9hXyUSVYtICxEjArf17AKx/oQKB9BDCMX7HlC7v+/ndSJnWaLVzTd1X42JcMww==","shasum":"8741304df35c99262d8129ab0dcfc630f8bce06a","tarball":"https://registry.npmjs.org/@cygnet-umshah/react-native-create-thumbnail/-/react-native-create-thumbnail-1.6.5.tgz","fileCount":21,"unpackedSize":44345,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEULVCzQQv4Oztg52F5SDhUPdGfXy6u1oc7WKBJoTUNgIhANTPIdJdRCJisDL+zKreVMiN9Eym+qD8ToOIGJ9M5ZWe"}]},"_npmUser":{"name":"cygnet-umshah","email":"urvish.shah@cygnetinfotech.com"},"directories":{},"maintainers":[{"name":"cygnet-umshah","email":"urvish.shah@cygnetinfotech.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-create-thumbnail_1.6.5_1689241662375_0.9304676769646365"},"_hasShrinkwrap":false},"1.6.6":{"name":"@cygnet-umshah/react-native-create-thumbnail","title":"React Native Create Thumbnail","version":"1.6.6","description":"iOS/Android thumbnail generator with support for both local and remote videos","main":"index.js","repository":{"type":"git","url":"git+https://github.com/cygnet-umshah/react-native-create-thumbnail.git","baseUrl":"https://github.com/cygnet-umshah/react-native-create-thumbnail"},"keywords":["react-native"],"author":{"name":"Urvish Shah","email":"urvish.shah@cygnetinfotech.com"},"license":"MIT","licenseFilename":"LICENSE","peerDependencies":{"react-native":">=0.59.0"},"types":"./index.d.ts","gitHead":"52a56bc228ca0f715b90ece754756c08998ced99","bugs":{"url":"https://github.com/cygnet-umshah/react-native-create-thumbnail/issues"},"homepage":"https://github.com/cygnet-umshah/react-native-create-thumbnail#readme","_id":"@cygnet-umshah/react-native-create-thumbnail@1.6.6","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-C3Uxlz5BX1aV8T148HzGqxhSDfxooK0qHW2/spAPyLAHscfh8Iq78mwL47yd11pcGgS9wCpUu5IszV7goV8GFQ==","shasum":"00c9298ca87e829d5b16d81cf60238faac8d7d38","tarball":"https://registry.npmjs.org/@cygnet-umshah/react-native-create-thumbnail/-/react-native-create-thumbnail-1.6.6.tgz","fileCount":21,"unpackedSize":44360,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH78L4loLoNXgPTi/SpM29Lk2ZZaTT2GamZfvhSPalMRAiBLROPZu+YWYzH+1OmlLNk4u/SChg58BSQI2D0xF6zrhg=="}]},"_npmUser":{"name":"cygnet-umshah","email":"urvish.shah@cygnetinfotech.com"},"directories":{},"maintainers":[{"name":"cygnet-umshah","email":"urvish.shah@cygnetinfotech.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-create-thumbnail_1.6.6_1689243808334_0.07633506839014137"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-13T09:47:42.317Z","1.6.5":"2023-07-13T09:47:42.540Z","modified":"2023-07-13T10:23:28.593Z","1.6.6":"2023-07-13T10:23:28.487Z"},"maintainers":[{"name":"cygnet-umshah","email":"urvish.shah@cygnetinfotech.com"}],"description":"iOS/Android thumbnail generator with support for both local and remote videos","homepage":"https://github.com/cygnet-umshah/react-native-create-thumbnail#readme","keywords":["react-native"],"repository":{"type":"git","url":"git+https://github.com/cygnet-umshah/react-native-create-thumbnail.git","baseUrl":"https://github.com/cygnet-umshah/react-native-create-thumbnail"},"author":{"name":"Urvish Shah","email":"urvish.shah@cygnetinfotech.com"},"bugs":{"url":"https://github.com/cygnet-umshah/react-native-create-thumbnail/issues"},"license":"MIT","readme":"# react-native-create-thumbnail\n\niOS/Android thumbnail generator with storage/cache management and support for both local and remote videos. `react-native-create-thumbnail` is a wrapper around\n[`AVAssetImageGenerator`](https://developer.apple.com/documentation/avfoundation/avassetimagegenerator?language=objc) (iOS) and [`MediaMetadataRetriever`](https://developer.android.com/reference/android/media/MediaMetadataRetriever) (Android)\n\n[![npm version](https://img.shields.io/npm/v/react-native-create-thumbnail.svg)](https://npmjs.com/package/react-native-create-thumbnail) [![npm downloads](https://img.shields.io/npm/dm/react-native-create-thumbnail.svg)](https://npmjs.com/package/react-native-create-thumbnail) [![Maintenance Status](https://img.shields.io/badge/maintenance-active-green.svg)](#maintenance-status)\n\n## Getting started\n\n1. Install library from `npm`\n\n   ```bash\n   npm i react-native-create-thumbnail\n   ```\n\n   or\n\n   ```bash\n   yarn add react-native-create-thumbnail\n   ```\n\n2. Link native code\n\n   With autolinking (react-native 0.60+)\n\n   ```bash\n   cd ios && pod install\n   ```\n\n   Pre 0.60\n\n   ```bash\n   react-native link react-native-create-thumbnail\n   ```\n\n## Usage\n\n```javascript\nimport { createThumbnail } from \"react-native-create-thumbnail\";\n\ncreateThumbnail({\n  url: '<path to video file>',\n  timeStamp: 10000,\n})\n  .then(response => console.log({ response }))\n  .catch(err => console.log({ err }));\n```\n\n## Request Object\n\n| Property  |           Type            | Description                                                               |\n| --------- | :-----------------------: | :------------------------------------------------------------------------ |\n| url       |    `String` (required)    | Path to video file (local or remote)                                      |\n| timeStamp |  `Number` (default `0`)   | Thumbnail timestamp (in milliseconds)                                     |\n| format    | `String` (default `jpeg`) | Thumbnail format, can be one of: `jpeg`, or `png`                         |\n| dirSize   | `Number` (default `100`)  | Maximum size of the cache directory (in megabytes). When this directory is full, the previously generated thumbnails will be deleted to clear about half of it's size.                        |\n| headers   |         `Object`          | Headers to load the video with. e.g. `{ Authorization: 'someAuthToken' }` |\n| cacheName   |         `String` (optional)          | Cache name for this thumbnail to avoid duplicate generation. If specified, and a thumbnail already exists with the same cache name, it will be returned instead of generating a new one. |\n\n## Response Object\n\n| Property |   Type   | Description                 |\n| -------- | :------: | :-------------------------- |\n| path     | `String` | Path to generated thumbnail |\n| size     | `Number` | Size (in bytes) of thumbnail|\n| mime     | `String` | Mimetype of thumbnail       |\n| width    | `Number` | Thumbnail width             |\n| height   | `Number` | Thumbnail height            |\n\n#### Notes\n\nRequires following Permissions on android\n\n```bash\nREAD_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE\n```\n\n#### Limitations\n\n- Remote videos aren't supported on android sdk_version < 14.\n- This is a **Native Module**, so it won't work in expo managed projects.\n- This library heavily depends on the native API's to generate the thumbnails. Thus it can only generate from the video formats/codecs that are supported by the device's OS.\n\n#### Credits\n\n- [`react-native-thumbnail`](https://www.npmjs.com/package/react-native-thumbnail) - A great source of inspiration\n- This project was bootstrapped with [`create-react-native-module`](https://github.com/brodybits/create-react-native-module)\n\n#### Maintenance Status\n\n**Active:** Bug reports, feature requests and pull requests are welcome.\n","readmeFilename":"README.md"}