跳到主要内容

DRM

To play DRM-protected videos, please specify license server URLs and options with DRM.

BlendVision One drmUrl can be found on here, and playbackToken is the same token to start a playback session

val DRM_KEY = "x-custom-data"
val DRM_VALUE = "token_type=upfront&token_value=$PLAYBACK_TOKEN"

val mediaConfig = MediaConfig(
source = MediaConfig.Source(
...
drm = MeidaConfig.DrmInfo.Widevine(
licenseUrl = "$DRM_LICENSE_URL",
headers = mapOf(DRM_KEY to DRM_VALUE)
)
),
...
)

player.load(mediaConfig)