abbasfreestyle / react-native-af-video-player

MIT License
381 stars 288 forks source link

How can I pause the video. I want to control the video pausing based on a condition. #83

Closed ronastlelobo closed 6 years ago

ronastlelobo commented 6 years ago

Thank you @sure1243jupiter . I am closing the Issue !

sure1243jupiter commented 6 years ago

hi @ronastlelobo you can do by referencing the video component

declare like this

<Video 
ref={(ref)=>{this.video}=ref}}
......
>

the Video is the imported name from react-native-af-video library

import Video from 'react-native-af-video-player';

and then you can use that reference to play/pause where ever you want in the parent component like this

this.video.paly() to play and this.video.pause() to pause video