DefaultFairplayHandler

extension DefaultFairplayHandler: AVContentKeySessionDelegate
  • The following delegate callback gets called when the client initiates a key request or AVFoundation determines that the content is encrypted based on the playlist the client provided when it requests playback.

    Declaration

    Swift

    public func contentKeySession(
        _ session: AVContentKeySession,
        didProvide keyRequest: AVContentKeyRequest
    )
  • Provides the receiver with a new content key request representing a renewal of an existing content key. Will be invoked by an AVContentKeySession as the result of a call to -renewExpiringResponseDataForContentKeyRequest:.

    Declaration

    Swift

    public func contentKeySession(
        _ session: AVContentKeySession,
        didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest
    )
  • Provides a content key request to the receiver that should be retried because a previous content key request failed. Will be invoked by an AVContentKeySession when a content key request should be retried. The reason for failure of previous content key request is specified. The receiver can decide if it wants to request AVContentKeySession to retry this key request based on the reason. If the receiver returns true, AVContentKeySession would restart the key request process. If the receiver returns false or if it does not implement this delegate method, the content key request would fail and AVContentKeySession would let the receiver know through -contentKeySession:contentKeyRequest:didFailWithError:.

    Declaration

    Swift

    public func contentKeySession(
        _ session: AVContentKeySession,
        shouldRetry keyRequest: AVContentKeyRequest,
        reason retryReason: AVContentKeyRequest.RetryReason
    ) -> Bool
  • Indicates that the content key request should be retried because an obsolete key response was set on the previous content key request.

    Declaration

    Swift

    public func contentKeySession(
        _ session: AVContentKeySession,
        contentKeyRequest keyRequest: AVContentKeyRequest,
        didFailWithError error: Error
    )