Questions tagged [avassetresourceloaderdelegate]

8 questions
5
votes
1 answer

How can I use AVAssetDownloadTask to download a FairPlay-encrypted AVURLAsset instance that has not yet been streamed?

I'm trying to use AVAssetDownloadTask to download and play FairPlay-encrypted audio content offline. I kept getting an error like this in urlSession:task:didCompleteWithError:: Error Domain=AVFoundationErrorDomain Code=-11863 "Operation Stopped"…
Tom Hamming
  • 10,577
  • 11
  • 71
  • 145
4
votes
1 answer

Fairplay stops working on iOS 12.4 and 13

I have code to play encrypted Fairplay streams from my app and it works fine prior iOS 12.4. I use AVAssetResourceLoaderDelegate to get AVAssetResourceLoadingRequest from resourceLoader:shouldWaitForLoadingOfRequestedResource: and then extract SPC…
3
votes
1 answer

Can AVAssetResourceLoader (and AVAssetResourceLoaderDelegate) be used to limit the choices of streams to increase quality?

iOS (seemingly especially with iOS 15), isn't always the best at taking an HLS m3u8 playlist with multiple playback quality options and selecting the best one to play. For instance even with a great internet connection, iOS will often pick one of…
3
votes
1 answer

HLS Stream Using AVAssetResourceLoaderDelegate TS Fragment Requests Missing Cookie Header

I am using the AVAssetResourceLoadingDelegate to intercept all manifest requests for an HLS Manifest let str = "examplehttp://example.com/path/to/master.m3u8?token=SOMETOKEN" guard let url = URL(string: str) else { return } let asset =…
3
votes
0 answers

What is the UTI (Uniform Type Identifier) of an AAC audio file on iOS?

I need to know what the Uniform Type Identifier is for an AAC audio file. Context: I'm building an audio player app that plays DRM'd AAC files using HLS. I want to support offline playback, but I don't want to use AVFoundation's offline stuff (via…
Tom Hamming
  • 10,577
  • 11
  • 71
  • 145
2
votes
0 answers

How to force AVPlayer to fail when AVAssetResourceLoadingRequest's finishLoadingWithError(err) is called

I want to force AVPlayer to throw the player error, either through the playerFailedToReachEnd notification or observe player.status via KVO, when during the process of loading resource request via AVAssetResourceLoader that the request is finished…
2
votes
0 answers

Video couldn't be played properly under iOS12

I'm using AVAssetResourceLoader to load data and AVPlayerViewController to play. It works properly under iOS10, 11 but not work any more under iOS12. When playing, the process bar is moving forward, but the video only plays 1 sec, and stuck till…
Yukkkkki
  • 21
  • 1
1
vote
1 answer

AVPlayer URL custom loading for HTTPS

I'm trying to use AVPlayer with custom URL loading (a custom NSURLProtocol subclass). But it seems [NSURLProtocol registerClass] does not work with AVPlayer in real device (see this thread). Now I'm trying to use AVAssetResourceLoaderDelegate to do…
user1783732
  • 1,599
  • 5
  • 22
  • 44