Instance Method

setDelegate(_:queue:)

Sets the receiver's delegate and indicates the dispatch queues used.

Declaration

func setDelegate(_ delegate: AVContentKeySessionDelegate?, queue delegateQueue: DispatchQueue?)

Parameters

delegate

An object that conforms to the AVContentKeySessionDelegate protocol.

delegateQueue

The dispatch queue used to process delegate methods.

Discussion

The dispatch queue is used when processes requiring content keys are executed asynchronously. Passing a value of nil for the dispatch queue along, with a non-nil value for the delegate, results in an invalid argument exception.

See Also

Initializing the Content Key Request Process

var delegate: AVContentKeySessionDelegate?

The delegate for the receiver.

protocol AVContentKeySessionDelegate

The protocol you implement to handle content key requests.

var delegateQueue: DispatchQueue?

The dispatch queue that invokes delegate callbacks.

func addContentKeyRecipient(AVContentKeyRecipient)

Tells the receiver that the specified recipient should have access to the decryption keys loaded with the session.

var contentKeyRecipients: [AVContentKeyRecipient]

An array of content key recipients.

protocol AVContentKeyRecipient

A protocol for requiring decryption keys for media data.

func processContentKeyRequest(withIdentifier: Any?, initializationData: Data?, options: [String : Any]?)

Tells the receiver to start loading the content decryption key with the specified identifier and initialization data.