android / android/tv-samples

[JetStreamCompose] External subtitles not displayed

Open
#152 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1.3k
Forks
396
PR merge metrics
No merged PRs in 30d

Description

According to the code, subtitles should be displayed by default if they are defined in `movies.json`. And in the example there are this subtitles defined for every sample movie:
```json
{
"id": "8daa7d22d13a9",
"videoUri": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
"subtitleUri": "https://thepaciellogroup.github.io/AT-browser-tests/video/subtitles-en.vtt",
```
and here is the code that loads the subtitles:
```kotlin
val exoPlayer = rememberExoPlayer(context)
LaunchedEffect(exoPlayer, movieDetails) {
exoPlayer.setMediaItem(
MediaItem.Builder()
.setUri(movieDetails.videoUri)
.setSubtitleConfigurations(
if (movieDetails.subtitleUri == null) {
emptyList()
} else {
listOf(
MediaItem.SubtitleConfiguration.Builder(Uri.parse(movieDetails.subtitleUri))
.setMimeType("application/vtt")
.setLanguage("en")
.setSelectionFlags(C.SELECTION_FLAG_DEFAULT)
.build()
)
}
).build()
)
exoPlayer.prepare()
}
```
But the subtitles are never displayed. Even if we enable default overlay (`useController = true`), there is no option to enable subtitles there, like it never even loads them.

Is this some exoplayer issue or some problem with using it with compose? I tried to build the sample from the time this code was first added. But it doesn't work either.

Contributor guide

Open the contributing guide

Research direction

Start from the JetStreamCompose player setup shown in the issue and the subtitleUri entries in movies.json; verify how the MediaItem subtitle configuration is loaded and exposed during playback. Reproduce with a sample movie and confirm that the external VTT track is available and displayed by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.