1 Reply
      Latest reply on May 21, 2020 4:32 PM by AppWriter
      AppWriter Level 1 Level 1 (0 points)

        I'm able to download an HLS video using this:




        When I change to airplane mode, and play back the video, it works if I use the samples provided by the HLSCatalog sample app.  They are:





        Both of those manifest files point to segments that are stored in a path relative to manifest file.  For example, the 1st one is....


        #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=232370,CODECS="mp4a.40.2, avc1.4d4015" gear1/prog_index.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=649879,CODECS="mp4a.40.2, avc1.4d401e" gear2/prog_index.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=991714,CODECS="mp4a.40.2, avc1.4d401e" gear3/prog_index.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1927833,CODECS="mp4a.40.2, avc1.4d401f" gear4/prog_index.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=41457,CODECS="mp4a.40.2" gear0/prog_index.m3u8


        and you can see it referencing other manifest files on the same server using a local path, such as:  "gear3/prog_index.m3u8"



        My problem is that the manifest files for my company have remote and different server URLs for all the files referenced in it.  For example, my manfest might be:   http://myremoteserver.com/myManifest.m3u8

        and it it, it'll reference files at:   http://myvideoserver.com/video.m3u8


        As a result, my videos do download, but they do NOT play when I change to airplane mode.


        Any help would be appreciated.   Thanks!

        • Re: AVAssetDownloadTask and playback, m3u8 has remote URLs
          AppWriter Level 1 Level 1 (0 points)

          A little more information....I downloaded the container from my app on to my computer and looked inside.   In the m3u8 file that's saved into the movpkg bundle, the segments are always preceeded by a key, like this:







          Also... the "frag" files from apple's sample app... if I change the extension to ".ts", they play fine in QuickTime.  But the frag files from my video do not.  So my current theory is that when in airplane mode, it's trying to reach the key at the remote server to decrypt the segment, and of course it's unreachable when offline.


          Any ideas?