Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loopVideo not working #3

Closed
luuk777w opened this issue Mar 26, 2018 · 1 comment
Closed

loopVideo not working #3

luuk777w opened this issue Mar 26, 2018 · 1 comment

Comments

@luuk777w
Copy link

I have this setup and everything works except the loopVideo, it just stops after the video has ended and I have to play it again by clicking/touching it.

player = YTSwiftyPlayer(
            frame: CGRect(x: 0, y: 0, width: 640, height: 480),
            playerVars: [.videoID(Configuration().videoId),
                         .showControls(VideoControlAppearance.hidden),
                         .loopVideo(true),
                         .autoplay(true),
                         .showRelatedVideo(false),
                         .disableKeyboardControl(true),
                         .showInfo(false),
                         ])
        
        view = player
        player.delegate = self as? YTSwiftyPlayerDelegate
        player.loadPlayer()
        player.mute()

player.mute() also does not work, but that's probably my own error.

@rinov
Copy link
Owner

rinov commented Jul 13, 2018

Hi, @luuk777w

Previously loopVideo only allows playlist playback, So you should use .playlist([Configuration().videoId]) instead of .videoID(Configuration().videoId) if you want to use loopVideo property.

But, The newest version (v0.2.2), I've also adopt loopVideo property to single videoID, so your code just works fine :)

FYI player.mute() #10 (comment)

@rinov rinov closed this as completed Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants