Skip to content
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

Parse optional line and position settings in VTT #469

Closed
OrenMe opened this issue Jul 29, 2016 · 7 comments
Closed

Parse optional line and position settings in VTT #469

OrenMe opened this issue Jul 29, 2016 · 7 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@OrenMe
Copy link
Contributor

OrenMe commented Jul 29, 2016

If VTT cue has position alignment, e.g. position:10%,line-left then vtt_text_parser.parseSettings method is unable to parse the setting string, resulting in an exception.
Is there any issue with parsing and applying this kind of vtt cue settings?
See here for full options: https://w3c.github.io/webvtt/#webvtt-cue-position-alignment

@joeyparrish
Copy link
Member

There's no reason we couldn't parse that. It looks like we're not parsing any of the optional parts of the individual settings. Here's the relevant text from the spec, for reference:

A WebVTT line cue setting consists of the following components, in the order given:

  1. The string "line" as the WebVTT cue setting name.
  2. A U+003A COLON character (:).
  3. As the WebVTT cue setting value:
    1. An offset value, either:
      1. To represent a specific offset relative to the video viewport, a WebVTT percentage.
      2. Or to represent a line number
        1. Optionally a U+002D HYPHEN-MINUS character (-).
        2. One or more ASCII digits.
    2. An optional alignment value consisting of the following components:
      1. A U+002C COMMA character (,).
      2. One of the following strings: "start", "center", "end"

A WebVTT position cue setting consists of the following components, in the order given:

  1. The string "position" as the WebVTT cue setting name.
  2. A U+003A COLON character (:).
  3. As the WebVTT cue setting value:
    1. A position value consisting of: a WebVTT percentage.
    2. An optional alignment value consisting of:
      1. A U+002C COMMA character (,).
      2. One of the following strings: "line-left", "center", "line-right"

https://w3c.github.io/webvtt/#cue-settings

However, be forewarned Chrome has not yet implemented the positionAlign or lineAlign properties on the VTTCue interface, so those properties will not have any effect in the current version of Chrome.

@joeyparrish joeyparrish added the type: enhancement New feature or request label Jul 29, 2016
@joeyparrish joeyparrish changed the title VTT parser doesn't support cue position alignment Parse optional line and position settings in VTT Jul 29, 2016
@joeyparrish joeyparrish added this to the v2.0.0 milestone Jul 29, 2016
@ismena
Copy link
Contributor

ismena commented Aug 2, 2016

A bug on Chrome to implement support for positionAlign and lineAlign attributes: https://bugs.chromium.org/p/chromium/issues/detail?id=633690

@joeyparrish
Copy link
Member

@OrenMe, the Chromium authors have stated that these attributes were not implemented in Chromium because they didn't have a real use-case. If you're interested to see these attributes implemented in Chrome, please go to the Chromium bug tracker and explain what you need: https://bugs.chromium.org/p/chromium/issues/detail?id=633690#c6

@OrenMe
Copy link
Contributor Author

OrenMe commented Aug 5, 2016

Thanks @joeyparrish, my main concern was that the parser was failing and stopping playback more then actually the support of this attributes in the browser.
As there are vtt files containing these attributes this fix will now enable playback with them.

@sanbornhilland
Copy link
Contributor

I'm having a similar issue using the latest from master but it's because the webVTT tracks we are using have position start|center|end instead of line-left|center|line-right. I believe the disagreement stems from a change in the WebVTT spec. The tracks we have are based on the Working Draft here: https://www.w3.org/TR/webvtt1/#webvtt-position-cue-setting and the implementation seems to be based on the Editor's Draft here: https://w3c.github.io/webvtt/#webvtt-position-cue-setting

As I understand it, that second draft is the bleeding edge and is not settled. What do you think of adding support for the previous version of the spec since that is the one that I think is currently stable.

@joeyparrish
Copy link
Member

No reason we can't support both for now.

@joeyparrish joeyparrish reopened this Aug 9, 2016
@ismena
Copy link
Contributor

ismena commented Aug 10, 2016

@sanbornhnewyyz should be good to go now.

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants