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

Subtitle Track Position is Wrong when Same Timestamp is Displayed #8597

Open
kkm opened this issue Feb 17, 2024 · 3 comments
Open

Subtitle Track Position is Wrong when Same Timestamp is Displayed #8597

kkm opened this issue Feb 17, 2024 · 3 comments
Labels
needs: triage This issue needs to be reviewed

Comments

@kkm
Copy link

kkm commented Feb 17, 2024

Description

image
I am confident that I have come across a bug, and I hope someone can explain how to fix it.
I have spent 2 hours searching and attempting to modify the CSS or JavaScript subtitle format.

WEBVTT:
00:01.000 --> 00:50.000
LINE 1-1

00:01.000 --> 00:50.000
LINE 2-2

Both have the same timestamp, and it should display first:

LINE 1
LINE 2

However, it is displayed in the Video.js player as:

LINE 2
LINE 1

Errors

No response

What version of Video.js are you using?

Video.js 8.10.0

Video.js plugins used.

No response

What browser(s) including version(s) does this occur with?

Version 121.0.6167.185 (Official Build) (32-bit)

What OS(es) and version(s) does this occur with?

Windows 11

@kkm kkm added the needs: triage This issue needs to be reviewed label Feb 17, 2024
@mister-ben
Copy link
Contributor

Interesting, the text track list does have them in the right order

> Array.from(player.textTracks()[0].activeCues).map(c => c.text)
< ["LINE 1-1", "LINE 2-2"] (2)

@gkatsev
Copy link
Member

gkatsev commented Feb 29, 2024

I believe that is the unfortunate, expected behavior for cues like this due to how vtt.js/webvtt works. I believe hls.js includes a workaround for something like that but I don't think we ever implemented one in Video.js.
Essentially, it's because the cues are drawn in order and once displayed they aren't supposed to be moved. UAs generally know if there's multiple cues at the same time and handle that display, but vtt.js doesn't handle it as it renders each cue in order.

@mister-ben
Copy link
Contributor

FWIW Chrome, Safari and Firefox's native captions all put the 2-2 line on top too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage This issue needs to be reviewed
Projects
None yet
Development

No branches or pull requests

3 participants