Skip to content

Videos Not Playing. #30

@smartowls-chetan

Description

@smartowls-chetan

https://www.youtube.com/watch?v=etoGsO7gIZs
trying to run videos but video is not playing. actually i am successfully fetch code from url and seting itlike this and try to play but nothing happen. even error is not showing.

override func viewDidLoad() {
super.viewDidLoad()

    playerView.delegate = self
    activityInd.hidesWhenStopped = true
    
}

override func viewWillAppear(_ animated: Bool) {
let playerVars: [String: Any] = [
"controls": 0,
"modestbranding": 0,
"playsinline": 0,
"rel": 0,
"showinfo": 0,
"autoplay": 1,
"origin": "https://youtube.com"
]

    let shortUrl = extractYoutubeId(from: youtubeVideoLink)
    playerView.loadWithVideoId(shortUrl ?? "", with: playerVars)
    activityInd.startAnimating()
    
    NotificationCenter.default.addObserver(self, selector: #selector(videoExitFullScreen), name: UIWindow.didResignKeyNotification, object: view.window)
}

even these method is not called but sometime it is called
func playerViewDidBecomeReady

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions