AutoUpdatingSubtitleDisplay

@Composable
fun AutoUpdatingSubtitleDisplay(subtitles: SubtitleCueList, currentTimeMs: Long, isPlaying: Boolean, modifier: Modifier = Modifier, textStyle: TextStyle = TextStyle( color = Color.White, fontSize = 18.sp, fontWeight = FontWeight.Normal, textAlign = TextAlign.Center ), backgroundColor: Color = Color.Black.copy(alpha = 0.5f))

A composable function that displays subtitles with automatic time tracking. This version automatically updates the display based on the current playback time.

Parameters

subtitles

The subtitle cue list to display

currentTimeMs

The current playback time in milliseconds

isPlaying

Whether the video is currently playing

modifier

The modifier to be applied to the layout

textStyle

The text style to be applied to the subtitle text

backgroundColor

The background color of the subtitle box