Skip to content

Commit

Permalink
fix: missing title and chapters in downloads video player
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Nov 24, 2024
1 parent b153646 commit 06c42b9
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 06c42b9

Please sign in to comment.