I am trying to add accessibility features in our AVPlayer to our apple TV app. (swift application)
Our video content is hosted on a CDN. This CDN returns us a list of streams (mp4, flv, m3u8, etc) and a list of tracks for captions in a DFXP format.
From the documentation that I am consulting, it seems that I'd need a master m3u8 that would host the captions file in order to display them, but our CDN doesn't seem to provide that option. Is there a way to add a captions file to an AVPlayerItem dynamically?
There isn't a way to add them client-side in a direct sense, but you could download and modify the master playlist to point to the appropriate WebVTT file (with the requisite tags) before initializing the AVAsset with it. You could also leverage a custom URL scheme and AVAssetResourceLoader to handle the request for the initial m3u8 as well - both paths would allow you to modify the master playlist before handing it off to AVFoundation.