Digital rights management

With the Wowza Flowplayer Android SDK, you can take advantage of digital rights management (DRM) technology to protect how viewers access and use player media content within your Android application. DRM aims to protect copyright holders by preventing content from unauthorized distribution and modifications.

Configure DRM

If you prepare the player using the FlowplayerMedia class, the media defined in the player configuration is DRM-protected, and the player automatically takes care of content protection.

However, you can also use the ExternalMedia class to load media files with DRM-protected content. In this case, when you initialize your media instance, use the DrmConfig class to define your DRM protection scheme and its properties:

Copy
Copied
// Set up a DRM object with scheme and license server information
val drmConfig = DrmConfig(DrmConfig.Scheme.WIDEVINE, "https://link.to.a.drm.license")

// Pass the URL to play your media and DRM settings to your externalMedia object
val externalMedia = ExternalMedia("https://link.to.a.media.file", drmConfig)

// Prepare your flowplayer instance, passing your external media with DRM protection settings
flowplayer.prepare(externalMedia)

Supported DRM schemes

The Wowza Flowplayer Android SDK uses Media3 ExoPlayer and Android's MediaDrm API to support DRM-protected playbacks.

Not every Android version supports every single DRM scheme. The following table lists the minimum Android versions required for different DRM schemes, along with the streaming formats that are supported for each.

DRM scheme Android version number Android API level Supported formats
Widevine "cenc" 4.4 19 DASH, HLS (FMP4 only)
Widevine "cbcs" 7.1 25 DASH, HLS (FMP4 only)
ClearKey "cenc" 5.0 21 DASH
PlayReady SL2000 "cenc" AndroidTV AndroidTV DASH, SmoothStreaming, HLS (FMP4 only)

If you plan to use a specific DRM scheme, we suggest you introduce a runtime check to ensure that the Android version number and Android API level meet the requirements in the preceding table. For example, this code snippet checks for API level 21 and above so you can use ClearKey:

Copy
Copied
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.L) {
    val clearKeyDrm = DrmConfig(CLEAR_KEY, "https://link.to.a.clearkey.license.url")
    flowplayer.prepare(ExternalMedia("https://link.to.a.manifest.url", clearKeyDrm))
} else {
    // Show an error to the user and abort playback, or fallback to another drm like this
    val widevineDrm = DrmConfig(WIDEVINE, "https://link.to.a.widevine.license.url")
    flowplayer.prepare(ExternalMedia("https://link.to.a.manifest.url", widevineDrm))
}

For more, see Android's Digital rights management guide.