Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mybigday/react-native-media-meta
Get media file metadata in your React Native app
https://github.com/mybigday/react-native-media-meta
Last synced: about 1 month ago
JSON representation
Get media file metadata in your React Native app
- Host: GitHub
- URL: https://github.com/mybigday/react-native-media-meta
- Owner: mybigday
- License: mit
- Created: 2016-03-09T15:38:24.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T17:38:30.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T22:29:42.536Z (about 1 month ago)
- Language: Objective-C
- Size: 257 KB
- Stars: 83
- Watchers: 6
- Forks: 46
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-react-native - react-native-media-meta ★41 - Get media file metadata in your React Native app (Components / Media)
- awesome-react-native-native-modules - react-native-media-meta ★18
- awesome-react-native - react-native-media-meta ★41 - Get media file metadata in your React Native app (Components / Media)
- awesome-react-native - react-native-media-meta ★41 - Get media file metadata in your React Native app (Components / Media)
- awesome-react-native-ui - react-native-media-meta ★10 - Get media file metadata in your React Native app (Components / Media)
- awesome-react-native - react-native-media-meta ★41 - Get media file metadata in your React Native app (Components / Media)
README
# React Native Media Meta [![NPM version](http://img.shields.io/npm/v/react-native-media-meta.svg?style=flat)](https://www.npmjs.com/package/react-native-media-meta)
> Get media file metadata in your React Native app
## Installation
```bash
$ npm install react-native-media-meta --save
$ react-native link
```## Usage
```js
import MediaMeta from 'react-native-media-meta';
const path = '';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](https://github.com/wseemann/FFmpegMediaMetadataRetriever), see [RNMediaMeta.java#L36](android/src/main/java/com/mybigday/rn/RNMediaMeta.java#L36) for more information.
__*[iOS]*__ We using [official AVMatadataItem](https://developer.apple.com/library/mac/documentation/AVFoundation/Reference/AVFoundationMetadataKeyReference/#//apple_ref/doc/constant_group/Common_Metadata_Keys), see [RNMediaMeta.m#L9](ios/RNMediaMeta/RNMediaMeta.m#L9) for more information.## License
[MIT](LICENSE.md)