You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observed: MP4-Encapsulated TTML subtitles default to top position (with positionAnchor defaulting to Float.MIN_VALUE) Expected: Subtitles appear at the bottom of the screen with a valid position
Reproduction steps
Using a dash steam w/ MP4-Encapsulated TTML subtitles, enable subtitles. Subtitles appear at the top.
Link to test content
Cannot provide (legal reasons)
Version of ExoPlayer being used
2.4.1 (Was not an issue in 2.4.0)
Device(s) and version(s) of Android being used
Device: FireTV OS: Fire OS v5.2.4.1 (Android v5.1.1)
We fixed TTML positioning in 2.4.1 (at least in theory). It's quite possible that your TTML caption files are actually specifying that the captions should be rendered at the top of the screen (or that the implicitly specify this by not specifying something else), and that what the previous behavior was incorrect.
There's nothing we can do to look at this without test content (or at least the TTML part of it).
We also encountered this problem with the ExoPlayer 2.4.1/2.4.2. The subtitles we use do not define the alignment so the subtitles are displayed at the top of the screen. Would it be possible to add a way to change the default position from top to bottom, in case the position isn't defined in the subtitles?
I extracted a snippet from our ttml stream (and swapped out the texts just in case) and attached it here. My initial investigation suggests that ExoPlayer doesn't support (chained?) referential styling as described by TTML
@zharf - Yes, that looks like the problem for your case. Thanks for the sample. We should fix that, after which you'll get proper positioning as is defined in your TTML file. @evandipietro - There's no way we can verify whether your case is the same or different without a sample TTML file, so we'll use this issue to track supporting referential styling as in @zharf 's case unless we learn more.
The best short term fix for this is probably to ignore regions that don't directly define origin and extent, which will cause the the captions to go back to being displayed at the bottom again. We currently set default origin and extent in this case, but that results in unexpected behavior when the origin and extent are actually defined in the chained styles that we're not currently resolving. Does that sound sensible?
I'm not fully familiar with how this thing works as of right now but from what I understand it sounds like it could work for now. We can also test any suggested fixes.
The fix will be in 2.4.3, which will be released today or early next week. Renaming this issue to track the enhancement of properly supporting referential styling.
androidx/media@8fe0b7a adds support for extent and origin inherited from referred styles. I'm going to mark this as fixed. Please open a new issue with specific info if there's additional support needed here: https://github.com/androidx/media/issues
Activity
ojw28 commentedon Jun 14, 2017
Are you sure they're not TTML captions? I don't think we made any changes to WebVTT captioning between 2.4.0 and 2.4.1.
evandipietro commentedon Jun 14, 2017
@ojw28 My mistake, it is TTML. Updating the issue.
ojw28 commentedon Jun 14, 2017
We fixed TTML positioning in 2.4.1 (at least in theory). It's quite possible that your TTML caption files are actually specifying that the captions should be rendered at the top of the screen (or that the implicitly specify this by not specifying something else), and that what the previous behavior was incorrect.
There's nothing we can do to look at this without test content (or at least the TTML part of it).
soutua commentedon Jun 15, 2017
We also encountered this problem with the ExoPlayer 2.4.1/2.4.2. The subtitles we use do not define the alignment so the subtitles are displayed at the top of the screen. Would it be possible to add a way to change the default position from top to bottom, in case the position isn't defined in the subtitles?
ojw28 commentedon Jun 15, 2017
We need to see sample TTML files to investigate this properly.
zharf commentedon Jun 15, 2017
I extracted a snippet from our ttml stream (and swapped out the texts just in case) and attached it here. My initial investigation suggests that ExoPlayer doesn't support (chained?) referential styling as described by TTML
sidenote: I work with @soutua
ttml.zip
[-]Subtitles appearing at top[/-][+]TTML subtitles appearing at top[/+]ojw28 commentedon Jun 15, 2017
@zharf - Yes, that looks like the problem for your case. Thanks for the sample. We should fix that, after which you'll get proper positioning as is defined in your TTML file.
@evandipietro - There's no way we can verify whether your case is the same or different without a sample TTML file, so we'll use this issue to track supporting referential styling as in @zharf 's case unless we learn more.
Thanks!
ojw28 commentedon Jun 15, 2017
The best short term fix for this is probably to ignore regions that don't directly define origin and extent, which will cause the the captions to go back to being displayed at the bottom again. We currently set default origin and extent in this case, but that results in unexpected behavior when the origin and extent are actually defined in the chained styles that we're not currently resolving. Does that sound sensible?
zharf commentedon Jun 16, 2017
I'm not fully familiar with how this thing works as of right now but from what I understand it sounds like it could work for now. We can also test any suggested fixes.
jonhan commentedon Jun 22, 2017
I have the same issue so +1
TTML: Ignore regions that don't declare origin and extent
3 remaining items
ojw28 commentedon Jun 30, 2017
The fix will be in 2.4.3, which will be released today or early next week. Renaming this issue to track the enhancement of properly supporting referential styling.
TTML: Ignore regions that don't declare origin and extent
atkGit commentedon May 2, 2018
AquilesCanta commentedon May 2, 2018
atkGit commentedon May 9, 2018
ojw28 commentedon May 9, 2018
ojw28 commentedon May 9, 2018
icbaker commentedon Jan 6, 2025
androidx/media@8fe0b7a adds support for extent and origin inherited from referred styles. I'm going to mark this as fixed. Please open a new issue with specific info if there's additional support needed here: https://github.com/androidx/media/issues