Skip to content

Line positioning for vertical:rl and vertical:lr cues is inverted #52

Description

@jonknowles

Currently vtt.js displays cues with line positioning offsets for both vertical right-growing-left and vertical left-growing-right offset from the incorrect side of the subtitle overlay.

The following cues are currently rendererd approximately like this:

00:00:06.000 --> 00:00:08.000 line:10% vertical:rl
text
________________________________
|    t                           |
|    e                           |
|    x                           |
|    t                           |
|________________________________|

00:00:06.000 --> 00:00:08.000 line:90% vertical:rl
text
________________________________
|                            t   |
|                            e   |
|                            x   |
|                            t   |
|________________________________|

But their positions should be inverted, and likewise for vertical:lr cues with line positioning percentages.

See this issue on the w3c WebVTT github for more information: w3c/webvtt#481

I believe the issue can be solved for cues where snapToLines is false by swapping the "right" and "left" settings here: https://github.com/videojs/vtt.js/blob/d7dfb66716d1cd9b80eb54aac1ee9b0f10add331/lib/process/move-box-to-line-position.js#L111:L120

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions