react-native-media-meta

0.0.11 • Public • Published

React Native Media Meta NPM version

Get media file metadata in your React Native app

Installation

$ npm install react-native-media-meta --save
$ react-native link

Usage

import MediaMeta from 'react-native-media-meta';
const path = '<your file path here>';

MediaMeta.get(path)
  .then(metadata => console.log(metadata))
  .catch(err => console.error(err));

API

MediaMeta.get(path) - Promise

Resolve: Object - included following keys (If it's found)

  • thumb - Base64 image string (video: get first frame, audio: get artwork if exist)
  • duration (video only)
  • width - the thumb width
  • height - the thumb height
  • Others:

[Android] We using FFmpegMediaMetadataRetriever, see RNMediaMeta.java#L36 for more information.
[iOS] We using official AVMatadataItem, see RNMediaMeta.m#L9 for more information.

License

MIT

Package Sidebar

Install

npm i react-native-media-meta

Weekly Downloads

6,211

Version

0.0.11

License

MIT

Unpacked Size

23.1 kB

Total Files

12

Last publish

Collaborators

  • jhen0409
  • pepper.yen