mirror of
https://github.com/bbara04/Purefin.git
synced 2026-04-01 01:30:08 +02:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user