You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set the property to -3 on any cue in the vtt track (honestly can be any valid number)
Play video
Observed behavior
Depending on setup it either doesn't show or throws an error.
Console output
[TextTracks] TypeError: Failed to set the 'line' property on 'VTTCue': The provided value '-3' is not a valid enum value of type AutoKeyword.
Expected behavior
When any valid number or 'auto' string is passed to the line property, it should add it to the cues line property correctly.
Current Implementation
The array passed in will always be an array of strings and unless the value passed in for a line is a percentage, it won't be parse as a number. Essentially, a user can't pass a valid number value for the line property and has to pass a percentage as a number in order for it to work. I understand why this is in place for the position and size properties, but I'm confused why its being done for the line property and according to MDN, a percent isn't a valid value for the line attribute. However, I know if you make snapToLine false, it will use the provided value as a percentage, but as far as I can tell, I don't see where you are allowing a consumer to do that.
This implementation will allow users to pass all valid values to the line attribute and only throw errors when an invalid value is provided like any percentage.
Environment
Steps to reproduce
Observed behavior
Depending on setup it either doesn't show or throws an error.
Console output
Expected behavior
When any valid number or 'auto' string is passed to the line property, it should add it to the cues line property correctly.
Current Implementation
The array passed in will always be an array of strings and unless the value passed in for a line is a percentage, it won't be parse as a number. Essentially, a user can't pass a valid number value for the line property and has to pass a percentage as a number in order for it to work. I understand why this is in place for the position and size properties, but I'm confused why its being done for the line property and according to MDN, a percent isn't a valid value for the line attribute. However, I know if you make snapToLine false, it will use the provided value as a percentage, but as far as I can tell, I don't see where you are allowing a consumer to do that.
Suggested Implementation
This implementation will allow users to pass all valid values to the line attribute and only throw errors when an invalid value is provided like any percentage.
The text was updated successfully, but these errors were encountered: