Anton
Anton

Reputation: 947

Playing HLS m3u8 on iOS 9

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()
    }

Upvotes: 7

Views: 11834

Answers (1)

Anton
Anton

Reputation: 947

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"

Upvotes: 2

Related Questions