mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
refactor: Use listOfNotNull
This commit is contained in:
parent
dfee1e5b76
commit
e76e7780d4
@ -168,9 +168,7 @@ class OfflinePlayerActivity : BaseActivity() {
|
||||
videoUri != null && audioUri != null -> {
|
||||
val videoItem = MediaItem.Builder()
|
||||
.setUri(videoUri)
|
||||
.apply {
|
||||
if (subtitle != null) setSubtitleConfigurations(listOf(subtitle))
|
||||
}
|
||||
.setSubtitleConfigurations(listOfNotNull(subtitle))
|
||||
.build()
|
||||
|
||||
val videoSource = ProgressiveMediaSource.Factory(FileDataSource.Factory())
|
||||
@ -193,18 +191,14 @@ class OfflinePlayerActivity : BaseActivity() {
|
||||
videoUri != null -> player.setMediaItem(
|
||||
MediaItem.Builder()
|
||||
.setUri(videoUri)
|
||||
.apply {
|
||||
if (subtitle != null) setSubtitleConfigurations(listOf(subtitle))
|
||||
}
|
||||
.setSubtitleConfigurations(listOfNotNull(subtitle))
|
||||
.build()
|
||||
)
|
||||
|
||||
audioUri != null -> player.setMediaItem(
|
||||
MediaItem.Builder()
|
||||
.setUri(audioUri)
|
||||
.apply {
|
||||
if (subtitle != null) setSubtitleConfigurations(listOf(subtitle))
|
||||
}
|
||||
.setSubtitleConfigurations(listOfNotNull(subtitle))
|
||||
.build()
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user