-
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
fix: Properly size region anchor from LINE units #5941
fix: Properly size region anchor from LINE units #5941
Conversation
With shaka-project#5924, 708 windows were exposed as Cue regions. Since the region ID was getting set now, the UITextDisplayer was trying to position the regions but it doesn't properly support LINES units. This PR skips positioning the region if the values are in LINES units until that can be properly implemented.
Incremental code coverage: 54.05% |
lib/text/ui_text_displayer.js
Outdated
if (region.heightUnits === linesUnit && region.widthUnits === linesUnit) { | ||
// from https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html#caption-window-size | ||
regionElement.style.height = region.height * 5.33 + '%'; | ||
regionElement.style.width = region.width * 1.9 + '%'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, assuming the video's aspect ratio is 16:9. 708 captions only know about 4:3 and 16:9 video. Happy to do a check here to figure out the correct multiple here but need a pointer to how to figure it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a commit to this PR to calculate the aspect ratio, you just have to use the variable this.aspectRatio_
Provides more improvements to #2583 |
This does implement region anchors, but the issue talks about WebVTT and IMSC/TTML, and I was mostly focused on 708. It's possible that this also solves the WebVTT portion fully, but I'm not sure about the IMSC/TTML portion. |
CEA708 captions may set windows in LINE units, this needs to be converted to percentages to be properly displayed. In addition, adjust by the region anchor. --------- Co-authored-by: Álvaro Velad Galván <[email protected]>
CEA708 captions may set windows in LINE units, this needs to be converted to percentages to be properly displayed. In addition, adjust by the region anchor. --------- Co-authored-by: Álvaro Velad Galván <[email protected]>
CEA708 captions may set windows in LINE units, this needs to be converted to percentages to be properly displayed. In addition, adjust by the region anchor.