Provides sample apps for the Brightcove Player SDK and Plugins for Android
View the Project on GitHub BrightcoveOS/android-player-samples
Plays a Widevine video whose account uses HDCP fallback: each rendition tier carries a DRM key of its own, the SD key plays on any output, and the HD key only plays over an HDCP-protected one.
The sample keeps both classes of device playing. A protected output adapts up to the HD renditions. An unprotected output stays on the SD renditions, instead of failing with a decrypt error that the player cannot recover from.
| File | Responsibility |
|---|---|
MainActivity.kt |
Attaches the HDCP guard, loads the video and logs every rendition change. |
HdcpFallback.kt |
Reads the HDCP level of the connected output and constrains rendition selection to the SD tier while that output is unprotected. Re-reads the level when a display is attached or detached. |
SET_SOURCE the guard marks the Widevine source with multiSession, because moving
between rendition tiers needs one concurrent DRM session per key.MediaDrm.getConnectedHdcpLevel(), or the vendor hdcpLevel property on API 27
and below, and compares it with the level the licence policy of the account requires for HD.exceedVideoConstraintsIfNecessary, so output protection fails closed.DisplayManager.DisplayListener repeats the check when a display is attached or detached, for
example when an HDMI cable is plugged in during playback.A Brightcove DASH manifest carries the rendition tiers as separate AdaptationSets. Whether the player can adapt across them depends on the manifest:
urn:mpeg:dash:adaptation-set-switching:2016, and the player treats the whole ladder as one.The guard behaves the same either way, which is the point: it constrains selection rather than picking renditions.
MediaDrm.HDCP_NO_DIGITAL_OUTPUT means the device has no digital output at all and is therefore
implicitly secure. It is the highest level, not the lowest, so a phone with nothing plugged in
plays HD.MediaDrm.HDCP_LEVEL_UNKNOWN restricts playback to SD, because a wrong guess costs the viewer
the whole playback.See the DRM README for shared setup and requirements.