From b58b596488d26918bd88e8242dacc0be7a89d046 Mon Sep 17 00:00:00 2001 From: AJ Lauer Barinov Date: Thu, 12 Sep 2024 13:51:31 -0700 Subject: [PATCH] feat: set drm type by default --- library/src/main/java/com/mux/player/MuxPlayer.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/library/src/main/java/com/mux/player/MuxPlayer.kt b/library/src/main/java/com/mux/player/MuxPlayer.kt index a5431cb..af905a2 100644 --- a/library/src/main/java/com/mux/player/MuxPlayer.kt +++ b/library/src/main/java/com/mux/player/MuxPlayer.kt @@ -71,7 +71,16 @@ class MuxPlayer private constructor( exoPlayer.addListener(object : Listener { // more listener methods here if required override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) { - //muxStats?.videoChange(CustomerVideoData()) + // Check if a DRM token is set, set View Drm Type if it is + // TODO: escape hatch TBA + CustomerViewData viewData = CustomerViewData() + viewData.viewDrmType = "widevine" // TODO: make this a constant + if (mediaItem.requestMetadata.extras.getString(Constants.BUNDLE_DRM_TOKEN)) { + // TODO: Confirm this doesn't overwrite other keys like view session ID to null + muxStats?.updateCustomerData( + null, null, viewData + ) + } } })