AVAssetResourceLoaderDelegate -resourceLoader: didCancelLoadingRequest: naver called (in the Device only)

My app uses the AVAssetResourceLoaderDelegate for video loading.


In the simulator,

currently in progress or pending resource request when no longer needed

-resourceLoader: didCancelLoadingRequest: method is called for helping the client to cancel the ongoing my network request.


But In the iOS device,

The method is not called. Therefore, the resource requests are requesting a duplicate range of videos running simultaneously, using unnecessary network occurs.



1. Why is the behavior of the device and simulator Is Different? Is it the specification ? Or is it a bug?

2. I want to know about whether the method is invoked under what conditions.


Here we are with regard to this issue test code created by other developers.

https://github.com/Naituw/DemoAVAssetResourceLoaderDelegate



Thank you.

Same issue here. I'm also using this approach to load video from a remote URL. resourceLoader: didCancelLoadingRequest is never called resulting in many reduduntant calls to overlapping regions of data. When examing AVPlayer's network traffic when not using AVAssetResourceLoaderDelegate there are many requests for significant chunks of data that are initiated then quickly cancelled by the client. Those same requests aren't cancelled when using AVAssetResourceLoaderDelegate.


This problem renders the AVAssetResourceLoaderDelegate approach problematic as it compromises video playback, perhaps due to all the unnecessary data being passed through to AVPlayer. Hoping that there's a solution as it's helpful to be able to use this approach to intercept AVPlayer data requests.

I'm facing the same problem when implementing the "Cache while Playing" feature

Same problem here, Any Apple guys can reply?

I'm having the same problem ... has anyone made any progress with this?

Please file a bug report using the Apple Bug Reporter (http://developer.apple.com/bugreporter/). Thanks.

AVAssetResourceLoaderDelegate -resourceLoader: didCancelLoadingRequest: naver called (in the Device only)
 
 
Q