Hi @SumayyaS , thanks for the response!
I've updated my code to use processContentKeyRequest, but the delegate doesn't fire unless I also initialize an AVPlayer.
When I call processContentKeyRequest alone with the identifier, nothing happens. However, as soon as I create an AVPlayerItem and AVPlayer with the asset, the delegate triggers immediately.
Am I missing a step to trigger the request manually without an AVPlayer? I’d appreciate any further insights!
Here is my code:
func renewLicense(for asset: AVURLAsset) {
// get identifier from asset URL
let identifier = asset.url.pathComponents[3]
isRenew = true
contentKeySession.addContentKeyRecipient(asset)
contentKeySession.processContentKeyRequest(withIdentifier: identifier, initializationData: nil)
let item = AVPlayerItem(asset: asset)
let _ = AVPlayer(playerItem: item)
}
Topic:
Media Technologies
SubTopic:
Video
Tags: