Search code examples
iosswift4xcode9.2

How can I play video in Swift 4 remotely with playerViewController?


It shows my just like this:

enter image description here

  let myURL = "http://example.come/package=07e9a825-7be4-4ce7-8a6ec78b"
    let videoURL = URL(string: myURL)
    let player = AVPlayer(url: videoURL!)
    let playerViewController = AVPlayerViewController()
    playerViewController.player = player
    self.present(playerViewController, animated: true) {
        playerViewController.player!.play()
    }

but when I use the URL in my browser it's completely ok with that mp4 video. what I miss?


Solution

  • enter image description here

    Inside the info.plist file, insert the lines and the problem should be solved