Playing HLS m3u8 on iOS 9

11,316

this problem was resolved, from Apple Support:

"App Transport Security has blocked a cleartext HTTP resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file

We would recommend going through sessions 706, 711 from WWDC 2015 for more details. Going through NSAppTransportSecurity developer resource is also recommended"

Share:
11,316
Anton
Author by

Anton

Updated on August 12, 2022

Comments

  • Anton
    Anton over 1 year

    I have a problem with playing video streams HLS m3u8. I created a new project with target iOS9 and use AVPlayer to plat video stream. While test stream is working, all other video streams which I use in my windows and android app do not work with iOS AVPlayer class. Could you please give advise is it possible to tune AVPlayer or which 3rd party modern library can be used? Update: Tried demo app of Vitamio, it works.

    This is code which I use:

        @IBAction func pressed(sender: AnyObject) {
    // this url work, all others not
            let url = NSURL(string:"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8")
            let player = AVPlayer(URL: url!)
            let playerController = AVPlayerViewController()
    
            playerController.player = player
            self.addChildViewController(playerController)
            self.myView.addSubview(playerController.view)
            playerController.view.frame = self.myView.frame
    
            player.play()
        }