Skip to content

Commit

Permalink
Fix synced lyrics not working in AudioNowPlayingFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Oct 31, 2024
1 parent 44ddb3b commit 0c378dd
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.ui.unit.sp
import org.jellyfin.androidtv.ui.AsyncImageView
import org.jellyfin.androidtv.ui.composable.LyricsDtoBox
import org.jellyfin.androidtv.ui.composable.modifier.fadingEdges
import org.jellyfin.androidtv.ui.composable.rememberPlayerProgress
import org.jellyfin.androidtv.ui.composable.rememberQueueEntry
import org.jellyfin.playback.core.PlaybackManager
import org.jellyfin.playback.core.model.PlayState
Expand All @@ -40,6 +41,11 @@ fun initializeLyricsView(
// Display lyrics overlay
if (lyrics != null) {
val playState by remember { playbackManager.state.playState }.collectAsState()

// Using the progress animation causes the layout to recompose, which we need for synced lyrics to work
// we don't actually use the animation value here
rememberPlayerProgress(playbackManager)

LyricsDtoBox(
lyricDto = lyrics,
currentTimestamp = playbackManager.state.positionInfo.active,
Expand Down

0 comments on commit 0c378dd

Please sign in to comment.