mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-24 03:36:51 +00:00
feat(player): track skippable segment type to gate intro and outro UI
Expose the active skippable segment type from the player state so the UI can show the skip intro button only for intro segments and trigger the next episode overlay when an outro segment is active.
This commit is contained in:
@@ -62,6 +62,7 @@ import androidx.media3.ui.PlayerView
|
||||
import androidx.media3.ui.SubtitleView
|
||||
import hu.bbara.purefin.core.player.model.TimedMarker
|
||||
import hu.bbara.purefin.core.player.viewmodel.PlayerViewModel
|
||||
import hu.bbara.purefin.model.SegmentType
|
||||
import hu.bbara.purefin.ui.common.visual.ValueChangeTimedVisibility
|
||||
import hu.bbara.purefin.ui.screen.player.components.PlayerSeekBarTrack
|
||||
import hu.bbara.purefin.ui.screen.player.components.TvIconButton
|
||||
@@ -179,11 +180,12 @@ fun TvPlayerScreen(
|
||||
|
||||
val showSkipIntroButton = !controlsVisible
|
||||
&& uiState.activeSkippableSegmentEndMs != null
|
||||
&& uiState.activeSkippableSegmentType == SegmentType.INTRO
|
||||
&& !uiState.isEnded
|
||||
val showNextEpisodeOverlay = !controlsVisible
|
||||
&& uiState.nextEpisode != null
|
||||
&& uiState.durationMs > 0L
|
||||
&& (uiState.durationMs - uiState.positionMs) <= 60_000L
|
||||
&& ((uiState.durationMs - uiState.positionMs) <= 30_000L || uiState.activeSkippableSegmentType == SegmentType.OUTRO)
|
||||
&& !uiState.isEnded
|
||||
LaunchedEffect(showSkipIntroButton, showNextEpisodeOverlay) {
|
||||
rootFocusRequester = when {
|
||||
|
||||
Reference in New Issue
Block a user