From 45aac69e82a3c2951d47a3b0d8c1e18de4910755 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Fri, 29 Nov 2024 13:23:30 -0600 Subject: [PATCH] Update media3 --- gradle/libs.versions.toml | 4 ++-- .../media/tts/session/AudioFocusManager.kt | 3 ++- .../media/tts/session/TtsSessionAdapter.kt | 15 --------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 209be02190..792e2dd92c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ androidx-datastore = "1.1.1" androidx-fragment-ktx = "1.8.5" androidx-legacy = "1.0.0" androidx-lifecycle = "2.8.7" -androidx-media3 = "1.4.1" +androidx-media3 = "1.5.0" androidx-navigation = "2.8.4" androidx-paging = "3.3.4" androidx-recyclerview = "1.3.2" @@ -87,7 +87,7 @@ androidx-datastore-preferences = { group = "androidx.datastore", name = "datasto androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "androidx-fragment-ktx" } androidx-legacy-ui = { group = "androidx.legacy", name = "legacy-support-core-ui", version.ref = "androidx-legacy" } androidx-lifecycle-common = { group = "androidx.lifecycle", name = "lifecycle-common-java8", version.ref = "androidx-lifecycle" } -androidx-media3-common = { group = "androidx.media3", name = "media3-common", version.ref = "androidx-media3" } +androidx-media3-common = { group = "androidx.media3", name = "media3-common-ktx", version.ref = "androidx-media3" } androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "androidx-media3" } androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "androidx-media3" } androidx-navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "androidx-navigation" } diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt index 9c58fc2b26..b5be163103 100644 --- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt +++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt @@ -29,6 +29,7 @@ import androidx.media3.common.C import androidx.media3.common.Player import androidx.media3.common.util.Log import androidx.media3.common.util.Util +import java.util.Objects import org.readium.navigator.media.tts.session.AudioFocusManager.PlayerControl @androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class) @@ -134,7 +135,7 @@ internal class AudioFocusManager( * managed automatically. */ fun setAudioAttributes(audioAttributes: AudioAttributes?) { - if (!Util.areEqual(this.audioAttributes, audioAttributes)) { + if (!Objects.equals(this.audioAttributes, audioAttributes)) { this.audioAttributes = audioAttributes focusGainToRequest = convertAudioAttributesToFocusGain(audioAttributes) require( diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt index cc43b6ca4a..bf82d849bf 100644 --- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt +++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt @@ -343,25 +343,10 @@ internal class TtsSessionAdapter( ttsPlayer.nextUtterance() } - @Deprecated("Deprecated in Java", ReplaceWith("hasPreviousMediaItem()")) - override fun hasPrevious(): Boolean { - return hasPreviousMediaItem() - } - - @Deprecated("Deprecated in Java", ReplaceWith("hasPreviousMediaItem()")) - override fun hasPreviousWindow(): Boolean { - return hasPreviousMediaItem() - } - override fun hasPreviousMediaItem(): Boolean { return previousMediaItemIndex != INDEX_UNSET } - @Deprecated("Deprecated in Java", ReplaceWith("TODO(\"Not yet implemented\")")) - override fun previous() { - seekToPreviousMediaItem() - } - @Deprecated("Deprecated in Java", ReplaceWith("TODO(\"Not yet implemented\")")) override fun seekToPreviousWindow() { seekToPreviousMediaItem()