From 1a8e71a8a9d93945b11a37bdc1397049ba73fefa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Feb 2023 12:22:13 +0100 Subject: [PATCH] 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 --- gradle/libs.versions.toml | 2 +- .../java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 37031939..17b38175 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" diff --git a/player/video/src/main/java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt b/player/video/src/main/java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt index 9a9ec664..93382c34 100644 --- a/player/video/src/main/java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt +++ b/player/video/src/main/java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt @@ -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() } }