diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e78412dd..7130d17a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ androidx-constraintlayout = "2.1.4" androidx-core = "1.10.1" androidx-hilt = "1.0.0" androidx-lifecycle = "2.6.1" -androidx-media3 = "1.0.2" +androidx-media3 = "1.1.0" androidx-navigation = "2.6.0" 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 be5ac865..49004c8f 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 @@ -628,6 +628,14 @@ class MPVPlayer( TODO("Not yet implemented") } + override fun replaceMediaItems( + fromIndex: Int, + toIndex: Int, + mediaItems: MutableList, + ) { + TODO("Not yet implemented") + } + /** * Removes a range of media items from the playlist. * @@ -931,11 +939,6 @@ class MPVPlayer( MPVLib.command(arrayOf("stop", "keep-playlist")) } - @Deprecated("Deprecated in Java") - override fun stop(reset: Boolean) { - MPVLib.command(arrayOf("stop", "keep-playlist")) - } - /** * Releases the player. This method must be called when the player is no longer required. The * player must not be used after calling this method. @@ -1217,7 +1220,10 @@ class MPVPlayer( /** Gets the device information. */ override fun getDeviceInfo(): DeviceInfo { - return DeviceInfo(DeviceInfo.PLAYBACK_TYPE_LOCAL, 0, 100) + return DeviceInfo.Builder(DeviceInfo.PLAYBACK_TYPE_LOCAL) + .setMaxVolume(0) + .setMaxVolume(100) + .build() } /** @@ -1247,25 +1253,45 @@ class MPVPlayer( * * @param volume The volume to set. */ + @Deprecated("Deprecated in Java") override fun setDeviceVolume(volume: Int) { throw IllegalArgumentException("You should use global volume controls. Check out AUDIO_SERVICE.") } + override fun setDeviceVolume(volume: Int, flags: Int) { + MPVLib.setPropertyInt("volume", volume) + } + /** Increases the volume of the device. */ + @Deprecated("Deprecated in Java") override fun increaseDeviceVolume() { throw IllegalArgumentException("You should use global volume controls. Check out AUDIO_SERVICE.") } + override fun increaseDeviceVolume(flags: Int) { + throw IllegalArgumentException("You should use global volume controls. Check out AUDIO_SERVICE.") + } + /** Decreases the volume of the device. */ + @Deprecated("Deprecated in Java") override fun decreaseDeviceVolume() { throw IllegalArgumentException("You should use global volume controls. Check out AUDIO_SERVICE.") } + override fun decreaseDeviceVolume(flags: Int) { + throw IllegalArgumentException("You should use global volume controls. Check out AUDIO_SERVICE.") + } + /** Sets the mute state of the device. */ + @Deprecated("Deprecated in Java") override fun setDeviceMuted(muted: Boolean) { throw IllegalArgumentException("You should use global volume controls. Check out AUDIO_SERVICE.") } + override fun setDeviceMuted(muted: Boolean, flags: Int) { + return MPVLib.setPropertyBoolean("mute", muted) + } + fun updateZoomMode(enabled: Boolean) { if (enabled) { MPVLib.setOptionString("panscan", "1") @@ -1289,7 +1315,7 @@ class MPVPlayer( COMMAND_PLAY_PAUSE, COMMAND_SET_SPEED_AND_PITCH, COMMAND_GET_CURRENT_MEDIA_ITEM, - COMMAND_GET_MEDIA_ITEMS_METADATA, + COMMAND_GET_METADATA, COMMAND_CHANGE_MEDIA_ITEMS, COMMAND_SET_VIDEO_SURFACE, )