adapt landscape direction

This commit is contained in:
2026-09-26 20:38:09 +08:00
parent 027171cf59
commit cf7a5ed2ed
15 changed files with 1264 additions and 148 deletions
@@ -223,6 +223,7 @@ actual class PlayerController(context: Context) {
}
actual fun play() {
if (player.mediaItemCount == 0) return
player.play()
}
@@ -231,6 +232,10 @@ actual class PlayerController(context: Context) {
}
actual fun toggle() {
if (player.mediaItemCount == 0) {
if (player.isPlaying) pause()
return
}
if (player.isPlaying) pause() else play()
}
@@ -646,7 +646,8 @@ actual class PlayerController {
actual fun play() {
ensureAudioReady()
val current = _state.value.current
if (loadedUri.isNullOrBlank() && current != null) {
if (current == null) return
if (loadedUri.isNullOrBlank()) {
playWhenReady = false
AppLog.e(TAG, "play() abort reason=noLoadedUri id=${current.musicId}")
_state.update { it.copy(isPlaying = false, error = "No playable URI") }
@@ -674,6 +675,10 @@ actual class PlayerController {
}
actual fun toggle() {
if (_state.value.current == null) {
if (_state.value.isPlaying) pause()
return
}
if (_state.value.isPlaying) pause() else play()
}