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 1e861d7ab7
commit 7d5eeaf7fa
12 changed files with 872 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import hu.bbara.purefin.core.data.MediaRepository
import hu.bbara.purefin.core.data.navigation.NavigationManager
import hu.bbara.purefin.core.data.navigation.Route
import hu.bbara.purefin.core.model.Episode
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
@@ -38,6 +39,11 @@ class EpisodeScreenViewModel @Inject constructor(
navigationManager.pop()
}
fun onPlay() {
val id = _episodeId.value?.toString() ?: return
navigationManager.navigate(Route.PlayerRoute(mediaId = id))
}
fun selectEpisode(seriesId: UUID, seasonId: UUID, episodeId: UUID) {
_episodeId.value = episodeId
}

View File

@@ -33,6 +33,10 @@ class MovieScreenViewModel @Inject constructor(
navigationManager.pop()
}
fun onPlay() {
val id = _movie.value?.id?.toString() ?: return
navigationManager.navigate(Route.PlayerRoute(mediaId = id))
}
fun onGoHome() {
navigationManager.replaceAll(Route.Home)