Skip to content

Instantly share code, notes, and snippets.

@Oleur
Created November 24, 2020 14:57
Show Gist options
  • Save Oleur/bb07ce9dae4de05ded28120bb30f127e to your computer and use it in GitHub Desktop.
Save Oleur/bb07ce9dae4de05ded28120bb30f127e to your computer and use it in GitHub Desktop.
private fun buildMediaSource(uri: Uri, drmSessionManager: DrmSessionManager<FrameworkMediaCrypto>): MediaSource? {
when (val type = PlayerUtils.inferContentType(videoUrl)) {
...
C.TYPE_OTHER -> {
return if (videoUrl.isSmb()) {
ProgressiveMediaSource.Factory(SmbDataSourceFactory(videoUrl))
.setDrmSessionManager(drmSessionManager)
.createMediaSource(uri)
} else {
ProgressiveMediaSource.Factory(mediaDataSourceFactory)
.setDrmSessionManager(drmSessionManager)
.createMediaSource(uri)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment