跳到主要内容

DRM

To play DRM-protected videos, please specify license server URLs and options with DRM.

BlendVision One drmUrl can be found on here, and playbackToken is the same token to start a playback session

if let licenseString = "https://drm.platform-qa.kkstream.io/api/v3/drm/license",
let fairplayCertString = "https://drm.platform-qa.kkstream.io/api/v3/drm/license/fairplay_cert",
let licenseUrl = URL(string: licenseString),
let certUrl = URL(string: fairplayCertString) {

// Create drm configuration
let fpsConfig = UniFairPlayConfig(licenseUrl: licenseUrl, certificateUrl: certUrl)

// Example of how message request data can be prepared if custom modifications are needed
fpsConfig.prepareMessage = { spcData, assetId in
spcData
}

// Example of how certificate data can be prepared if custom modifications are needed
fpsConfig.prepareCertificate = { (data: Data) -> Data in
// Do something with the loaded certificate
return data
}

fpsConfig.certificateRequestHeaders = "certificate header"
fpsConfig.licenseRequestHeaders = "license header"
sourceConfig.drmConfig = fpsConfig
}