Adding DRM Information
The example code shows how to use the LuraPlayer to play encrypted content protected with Digital Rights Management (DRM) systems. LuraPlayer currently supports Fairplay.
For fairplay, the license url and fairplay certificate data properties must be specified.
The provided URLs will be used by the LuraPlayer to obtain the necessary licenses and certificates required to decrypt and play the encrypted content.
Swift
let aktaMedia = AktaMedia()
var drmData = AktaDrmData()
drmData.licenseUrl = URL(string: "License URL")
drmData.certificateData = Data(base64Encoded: "Base 64 encoded certificate")
aktaMedia.mediaUrl = contentUrl
aktaMedia.drmData = drmData
self?.player?.load(media: aktaMedia, completion: { [weak self] loaded, error in
if loaded {
self?.player?.play()
}
})