Skip to content

Possible incorrect mappings for positionAlign values #51

Description

@jonknowles

In cue-style-box.js, there is a switch statement based on the value of cue.positionAlign (https://github.com/videojs/vtt.js/blob/master/lib/process/cue-style-box.js#L54). However, the values in the switch appear to be possible values for the VttCue lineAlign property, not the positionAlign property.

See https://www.w3.org/TR/webvtt1/#the-vttcue-interface:

enum LineAlignSetting { "start", "center", "end" };
enum PositionAlignSetting { "line-left", "center", "line-right", "auto" };

I'm new to this, so I wonder if these values have perhaps changed over time. If there's another explanation, I'd be interested to hear it, since I'm trying to debug some positioning issues I'm seeing.

Activity

  1. gkatsev commented on Feb 11, 2020

    @gkatsev
    Member

    This is likely because the values in the spec changed but vtt.js hasn't been updated with for that. Hadn't noticed that positionAlign here was still using the old values.

  2. gkatsev commented on Feb 11, 2020

    @gkatsev
    Member

    We definitely should fix this but my focus is currently on things like #50 because the webvtt spec currently has position and line alignment options as at-risk https://htmlpreview.github.io/?https://github.com/gkatsev/webvtt/blob/at-risk-june/archives/2019-06-19/Overview.html#status.

  3. jonknowles commented on Feb 11, 2020

    @jonknowles
    Author

    Thanks for the explanation, that's what I had suspected. I hadn't seen that about these being at-risk in the spec, so that is good to know. I got confusing positioning results when I tried an initial refactor, so I probably won't be able to try to fix it at the moment, but if I ever figure it out, I'll try to do a PR.

  4. gkatsev commented on Feb 11, 2020

    @gkatsev
    Member

    Actually, looking at the implementation report of webvtt again, it looks like Firefox may have an implementation and if we fix it here, we can claim it as another implementation and then remove it from being at risk.
    That actually sounds likely might be more important than region support.
    @jonknowles what types of things are you seeing and what have you tried to do?

  5. jonknowles commented on Feb 13, 2020

    @jonknowles
    Author

    I think the odd behavior was due to most cues not having a positionAlign property at all, so I added logic to default it according to the algorithm laid out here: https://www.w3.org/TR/webvtt1/#webvtt-cue-position-alignment

    This was in Chome, using the vtt.js parser, not the native one. I'm kinda struggling to comprehend the interaction of the positionAlign and align values in the WebVTT spec right now, so I might not be understanding what the proper behavior actually is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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