diff --git a/Armadillo/src/main/java/com/scribd/armadillo/download/drm/DashDrmLicenseDownloader.kt b/Armadillo/src/main/java/com/scribd/armadillo/download/drm/DashDrmLicenseDownloader.kt index 8794ed5..ca2a2a2 100644 --- a/Armadillo/src/main/java/com/scribd/armadillo/download/drm/DashDrmLicenseDownloader.kt +++ b/Armadillo/src/main/java/com/scribd/armadillo/download/drm/DashDrmLicenseDownloader.kt @@ -29,9 +29,9 @@ internal class DashDrmLicenseDownloader @Inject constructor(context: Context) : drmInfo: DrmInfo, ): DrmDownload { // Update data source for DRM license to add any DRM-specific request headers - drmDataSourceFactory.addCustomHeaders(drmInfo.drmHeaders) + drmDataSourceFactory.setDefaultRequestProperties(drmInfo.drmHeaders) // Update data source for audio to add custom headers - audioDataSourceFactory.addCustomHeaders(customRequestHeaders) + audioDataSourceFactory.setDefaultRequestProperties(customRequestHeaders) // Create helper to download DRM license val offlineHelper = when (drmInfo.drmType) { @@ -66,10 +66,4 @@ internal class DashDrmLicenseDownloader @Inject constructor(context: Context) : throw DrmDownloadException(e) } } - - private fun DefaultHttpDataSource.Factory.addCustomHeaders(customHeaders: Map) { - customHeaders.takeIf { it.isNotEmpty() }?.let { headers -> - setDefaultRequestProperties(headers) - } - } } \ No newline at end of file