ioshttp-live-streamingavkitfairplay

AVAssetImageGenerator with Fairplay/DRM


I have a FairPlay-encrypted HLS stream. I already fetched the CKC, provided the AVContentKeyRequest with it, and played the decrypted video in an AVPlayer.

I now want to generate scrubbing thumbnails using the AVAssetImageGenerator. The manifest references an I-Frame playlist that has the same #EXT-X-KEY tag as the video playlist.

I assumed that I could use the same AVURLAsset and it would work out of the box since it is already linked with the contentKeySession. Unfortunately, it doesn't.

I already tried to respond with the same CKC in resourceLoader(_:shouldWaitForLoadingOfRequestedResource). The delegate function is called with the correct asset id but it doesn't work either and I don't know how to retrieve error messages.

Does anyone know or already managed to get AVAssetImageGenerator running with FPS? Thank you!:)

Note: The thumbnail generation does work when using AVPlayerViewController.


Solution

  • I've reached out to Apple Developer Support:

    AVAssetImageGenerator does not work for encrypted content.

    Instead, another AVPlayer should be used with an AVPlayerLayer of the desired thumbnail size.