Make PlayerBottomSheet composable smart recompose

This commit is contained in:
vfsfitvnm
2022-07-22 10:26:12 +02:00
parent 707fee1b29
commit bc76533512
5 changed files with 77 additions and 43 deletions

View File

@@ -10,6 +10,11 @@ val Timeline.mediaItems: List<MediaItem>
getWindow(index, Timeline.Window()).mediaItem
}
val Timeline.windows: List<Timeline.Window>
get() = (0 until windowCount).map { index ->
getWindow(index, Timeline.Window())
}
val Player.shouldBePlaying: Boolean
get() = !(playbackState == Player.STATE_ENDED || !playWhenReady)