I want to call programmatically the

func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest) -> Bool

of an AVURLAsset from the delegate of the AVPlayer, AVAssetResourceLoaderDelegate, so that I can cash the ckc Data so that I can play decrypted content offline.

I followed the steps of https://developer.apple.com/videos/play/wwdc2016/504/

If I play the AVURLAsset cash the ckc key data and then close the internet and play the AVURLAsset again it works and I can see the video offline.

But I need to call the resourseLoader function without to play the video.

The reason I can't do the steps is because to get the ckc data I need the loadingRequest object from the delegate function resourceLoader.

Is there any way to accomplish that without call the play method and discard player when I store the keys?

Related posts

Recent Viewed