Overview
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.
Android SDK using DRMToday (Java, Widevine DRM)
This example is based on "BasicDRMPlayback" which is available in its sample application repository.
1WidevineConfiguration widevineConfiguration =2 (WidevineConfiguration) new DRMConfiguration.Builder()3 .uuid(WidevineConfiguration.UUID)4 .licenseUrl("https://lic.staging.drmtoday.com/license-proxy-widevine/cenc/")5 .putHttpHeader("dt-custom-data","YOUR_CUSTOM_DATA_HERE")6 .build();7widevineConfiguration.setPrepareLicenseCallback(new PrepareLicenseCallback()8{9 @Override10 public byte[] prepareLicense(byte[] licenseResponse)11 {12 String json = new String(licenseResponse);13 try14 {15 JSONObject jsonObject = new JSONObject(json);16 String license = jsonObject.getString("license");17 return android.util.Base64.decode(license, android.util.Base64.DEFAULT);18 }19 catch (JSONException e)20 {21 e.printStackTrace();22 }23 return new byte[0];24 }25});26SourceItem sourceItem = new SourceItem("https://path/to/your-dash-manifest.mpd");27sourceItem.addDRMConfiguration(widevineConfiguration);28sourceConfiguration = new SourceConfiguration();29sourceConfiguration.addSourceItem(sourceItem);3031bitmovinPlayer.load(sourceConfiguration);