watchparty icon indicating copy to clipboard operation
watchparty copied to clipboard

Control subtitle/caption line position/margin

Open lwcorp opened this issue 3 years ago • 3 comments

Subtitles/Captions are currently shown at the very bottom, which means they get cut off in some TVs.

Since you convert subtitles/captions to WebVTT anyway (since that's what <video><track> supports), you might as well add a line position setting, which is a feature of VTT that can be controlled with JavaScript.

Basically every time a VTT track is loaded, which you can track with track.addEventListener('load', ...), then you can loop it and give it an alternative line position, like this.

I assume it should be somewhere in https://www.watchparty.me/static/js/main.[dynamic value].js but I don't see it in GitHub. If you pointed me in the right direction, I'd create a pull request with it. Is it the loadSubtitles function in https://github.com/howardchung/watchparty/blob/master/src/components/App/App.tsx ? But even if it were, you still need an input for the number.

lwcorp avatar Jul 03 '22 17:07 lwcorp

Yeah that's the correct function. But this would definitely need some UI/advanced options menu to supply the input. And I think we would need to network that value as well so all clients see it correctly.

howardchung avatar Jan 23 '23 07:01 howardchung

In my own version of watchparty (not related to yours), I just have a number input field which changes the line margin live (it defaults to -3 to be 3 lines from the bottom, thus not covered in my TV):

https://user-images.githubusercontent.com/1773306/215263876-f44327af-e9c9-41c9-8a72-28498481c39b.mp4

lwcorp avatar Jan 28 '23 11:01 lwcorp

I recently redesigned the subtitle modal so there's room to add more options now. But in the meantime maybe it would be quick and easy to add a static non-customizable offset value

howardchung avatar Jan 30 '23 08:01 howardchung