compose-media icon indicating copy to clipboard operation
compose-media copied to clipboard

Support Subtitles

Open kazemcodes opened this issue 2 years ago • 3 comments

if possible, it would be really amazing if compose-media support subtitles

kazemcodes avatar Oct 24 '22 10:10 kazemcodes

currently this repo is the best repo I've found that supports compose exo player, I wasn't able to support subtitles in my app as there isn't enough samples regarding subtitles in the github, and your repo also put a TODO in code regarding subtitles, do you have any samples that supports online subtitles out there?

kazemcodes avatar Oct 24 '22 10:10 kazemcodes

I don't have much time to implement this. What about using SubtitleView of exoplayer-ui for now? It can be adapted to Compose by using AndroidView composable. For example:

Media(
    mediaState,
    modifier = Modifier.fillMaxSize(),
    subtitles = { cues ->
        AndroidView(
            factory = { context ->
                SubtitleView(context).apply {
                    // do configuration
                }
            },
            modifier = ...,
        ) {
            it.setCues(cues)
        }
    }
)

fengdai avatar Oct 30 '22 02:10 fengdai

I'm currently doing the same thing,but it would be better if there was inbuilt support for it, But compose-media is already great. Thanks for your contribution.

kazemcodes avatar Oct 30 '22 03:10 kazemcodes