[object Object] Icon

Learn how to create, start, manage and modify Encodings

[object Object] Icon

Learn how to create, start, manage and modify Players

[object Object] Icon

Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Thu Sep 13 2018

How to setup Bitmovin iOS SDK with iStreamPlanet content

OverviewLink Icon

Nearly every DRM license provider does have customized DRM workflow in place, which is different to the default approach, especially when it comes to Fairplay DRM. In order to support those custom requirements, each Bitmovin native SDK does support the same customizable callbacks as the HTML5 player, so you can adjust the DRM requests to the needs of your DRM provider accordingly.

If you are not yet familiar with the Bitmovin SDK, please see the related blog post and have a look at the demo applications available in our iOS sample applications or Android sample applications repository.

iOS SDK (Swift, Fairplay DRM)Link Icon

This example is based on the "BasicDRMPlayback" which is available in its sample application repository.

1let fpsConfig = FairplayConfiguration(license: drmLicenseUrl, certificateURL: drmCertificateUrl)
2fpsConfig.prepareCertificate = { (data: Data) -> Data in
3 guard let certString = String(data: data, encoding: .utf8),
4 let certResult = Data(base64Encoded: certString.replacingOccurrences(of: "\"", with: "")) else {
5 return data
6 }
7 return certResult
10fpsConfig.prepareContentId = { (contentId: String) -> String in
11 let prepared = contentId.replacingOccurrences(of: "skd://", with: "")
12 let components : [String] = prepared.components(separatedBy: "/")
13 return components[2]
16fpsConfig.prepareMessage = { (spcData: Data, assetID: String) -> Data in
17 return spcData
20fpsConfig.prepareLicense = { (ckcData: Data) -> Data in
21 guard let ckcString = String(data: ckcData, encoding: .utf8),
22 let ckcResult = Data(base64Encoded: ckcString.replacingOccurrences(of: "\"", with: "")) else {
23 return ckcData
24 }
25 return ckcResult

Give us feedback