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

Memory leak issue when calling StopViedo() #511

Open
gogochang opened this issue Feb 1, 2024 · 0 comments
Open

Memory leak issue when calling StopViedo() #511

gogochang opened this issue Feb 1, 2024 · 0 comments

Comments

@gogochang
Copy link

gogochang commented Feb 1, 2024

Calling the stopViedo() method causes a memory leak.
I only used events on the UI button

class ViewController: UIViewController {
    private var ytPlayer: YTPlayerView
    private let stop = UIButton()

    init(ytPlayer: YTPlayerView = YTPlayerView()) {
        self.ytPlayer = ytPlayer    
        super.init(nibName: nil, bundle: nil)
        self.ytPlayer.load(
            withVideoId: "VideoID",
            playerVars: [
                "autoplay": 0,
                "playsinline" : 1,
                "cc_load_policy" : 1,
                "loop" : 1,
                "playlist" : "VideoID",
                "fs": 0])

        stop.addTarget(self, action: #selector(test), for: .touchUpInside)

    }

    @objc func test() {
        ytPlayer.stopVideo()
    }

}

How do you solve this issue?

스크린샷 2024-02-01 오전 10 26 18
  • My environment
    • xcode version 15.0.1 and 15.2
    • youtube-ios-player-helper version 1.0.4
@gogochang gogochang changed the title Memory leak issue when call StopViedo() Memory leak issue when calling StopViedo() Feb 1, 2024
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

1 participant