Skip to content

Commit

Permalink
[APT-9543] Combine HLS and Dash download generators
Browse files Browse the repository at this point in the history
  • Loading branch information
kschults committed Dec 6, 2023
1 parent 90507f8 commit e5b9ce6
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.google.android.exoplayer2.offline.DownloadManager
import com.google.android.exoplayer2.offline.DownloadRequest
import com.google.android.exoplayer2.offline.DownloadService
import com.google.android.exoplayer2.upstream.DefaultDataSource
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource
import com.google.android.exoplayer2.util.Util
import com.scribd.armadillo.Constants
Expand Down Expand Up @@ -94,8 +93,7 @@ internal class ExoplayerDownloadEngine @Inject constructor(private val context:
.setUri(uri)
.build()
return when (@C.ContentType val type = Util.inferContentType(uri)) {
C.TYPE_HLS ->
DownloadHelper.forMediaItem(context, mediaItem, renderersFactory, DefaultDataSource.Factory(context, dataSourceFactory))
C.TYPE_HLS,
C.TYPE_DASH ->
DownloadHelper.forMediaItem(context, mediaItem, renderersFactory, DefaultDataSource.Factory(context, dataSourceFactory))
C.TYPE_OTHER -> DownloadHelper.forMediaItem(context, mediaItem)
Expand Down

0 comments on commit e5b9ce6

Please sign in to comment.