Skip to content

chenlongjie/react-native-video-gesture

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

简单的视频播放器上层手势组件

此组件见实现了手势识别功能,具体的根据手势而回调的功能为实现
此组件支持:点击事件,左侧纵向滑动,右侧纵向滑动,全组建横向滑动等操作的识别。

使用简介

onClick点击事件
onProgress横向滑动中回调
onProgressEnd横向滑动结束回调
onLeftProgress左侧纵向滑动中回调
onLeftProgressEnd左侧纵向滑动结束回调
onRightProgress右侧纵向滑动中回调
onRightProgressEnd右侧纵向滑动结束回调

<VideoOperationComponet
    style={styles.sliding_view}
    onClick={()=>{
        this.setState({
            distance:"点击事件"
        })
    }}
    onProgress={(d)=>{
        this.setState({
            distance:"进度:"+d
        })
    }}
    onProgressEnd={(d)=>{
        this.setState({
            distance:"进度结束:"+d
        })
    }}
    onLeftProgress={(d)=>{
        this.setState({
            distance:"左进度:"+d
        })
    }}
    onLeftProgressEnd={(d)=>{
        this.setState({
            distance:"左进度结束:"+d
        })
    }}
    onRightProgress={(d)=>{
        this.setState({
             distance:"右进度:"+d
        })
    }}
    onRightProgressEnd={(d)=>{
        this.setState({
             distance:"右进度结束:"+d
        })
    }}
 >
</VideoOperationComponet>

支持自定义 有自定义需求的可参考VideoOperationComponet组件的实现

效果预览

markdown

About

react-native 视频手势

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%