Rewrite PlayerService

This commit is contained in:
vfsfitvnm
2022-07-11 10:47:40 +02:00
parent 32aeadf87d
commit abd942d5da
6 changed files with 229 additions and 242 deletions

View File

@@ -10,6 +10,8 @@ val Timeline.mediaItems: List<MediaItem>
getWindow(index, Timeline.Window()).mediaItem
}
val Player.shouldBePlaying: Boolean
get() = !(playbackState == Player.STATE_ENDED || !playWhenReady)
fun Player.forcePlay(mediaItem: MediaItem) {
setMediaItem(mediaItem, true)