AutoVideoPlayer
AutoVideoPlayer copied to clipboard
How to pause/play any video using Button
I am using ASVideoPlayerController but this auto play but how to use play and push using button
@bhutvijay204 Hope this helps
Add this in ASVideoPlayerController class
var shouldPlay : Bool = false {
didSet{
self.currentVideoContainer()?.shouldPlay = shouldPlay
}
}
then and in ASVideoContainer class add following lines of code
var shouldPlay : Bool = false {
didSet{
if shouldPlay {
player.play()
} else {
player.pause()
}
}
}
Now just simply call from your desired action for pause and play as
ASVideoPlayerController.sharedVideoPlayer.shouldPlay.toggle()
Hi. Great library for auto playing videos in table view cell. I wanted to pause/play videos on didSelectRowAt and applied this code but it is not working fine. It is having following issues.
- It does not pause video first time. Pauses the video when tapped twice.
- On scrollViewDidEndDecelerating it starts playing the paused video.
Any help would be appreciated. Did you achieve this @bhutvijay204 . @Goldy-74 Any idea how to solve this. Thanks in advance.
I want to play and pause the video on the tap on video? @hamzaaminx Did you Achieve this
Hi @Goldy-74 Thanks for your answer. Could you please let us know how can we show the progress while video is buffering?