prepare for release

This commit is contained in:
Kyle Fang
2019-12-03 12:00:16 +08:00
parent b5ab54ce65
commit 12959cd720
5 changed files with 22 additions and 14 deletions

View File

@@ -1,8 +1,16 @@
# react-native-video-cache
Boost performance on online video loading and caching
Use following libraries to do the heavy lifting.
- iOS: https://github.com/ChangbaDevs/KTVHTTPCache
- Android: https://github.com/danikula/AndroidVideoCache
## Getting started
`$ npm install react-native-video-cache --save`
`$ yarn add react-native-video-cache`
### Mostly automatic installation
@@ -10,8 +18,9 @@
## Usage
```javascript
import VideoCache from 'react-native-video-cache';
// TODO: What to do with the module?
VideoCache;
import convertToProxyURL from 'react-native-video-cache';
...
const localProxiedURL = await convertToProxyURL(originalURL);
...
<Video source={{uri: localProxiedURL}} />
```

View File

@@ -10,7 +10,7 @@
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';
import VideoCache from 'react-native-video-cache';
import convertToCache from 'react-native-video-cache';
export default class App extends Component<{}> {
state = {
@@ -18,7 +18,7 @@ export default class App extends Component<{}> {
message: '--'
};
componentDidMount() {
VideoCache.convert('https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4').then((message) => {
convertToCache('https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4').then((message) => {
this.setState({
status: 'native callback received',
message

1
index.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
export default function convert(url: string): Promise<string>

View File

@@ -2,4 +2,4 @@ import { NativeModules } from 'react-native';
const { VideoCache } = NativeModules;
export default VideoCache;
export default VideoCache.convert;

View File

@@ -2,11 +2,9 @@
"name": "react-native-video-cache",
"title": "React Native Video Cache",
"version": "1.0.0",
"description": "TODO",
"description": "Boost performance on online video loading and caching",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/zhigang1992/react-native-video-cache.git",
@@ -23,8 +21,8 @@
"licenseFilename": "LICENSE",
"readmeFilename": "README.md",
"peerDependencies": {
"react": "^16.8.1",
"react-native": ">=0.59.0-rc.0 <1.0.x"
"react": "*",
"react-native": "*"
},
"devDependencies": {
"react": "^16.8.3",