0.0.6 • Published 5 years ago

react-native-tomatohut-player v0.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

react-native-tomatohut-player

HitCount Npm MIT 统计

简介

包装react-native-video,添加了部分自己需要的功能,对于没有开发的属性可以自己fork该项目去加,或者提出issue,有空我会写下(小声逼逼:小菜鸡一个,难的不会,简单的懒~)
只写了Android,IOS没看,应该都差不多,具体的自己调试(没有Mac也没法调试,有土豪的话可以给我捐一台,我不会介意的,哈哈哈)

安装(windows)

npm install react-native-video@4.4.4 --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

功能

  • 滑屏快进
  • 全屏
  • 开始时间
  • 双击暂停
  • 用的时候再写

截图

image image image

实例

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)}
            />
        );
    }
}

属性

名称备注
source资源路径(写法见react-native-video#source
themeColor加载按钮与silder滑块颜色,见图
title视频标题名称
startTime视频开始时间
titleLeft标题左边组件,可以放置一个后退图标

方法

名称备注
onFullScreen返回是否全屏(true为全屏)
onProgress返回播放参数(见react-native-video#onprogress
onEnd播放结束(见react-native-video#onend
onError播放失败(见react-native-video#onerror