According to YouTube's documentation on subtitle formats, it supports positioning captions with the W3C's WebVTT format, and this seems to be evidenced out in the wild: most videos I've seen using positioning - including this test video and this music video - use WebVTT to do so.
In my video here, I was able to use align:start position:100%
to successfully align captions to the right of the video viewport, but any variation of align-left
or align-end
that I try simply reverts to the default (centre) alignment.
The line-left
syntax from Example 7 in the W3C's WebVTT spec states:
The "line-left" or "line-right" only refers to the physical side of the box to which the "position" setting applies, in a way which is agnostic regarding the horizontal or vertical direction of the cue. It does not affect or relate to the direction or position of the text itself within the box.
But when I try to use this to explicitly specify a left align, I get an error from YouTube when uploading the file (line 17 refers to the 3rd cue - the actual error is the line-left
on line 18):
WEBVTT
Kind: captions
Language: en
1
00:00:16.439 --> 00:00:20.998 align:start position:100% // Successfully aligns right
میرے کنّاں دے چمکن جھمکے
Mere kannaan de chamkan jhumke
Sparkling jewels adorn my ears
2
00:00:21.038 --> 00:00:25.037 align:left position:0% // Silently fails; falls back to centre alignment
میرے کنّاں دے چمکن جھمکے
Mere kannaan de chamkan jhumke
Sparkling jewels adorn my ears
3
00:00:25.837 --> 00:00:30.037 align:left position:0%,line-left // Fails with errors
مینوں ویکھے ہوا وی پئی گھم کے
Mainoon wekhe hawa wi pai ghum ke
Even the breeze turns around to get a glimpse of me
Is the line-left
/line-right
syntax not supported by YouTube at all, or am I just using it wrong? If it's not, how can I force my subtitles to align left?
Note that although I have the first line of each cue in Punjabi, the subtitle file itself for the video is uploaded as English (United Kingdom)
, and this is also made explicit by the Language: en
tag at the beginning of the files, so this doesn't feel like a right-to-left issue.