Skip to content

Conversation

danae404
Copy link
Contributor

dom_override_cue_align_position_line_size_while_paused.html and dom_override_cue_align_position_line_size.html give the vtt cue the following settings:

    c.align = 'start';
    c.position = 80;
    c.line = 0;
    c.size = 20;

Align = "start" and position = 80 mean that the left edge of the cue is positioned 80% of the video width (320px) to the right of the left edge of the video. Currently the ref files set right: 51.2px on the fake cue (16%). This should be changed to left: 80% to match the real vtt cue. Additionally this patch changes width: 64px to width: 20% on the ref cue for readability.

dom_override_cue_align_position_line_size_while_paused.html and
dom_override_cue_align_position_line_size.html give the vtt
cue the following settings:

        c.align = 'start';
        c.position = 80;
        c.line = 0;
        c.size = 20;

Align = "start" and position = 80 mean that the left edge of the cue
is positioned 80% of the video width (320px) to the right of the left edge
of the video. Currently the ref files set right: 51.2px on the fake cue
(16%). This should be changed to left: 80% to match the real vtt cue.
Additionally this patch changes width: 64px to width: 20% on the ref
cue for readability.
@danae404
Copy link
Contributor Author

@zcorpan

@danae404
Copy link
Contributor Author

@zcorpan @gkatsev @alastor0325 could you take a look?

@zcorpan
Copy link
Member

zcorpan commented Aug 28, 2025

OK so

  • Position alignment is auto.
  • Computed position alignment is line-left since text alignment is start and the base direction of the cue text is left-to-right.
  • Therefore, the left edge of the cue should be positioned 80% from the left of the video edge.

The positioning logic was changed at some point (about a decade ago) without fixing the tests to match, so I suspect there are more tests that expect the old positioning logic.

@zcorpan zcorpan merged commit b228009 into master Aug 28, 2025
24 checks passed
@zcorpan zcorpan deleted the fix-position branch August 28, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants