horologist icon indicating copy to clipboard operation
horologist copied to clipboard

AnimatedPlayPauseProgressButton "flashes" when seeking forwards or backwards within the same file.

Open Digipom opened this issue 2 years ago • 1 comments

Horologist 0.5.6. This is due to the state resetting to "Loading" while the seek is in progress. This causes the progress to reset to 0.

Can be mitigated with the following code:

var trackPositionUiModel by remember { mutableStateOf(playerUiState.trackPositionUiModel) }
    LaunchedEffect(playerUiState.trackPositionUiModel) {
        when (val state = playerUiState.trackPositionUiModel) {
            is TrackPositionUiModel.Actual -> trackPositionUiModel = state
            TrackPositionUiModel.Hidden -> trackPositionUiModel = state
            is TrackPositionUiModel.Loading -> {
                 /* Don't overwrite state -- avoids glitches when seeking. */
            }
            is TrackPositionUiModel.Predictive -> trackPositionUiModel = state
        }
    }

Digipom avatar Sep 18 '23 18:09 Digipom

Since you have a workaround, we won't rush out a quick fix. Thanks for reporting.

yschimke avatar Sep 20 '23 10:09 yschimke

Unlikely to be fixed with the current component based on priorities, happy to accept a PR, otherwise hopefully fixed with a next refresh.

yschimke avatar Aug 13 '24 10:08 yschimke