Update androidx-media3 to v1.0.0-rc01 (#296)

* Update androidx-media3 to v1.0.0-rc01

* fix: add new arguments to `seekTo` method

* lint: run ktlintFormat

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jarne Demeulemeester <jarnedemeulemeester@gmail.com>
This commit is contained in:
renovate[bot] 2023-02-18 12:22:13 +01:00 committed by GitHub
parent 71d80590c1
commit 1a8e71a8a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View file

@ -7,7 +7,7 @@ androidx-constraintlayout = "2.1.4"
androidx-core = "1.9.0"
androidx-leanback = "1.2.0-alpha02"
androidx-lifecycle = "2.5.1"
androidx-media3 = "1.0.0-beta03"
androidx-media3 = "1.0.0-rc01"
androidx-navigation = "2.5.3"
androidx-paging = "3.1.1"
androidx-preference = "1.2.0"

View file

@ -797,14 +797,21 @@ class MPVPlayer(
/**
* Seeks to a position specified in milliseconds in the specified window.
*
* @param windowIndex The index of the window.
* @param mediaItemIndex The index of the window.
* @param positionMs The seek position in the specified window, or [C.TIME_UNSET] to seek to
* the window's default position.
* @param seekCommand The {@link Player.Command} used to trigger the seek.
* @param isRepeatingCurrentItem Whether this seeks repeats the current item.
* @throws androidx.media3.common.IllegalSeekPositionException If the player has a non-empty timeline and the provided
* `windowIndex` is not within the bounds of the current timeline.
*/
override fun seekTo(windowIndex: Int, positionMs: Long) {
if (windowIndex == currentMediaItemIndex) {
override fun seekTo(
mediaItemIndex: Int,
positionMs: Long,
@Player.Command seekCommand: Int,
isRepeatingCurrentItem: Boolean
) {
if (mediaItemIndex == currentMediaItemIndex) {
val seekTo =
if (positionMs != C.TIME_UNSET) positionMs / C.MILLIS_PER_SECOND else initialSeekTo
initialSeekTo = if (isPlayerReady) {
@ -814,7 +821,7 @@ class MPVPlayer(
seekTo
}
} else {
prepareMediaItem(windowIndex)
prepareMediaItem(mediaItemIndex)
play()
}
}