I want to preload the video for users, but I don't want to waste bandwidth by preloading too much, in case they don't end up watching it. How can I load the only the first chunk from a .m3u8 video stream, using my own loading logic? AVAssetResourceLoaderDelegate
would be perfect, but I don't see how to leverage it without some visibility into Brightcove's stuff.
I solved this by doing KVO on the Brightcove controller with keypath currentSession.player.currentItem
and then whenever Brightcove tried to change that, I would take whatever URL it was using, create a new asset with that URL, and swap that one in. Just trying to change the delegate of the existing resourceLoader, however, will not work.