diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a089722..d00df208 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Update Bitmovin's native Android SDK version to `3.142.0+jason` +### Added + +- Android: TweaksConfig option `enableDrmLicenseRenewRetry` to retry renewing a DRM license when the first renewal attempt fails + ## [1.9.0] - 2026-02-13 ### Changed diff --git a/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt b/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt index 7ad21de8..78ee58cd 100644 --- a/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +++ b/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt @@ -181,34 +181,40 @@ private fun String.toForceReuseVideoCodecReason(): ForceReuseVideoCodecReason? = else -> null } -fun Map.toTweaksConfig(): TweaksConfig = TweaksConfig().apply { - withDouble("timeChangedInterval") { timeChangedInterval = it } - withInt("bandwidthEstimateWeightLimit") { - bandwidthMeterType = BandwidthMeterType.Default( - bandwidthEstimateWeightLimit = it, - ) - } - withMap("devicesThatRequireSurfaceWorkaround") { devices -> - val deviceNames = devices.withStringArray("deviceNames") { - it.filterNotNull().map(::DeviceName) - } ?: emptyList() - val modelNames = devices.withStringArray("modelNames") { - it.filterNotNull().map(::DeviceName) - } ?: emptyList() - devicesThatRequireSurfaceWorkaround = deviceNames + modelNames - } - withBoolean("languagePropertyNormalization") { languagePropertyNormalization = it } - withDouble("localDynamicDashWindowUpdateInterval") { localDynamicDashWindowUpdateInterval = it } - withBoolean("useDrmSessionForClearPeriods") { useDrmSessionForClearPeriods = it } - withBoolean("useDrmSessionForClearSources") { useDrmSessionForClearSources = it } - withBoolean("useFiletypeExtractorFallbackForHls") { useFiletypeExtractorFallbackForHls = it } - withStringArray("forceReuseVideoCodecReasons") { - forceReuseVideoCodecReasons = it - .filterNotNull() - .mapNotNull(String::toForceReuseVideoCodecReason) - .toSet() - } -} +fun Map.toTweaksConfig(): TweaksConfig = + TweaksConfig.Builder().apply { + withBoolean("enableDrmLicenseRenewRetry") { setEnableDrmLicenseRenewRetry(it) } + withDouble("timeChangedInterval") { setTimeChangedInterval(it) } + withInt("bandwidthEstimateWeightLimit") { + setBandwidthMeterType( + BandwidthMeterType.Default( + bandwidthEstimateWeightLimit = it, + ) + ) + } + withMap("devicesThatRequireSurfaceWorkaround") { devices -> + val deviceNames = devices.withStringArray("deviceNames") { + it.filterNotNull().map(::DeviceName) + } ?: emptyList() + val modelNames = devices.withStringArray("modelNames") { + it.filterNotNull().map(::DeviceName) + } ?: emptyList() + setDevicesThatRequireSurfaceWorkaround(deviceNames + modelNames) + } + withBoolean("languagePropertyNormalization") { setLanguagePropertyNormalization(it) } + withDouble("localDynamicDashWindowUpdateInterval") { setLocalDynamicDashWindowUpdateInterval(it) } + withBoolean("useDrmSessionForClearPeriods") { setUseDrmSessionForClearPeriods(it) } + withBoolean("useDrmSessionForClearSources") { setUseDrmSessionForClearSources(it) } + withBoolean("useFiletypeExtractorFallbackForHls") { setUseFiletypeExtractorFallbackForHls(it) } + withStringArray("forceReuseVideoCodecReasons") { + setForceReuseVideoCodecReasons( + it + .filterNotNull() + .mapNotNull(String::toForceReuseVideoCodecReason) + .toSet() + ) + } + }.build() fun Map.toAdvertisingConfig(): AdvertisingConfig? { val schedule = getArray("schedule")?.toMapList()?.mapNotNull { it?.toAdItem() } ?: emptyList() diff --git a/src/tweaksConfig.ts b/src/tweaksConfig.ts index 23655068..dced5eaa 100644 --- a/src/tweaksConfig.ts +++ b/src/tweaksConfig.ts @@ -166,6 +166,14 @@ export interface TweaksConfig { * @platform Android */ useFiletypeExtractorFallbackForHls?: boolean; + /** + * If enabled, the player will retry renewing a DRM license in case the first renewal attempt fails. + * This can help maintain playback for long-running sessions where the license might expire. + * + * @defaultValue `false` + * @platform Android + */ + enableDrmLicenseRenewRetry?: boolean; /** * Determines whether `AVKit` should update Now Playing information automatically when using System UI. *