1

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?

pkc456
  • 8,350
  • 38
  • 53
  • 109
masil
  • 33
  • 4
  • 1
    Have you checked [App Transport Security](https://stackoverflow.com/a/33007661/988169) – pkc456 Jan 30 '18 at 10:28
  • 1
    Every time someone uses force-unwrapping my soul dies bit by bit – mag_zbc Jan 30 '18 at 10:33
  • I add Allow Arbitrary Loads for App Transport Security Settings , should I do more? – masil Jan 30 '18 at 10:36
  • More info is necessary. When you play the item, check `player.currentItem.status` and if it is `failed`, check `player.currentItem.error` for description why did your asset fail to play – mag_zbc Jan 30 '18 at 10:46
  • 1
    @mag_zbc first of all sorry for ur soul :), it talks lot's of death soul to someone can step forward , and after that thanks for ur help, it says AVFoundationErrorDomain Code=-11850 and apparently the problem comes from server. – masil Jan 30 '18 at 11:02
  • I have the same problem - can you somehow workaround this on the device because I cannot change the server. – Freddy Jul 25 '18 at 12:27

1 Answers1

1

enter image description here

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

E.Coms
  • 11,065
  • 2
  • 23
  • 35