Use the correct setMediaItems overload to make onPlaybackStatsReady behave correctly
This commit is contained in:
parent
6d2b075720
commit
ff611d792e
2 changed files with 3 additions and 4 deletions
|
@ -379,9 +379,9 @@ class PlayerService : InvincibleService(), Player.Listener, PlaybackStatsListene
|
|||
.setCustomCacheKey(mediaItem.mediaItem.mediaId)
|
||||
.build()
|
||||
},
|
||||
true
|
||||
index,
|
||||
queuedSong[index].position ?: C.TIME_UNSET
|
||||
)
|
||||
player.seekTo(index, queuedSong[index].position ?: 0)
|
||||
player.prepare()
|
||||
|
||||
isNotificationStarted = true
|
||||
|
|
|
@ -43,9 +43,8 @@ fun Player.forcePlay(mediaItem: MediaItem) {
|
|||
fun Player.forcePlayAtIndex(mediaItems: List<MediaItem>, mediaItemIndex: Int) {
|
||||
if (mediaItems.isEmpty()) return
|
||||
|
||||
setMediaItems(mediaItems, true)
|
||||
setMediaItems(mediaItems, mediaItemIndex, C.TIME_UNSET)
|
||||
playWhenReady = true
|
||||
seekToDefaultPosition(mediaItemIndex)
|
||||
prepare()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue