AVPlayer not playing m3u8 from local file

后端 未结 2 989
生来不讨喜
生来不讨喜 2021-01-14 15:41

I am trying to get AVPlayer to play a m3u8 playlist that is a local file.

I have narrowed this down to a simple test case using one of Apple\'s sample playlists:

相关标签:
2条回答
  • 2021-01-14 15:49

    As of iOS 10 you can download HLS streams using AVAssetDownloadURLSession . This will result in a local asset path that can be played offline.

    If you are trying to embed a video in your app bundle you would be better off just creating an MP4.

    0 讨论(0)
  • 2021-01-14 16:10

    m3u/m3u8 files must be stored on a server and streamed in order to be played(I know it sounds not reasonable, but Apple did it again). You must use HLS, which basically means you should store the file on a server and directly access it from there. You can as well create a local Server inside your app using a framework like GCD WebServer.

    0 讨论(0)
提交回复
热议问题