feat: add player screen to TV app via compose navigation

- Add PlayerRoute to the Route sealed interface
- Refactor PlayerViewModel to expose loadMedia() for external callers
- Add onPlay() to EpisodeScreenViewModel and MovieScreenViewModel
- Wire play/resume buttons in TV episode and movie screens
- Create TvPlayerScreen with TV-optimized controls: seek bar, playback
  buttons, track selection panels, queue panel, and state cards
- Register PlayerRoute in TvRouteEntryBuilder and TvNavigationModule
- Add media3-ui dependency to app-tv module
This commit is contained in:
2026-02-21 11:09:15 +01:00
parent f85ecc04c7
commit 6f34190ed0
12 changed files with 872 additions and 2 deletions

View File

@@ -21,4 +21,7 @@ sealed interface Route : NavKey {
@Serializable
data object LoginRoute : Route
@Serializable
data class PlayerRoute(val mediaId: String) : Route
}

View File

@@ -124,6 +124,15 @@ class PlayerViewModel @Inject constructor(
private fun loadInitialMedia() {
val id = mediaId ?: return
loadMediaById(id)
}
fun loadMedia(id: String) {
if (mediaId != null) return // Already loading from SavedStateHandle
loadMediaById(id)
}
private fun loadMediaById(id: String) {
val uuid = id.toUuidOrNull()
if (uuid == null) {
dataErrorMessage = "Invalid media id"