Skip to content

Commit

Permalink
feat: set drm type by default
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjl-mux committed Sep 12, 2024
1 parent fb0f54c commit b58b596
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion library/src/main/java/com/mux/player/MuxPlayer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}
})

Expand Down

0 comments on commit b58b596

Please sign in to comment.