-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebVTT line cue setting not following the spec in UITextDisplayer #4567
Comments
After reading the specs here and here again, it appears that To clarify, So, it's my understanding that the problem is here: shaka-player/lib/text/ui_text_displayer.js Line 594 in 62906bd
Please feel free to correct me if I misunderstood the specs. |
I'm actually having issues with this right now as well, but with absolute values. I've noticed this TODO in the code, so I'm looking if I can implement this in a PR. Could have a look at the problem @Robloche is having as well, or would it be better to keep this separate? |
You could have a look but should you able to fix both issues, 2 PRs would be better, I guess. EDIT: And by the way, if you solve the bug I reported, I'll be grateful forever. ;) |
In fact, a simpler way ot fix it would be to replace: |
…roject#4567) As stated in the specifications at https://w3c.github.io/webvtt/#webvtt-line-cue-setting and https://w3c.github.io/webvtt/#webvtt-cue-line-alignment the "end" modifier in the line alignment directive means that the box is positioned from the top of the screen but relatively to its bottom edge. The previous code actually positioned the box from the bottom of the screen.
…4682) As per spectification, [here](https://w3c.github.io/webvtt/#webvtt-line-cue-setting) and [there](https://w3c.github.io/webvtt/#webvtt-cue-line-alignment), my understanding is that a cue line with an optional alignment position `end`, e.g. `line:91%,end`, should have its bottom edge at 91% from the top of the screen. But the current code places it at 91% from the bottom of the screen. Fixes #4567 Co-authored-by: Rodolphe Breton <[email protected]> Co-authored-by: Joey Parrish <[email protected]>
…4682) As per spectification, [here](https://w3c.github.io/webvtt/#webvtt-line-cue-setting) and [there](https://w3c.github.io/webvtt/#webvtt-cue-line-alignment), my understanding is that a cue line with an optional alignment position `end`, e.g. `line:91%,end`, should have its bottom edge at 91% from the top of the screen. But the current code places it at 91% from the bottom of the screen. Fixes #4567 Co-authored-by: Rodolphe Breton <[email protected]> Co-authored-by: Joey Parrish <[email protected]>
…4682) As per spectification, [here](https://w3c.github.io/webvtt/#webvtt-line-cue-setting) and [there](https://w3c.github.io/webvtt/#webvtt-cue-line-alignment), my understanding is that a cue line with an optional alignment position `end`, e.g. `line:91%,end`, should have its bottom edge at 91% from the top of the screen. But the current code places it at 91% from the bottom of the screen. Fixes #4567 Co-authored-by: Rodolphe Breton <[email protected]> Co-authored-by: Joey Parrish <[email protected]>
Have you read the FAQ and checked for duplicate open issues?
Yes.
What version of Shaka Player are you using?
4.2.2
Can you reproduce the issue with our latest release version?
Yes.
Can you reproduce the issue with the latest code from
main
?Not tried.
Are you using the demo app or your own custom app?
My custom app.
If custom app, can you reproduce the issue using our demo app?
Not tried.
What browser and OS are you using?
Chrome 105.0.5195.127 (Build officiel) (64 bits)
Windows 10 Pro 21H2
What did you do?
I'm using
UITextDisplayer
to display WebVTT subtitles.This particular subtitles file contains lines like:
What did you expect to happen?
The line should be displayed at the bottom of the screen, as per specification:
For horizontal cues, this is the vertical offset from the top of the video viewport, [...]
What actually happened?
The line appears at the top of the screen.
Inspecting the style shows me:
<div style="white-space: pre-wrap; direction: ltr; opacity: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-weight: 400; font-style: normal; position: absolute; left: 0px; top: 0px; width: 100%; bottom: 91%; text-align: end; writing-mode: horizontal-tb;"><span style="background-color: rgba(0, 0, 0, 0.8);">-J'y vais. Tu viens pas avec moi ?</span></div>
I guess
bottom: 91%
should betop: 91%
.And indeed, doing it in Chrome DevTools actually moves the line to the bottom of the screen, as expected.
The text was updated successfully, but these errors were encountered: