Memory leak issue when calling StopViedo() · Issue #511 · youtube/youtube-ios-player-helper · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Memory leak issue when calling StopViedo() #511

Open
@gogochang

Description

@gogochang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.