A sample demonstrating how to play DRM-protected streams with OptiView Player (formerly THEOplayer) using a custom Widevine content protection integration.
The app implements a custom ContentProtectionIntegration for Axinom Widevine DRM, intercepting
license requests to add authentication tokens. It uses Jetpack Compose with DefaultUI for the player UI.
PlayerActivity sets up Compose
with DefaultUI and registers a custom ContentProtectionIntegration for Axinom Widevine DRM.
The integration factory (AxinomWidevineContentProtectionIntegrationFactory) and integration class
intercept license requests to inject the required authorization token. You can find more information
about Open Video UI here.
- Open this repository in Android Studio.
- Select the
drm-playbackrun configuration. - Build and run on a real device.
This project uses THEOplayer from the official Maven repository.
The repository is declared in the project-level settings.gradle.kts:
dependencyResolutionManagement {
repositories {
maven { url = uri("https://maven.theoplayer.com/releases") }
}
}Dependencies are managed through a version catalog and declared
in the module-level build.gradle.kts:
dependencies {
implementation(libs.theoplayer)
implementation(libs.theoplayer.ui)
}To play your own streams, add a THEOplayer license from the THEOportal in
common/src/main/res/values/values.xml:
<string name="theoplayer_license">YOUR_LICENSE_HERE</string>The license is picked up automatically via the <meta-data> tag in
AndroidManifest.xml.
Video sources are defined in SourceManager.
You can find more information about DRM connectors on its own repo here.
This project is licensed under the BSD 3 Clause License - see the LICENSE file for details.