fix(deps): update androidx.media3 to v1.1.0 (#427)

* fix(deps): update androidx.media3 to v1.1.0

* fix: implement missing members in `MPVPlayer`

* 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-07-09 11:44:46 +02:00 committed by GitHub
parent b2cfdacdbb
commit 58cbd9cf9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 8 deletions

View file

@ -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"

View file

@ -628,6 +628,14 @@ class MPVPlayer(
TODO("Not yet implemented")
}
override fun replaceMediaItems(
fromIndex: Int,
toIndex: Int,
mediaItems: MutableList<MediaItem>,
) {
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,
)