Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Auto Re-play when video reached end. #44

Open
dineshguptha opened this issue Jan 3, 2018 · 1 comment
Open

Auto Re-play when video reached end. #44

dineshguptha opened this issue Jan 3, 2018 · 1 comment

Comments

@dineshguptha
Copy link

Hello ,

I like this lib very much and simple to use. But how can I replay same video when it reaches to end. I mean I want to play video in infinite loop (until user stops the video).

@asifbilal786
Copy link

asifbilal786 commented Oct 16, 2018

@dineshguptha you can use below code to play video infinitely.

Implement the delegate VGPlayerDelegate and implement below method.

func vgPlayer(_ player: VGPlayer, stateDidChange state: VGPlayerState) {
        if state == .playFinished {
            player.replaceVideo((player.contentURL)!)
            player.play()
        }
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants