包装react-native-video,添加了部分自己需要的功能,对于没有开发的属性可以自己fork该项目去加,或者提出issue,有空我会写下(小声逼逼:小菜鸡一个,难的不会,简单的懒~)
只写了Android,IOS没看,应该都差不多,具体的自己调试(没有Mac也没法调试,有土豪的话可以给我捐一台,我不会介意的,哈哈哈)
npm install [email protected] --save
npm install react-native-linear-gradient --save
npm install react-native-orientation --save
npm install react-native-keep-awake --save
npm install react-native-vector-icons --save
npm install react-native-tomatohut-player --save
echo D | xcopy node_modules\react-native-vector-icons\Fonts android\app\src\main\assets\fonts /e
import React, {Component} from 'react';
import Video from 'react-native-tomatohut-player';
export default class App extends Component{
render() {
return (
<Video
source={{uri: 'https://ifeng.com-l-ifeng.com/20190803/28355_135e0628/index.m3u8'}}
themeColor={'red'}
title={'哪吒'}
// onFullScreen={(value) => console.log(value)}
// startTime={1000}
// onProgress={(event) => console.log(event)}
/>
);
}
}