ComposeSubtitleLayer

@Composable
fun ComposeSubtitleLayer(currentTimeMs: Long, durationMs: Long, isPlaying: Boolean, subtitleTrack: SubtitleTrack?, subtitlesEnabled: 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 over a video player. This component handles loading and parsing subtitle files, and displaying the active subtitles at the current playback time.

Parameters

currentTimeMs

The current playback time in milliseconds

durationMs

The total duration of the media in milliseconds

isPlaying

Whether the video is currently playing

subtitleTrack

The current subtitle track, or null if no subtitle is selected

subtitlesEnabled

Whether subtitles are enabled

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