简体   繁体   中英

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

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM