npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-media-metadata-picker

v1.0.0

Published

Pick image/video and get metadata only — no copy, no processing. Supports all formats including iOS HEVC.

Readme

react-native-media-metadata-picker

Pick images and videos and get metadata only — no file copy, no processing. Works on Android and iOS with all formats, including iOS HEVC.

Features

  • Metadata only: Returns file information (dimensions, duration, size, type, dates) without copying or processing the file.
  • No temp files: Does not write to a temp folder or convert the media.
  • All formats: Supports all image and video formats the platform supports, including:
    • iOS: HEVC (.mov), H.264, JPEG, HEIC, PNG, etc.
    • Android: Common image and video MIME types.
  • Cross-platform: Same API on Android and iOS.

Requirements

  • React Native 0.83 or above
  • Node.js 22 or above

Installation

npm install react-native-media-metadata-picker
# or
yarn add react-native-media-metadata-picker

iOS

cd ios && pod install && cd ..

Minimum iOS version: 14.0 (for PHPicker).

Android

No extra setup. Minimum SDK: 24.

Usage

import {
  pickMediaMetadata,
  pickMultipleMediaMetadata,
  type MediaMetadata,
} from 'react-native-media-metadata-picker';

// Pick a single image or video
const meta = await pickMediaMetadata({ mediaType: 'all' });
if (meta) {
  console.log(meta.uri, meta.width, meta.height, meta.type);
  if (meta.type === 'video') console.log(meta.duration);
}

// Pick multiple
const list = await pickMultipleMediaMetadata({ mediaType: 'video' });
list.forEach((m) => console.log(m.uri, m.duration));

Options

  • mediaType: 'image' | 'video' | 'all' — filter by type (default 'all').
  • multiple: Only via pickMultipleMediaMetadata() for multiple selection.

Returned metadata (MediaMetadata)

| Field | Type | Description | |--------------------|----------|--------------------------------------------------| | uri | string | Platform-specific reference to the file | | type | 'image' \| 'video' | Media type | | width | number | Width in pixels | | height | number | Height in pixels | | fileName | string? | Display name when available | | mimeType | string? | e.g. image/jpeg, video/hevc | | fileSize | number? | Size in bytes | | duration | number? | Duration in seconds (video only) | | creationDate | string? | ISO date string | | modificationDate | string? | ISO date string | | localIdentifier | string? | iOS PHAsset identifier | | codec | string? | Codec hint when available | | originalUrl | string? | Original file URL (file:// on iOS, same as uri on Android); use for upload | | originalDirPath | string? | Directory path without filename (e.g. /var/mobile/.../). iOS from file URL; Android when available |

  • Android: uri and originalUrl are the same content:// URI; use for upload without copying.
  • iOS: uri is a ph:// reference (persists after app reinstall). originalUrl is the original file:// URL when available. Store uri (ph://) and call getFileUrl(uri) when you need to preview or upload so it works after reinstall.

Resolving ph:// for preview and upload (iOS)

On iOS, originalUrl is a temporary file URL. Store meta.uri (ph://) in your app. When displaying or uploading, call:

import { getFileUrl } from 'react-native-media-metadata-picker';

const displayOrUploadUri = await getFileUrl(localfile.uri); // file:// on iOS, or same uri on Android

Use displayOrUploadUri for <Image source={{ uri }} />, <Video source={{ uri }} />, and RNBlobUtil.wrap(uri). This works after the app is reinstalled.

Behavior

  • No copy: The library does not copy or process file data. It only reads metadata from the system (e.g. Android ContentResolver + MediaMetadataRetriever, iOS PHAsset).
  • HEVC: On iOS, HEVC and other formats are supported without conversion; the system provides metadata for the selected asset.
  • Permissions: Uses the system picker (Android ACTION_GET_CONTENT, iOS PHPicker), so no storage/photo library permission is required for picking.

License

MIT