mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
Merge pull request #6820 from Bnyro/master
fix: missing title and chapters in downloads video player
This commit is contained in:
commit
eaa5450f42
@ -193,9 +193,7 @@ class OfflinePlayerActivity : BaseActivity() {
|
||||
binding.playerGestureControlsView.binding,
|
||||
chaptersViewModel
|
||||
)
|
||||
}
|
||||
|
||||
private fun playVideo() {
|
||||
lifecycleScope.launch {
|
||||
val (downloadInfo, downloadItems, downloadChapters) = withContext(Dispatchers.IO) {
|
||||
Database.downloadDao().findById(videoId)
|
||||
@ -205,11 +203,10 @@ class OfflinePlayerActivity : BaseActivity() {
|
||||
chaptersViewModel.chaptersLiveData.value = chapters
|
||||
binding.player.setChapters(chapters)
|
||||
|
||||
val downloadFiles = downloadItems.filter { it.path.exists() }
|
||||
playerBinding.exoTitle.text = downloadInfo.title
|
||||
playerBinding.exoTitle.isVisible = true
|
||||
|
||||
timeFrameReceiver = downloadFiles.firstOrNull { it.type == FileType.VIDEO }?.path?.let {
|
||||
timeFrameReceiver = downloadItems.firstOrNull { it.path.exists() && it.type == FileType.VIDEO }?.path?.let {
|
||||
OfflineTimeFrameReceiver(this@OfflinePlayerActivity, it)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user