New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-media-helper

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

react-native-media-helper

select item from camera roll

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Media Helper

MediaHelper component for React native, supports both android and ios.

currently, react native camera roll is not supported get thumbnail video from camera roll. So this module support gets thumbnail video and photo. it depends on react-native-thumbnail and react-native-get-real-path library to complete android module

Install

npm install react-native-media-helper --save

then link

react-native-thumbnail

react-native-get-real-path

Usage:

import MediaHelper from 'react-native-media-helper'

  <MediaHelper
    numPhotos={20} // just for android
    numVideos={20} // just for android
    media='All'   // just for ios
    num={20}      // just for ios
    onCancel={() => this.setState({visible: false})}
    onSelectedItem={(item) => alert(JSON.stringify(item))}
  />

Response example:

Ios

{
  "node": {
    "timestamp": 1509173491,
    "location": {},
    "group_name": "Camera Roll",
    "type": "ALAssetTypePhoto",
    "image": {
      "width": 640,
      "height": 640,
      "isStored": true,
      "filename": "cat.jpg",
      "uri": "assets-library://asset/asset.JPG?id=BD2F9143-CAD6-476A-8875-DF91AF6401A5&ext=JPG",
      "playableDuration": 0,
      "thumbnailUrl": "assets-library://asset/asset.JPG?id=BD2F9143-CAD6-476A-8875-DF91AF6401A5&ext=JPG"
    }
  }
}

Android

{
  "node": {
    "timestamp": 1523171768,
    "group_name": "thumb",
    "type": "image/jpeg",
    "image": {
      "height": 320,
      "width": 240,
      "uri": "content://media/external/images/media/2222",
      "thumbnailUrl": "content://media/external/images/media/2222"
    }
  }
}

Props

PropertyTypedefaultDescription
numPhotosPropTypes.number10just for Android number of Photo
numVideosPropTypes.number10just for Android number of Video
getPhotosPropTypes.booltruejust for Android allow get photo
getVideosPropTypes.booltruejust for Android allow get video
mediaPropTypes.stringAlljust for Ios String: All, Photos, Videos
numPropTypes.number20just for Ios number item
imageMarginPropTypes.number5Margin size of one image.
imagesPerRowPropTypes.number3Number of images per row.
headerMidPropTypes.string'Select Items'Text header mid
headerLeftButtonPropTypes.string'Cancel'Text header left button
headerRightButtonPropTypes.string'Done'Text header right button
onCancelPropTypes.func() => {}Function cancel
onSelectedItemPropTypes.func() => {}Function selected item

Keywords

FAQs

Package last updated on 13 Apr 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc