1

I am calling [NSURLProtocol registerClass] to use a custom protocol (Chromium Cronet) when playing a video using AVPlayer. (The register is done at here: )

It works well on iOS simulator (Xcode 11.3) but when runs on an actual device (iPhone SE, iOS 13), the custom protocol was not triggered. (i.e. it's canInitWithRequest method was not called).

My question: what is the possible reason to cause different behavior between iOS simulator and real device in the case of [NSURLProtocol registerClass] ? Anything I can do to fix that for real device?

user1783732
  • 1,599
  • 5
  • 22
  • 44
  • Now I suspect this might be related to whether `AVPlayer` uses the shared NSURLSession object. Anyone knows if `AVPlayer` uses the shared NSURLSession? and whether it depends on env? – user1783732 Feb 10 '20 at 02:38
  • i too have the same issue. did u got the answer – Marios Feb 27 '20 at 06:01
  • @Marios no I didn't get answer. I am using a workaround / solution that implements my own delegate `AVAssetResourceLoaderDelegate`. See this one from me: https://stackoverflow.com/questions/60179072/avplayer-url-custom-loading-for-https – user1783732 Feb 27 '20 at 06:38

0 Answers0