SvenTiigi / YouTubePlayerKit

A Swift Package to easily play YouTube videos 📺
https://sventiigi.github.io/YouTubePlayerKit/
MIT License
714 stars 64 forks source link

The `loopEnabled` configuration doesn't loop a video. #68

Closed EvgenyKarkan closed 1 year ago

EvgenyKarkan commented 1 year ago

What happened?

I might be missing something, but it appears evident that enabling the loopEnabled feature should make a video repeat continuously. However, for some reason, the video doesn't repeat and just ends.

What are the steps to reproduce?

func setupYouTubeView() {
    let configuration = YouTubePlayer.Configuration(
        automaticallyAdjustsContentInsets: true,
        fullscreenMode: .system,
        showControls: true,
        loopEnabled: true,
        useModestBranding: true
    )

    youTubePlayer = YouTubePlayer(
        source: .url("https://youtube.com/watch?v=YE7VzlLtp-4"),
        configuration: configuration
    )

    youTubeView = YouTubePlayerHostingView(player: youTubePlayer!)
    youTubeView?.autoresizingMask = [.flexibleHeight, .flexibleWidth]

    containerView.addSubview(youTubeView!)
}

What is the expected behavior?

I had the expectation that the video would repeat in a continuous loop.

SvenTiigi commented 1 year ago

Hi @EvgenyKarkan,

Please check out the develop branch which contains a fix for the loop parameter.

EvgenyKarkan commented 1 year ago

Thank you very much, I trust you the issue is fixed. Please feel free to close the current ticket as you see fit. I am not blocked at all and can wait until the new release is available, so I can pull the updated SPM package.

SvenTiigi commented 1 year ago

Thanks! I will let you know when a new release is available ✌️

SvenTiigi commented 1 year ago

The fix is now available with the latest version 1.5.1