Clearly, AVFoundation (and Quicktime X) can demux and play properly encoded .ts
containers, because .ts
containers underly HTTPS live streaming.
Short of setting up a local web service to serve the .m3u8
and associated .ts
files, I'd really like to be able to either: convince AVURLAsset
and/or URLAssetWithURL
to accept a local file .m3u8
URI as if it were an HTTP URI, or better yet, be able to use AVQueuePlayer
to load and play a sequence of .ts
files without jumping through the live streaming hoops.
The reason I'm wanting to do this is that I need to locally generate movie assets on-the-fly in a somewhat piecemeal fashion - the entire asset won't be available at once but will be generated as time goes by. Obviously this lends itself to an AVQueuePlayer
but for various reasons my asset fragments are packaged in .ts
containers. All this sounds like it's perfect for "local" live streaming.
I suspect that URLAssetWithURL
does some qualification of the string passed to it and then sets some properties to signal that it's looking at a live streaming source which in turn tell AVPlayer
/AVQueuePlayer
to expect tracks in .ts
form. It probably sees the HTTP and decides that this is live streaming.
So my question is: how would one go about "fooling" AVFoundation into handling a local .m3u8
file exactly as it does a remote one?
And the bonus question is: Has anyone (and if so how) been able to make an AVAsset
from a .ts
file so that the asset will return the status of the asset's tracks (prepare for playback)?
TIA!