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

Uncaught TypeErrors when switching subtitle tracks #4929

Closed
fredrik-telia opened this issue Jan 24, 2023 · 3 comments · Fixed by #4928
Closed

Uncaught TypeErrors when switching subtitle tracks #4929

fredrik-telia opened this issue Jan 24, 2023 · 3 comments · Fixed by #4928
Labels
component: HLS The issue involves Apple's HLS manifest format priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@fredrik-telia
Copy link
Contributor

Have you read the FAQ and checked for duplicate open issues?

What version of Shaka Player are you using?
Latest (main)

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?
Yes

Are you using the demo app or your own custom app?
custom

If custom app, can you reproduce the issue using our demo app?
n/a

What browser and OS are you using?
Chrome, macOS

What are the manifest and license server URIs?

What configuration are you using? What is the output of player.getConfiguration()?

What did you do?
Playing HLS stream with two subtitle tracks, switching tracks causes uncaught TypeError

What did you expect to happen?
No errors

What actually happened?
Could it be that there's a typo in hls_parser.js

'webvtt': 'txt/vtt',
?

Changing this to text/vtt makes the TypeErrors go away

@fredrik-telia fredrik-telia added the type: bug Something isn't working correctly label Jan 24, 2023
@avelad avelad added component: HLS The issue involves Apple's HLS manifest format priority: P1 Big impact or workaround impractical; resolve before feature release labels Jan 24, 2023
@avelad avelad added this to the v4.4 milestone Jan 24, 2023
@martinstark
Copy link
Contributor

martinstark commented Jan 24, 2023

There seems to be a deeper issue in hls_parser.js that causes one track to be assigned text/vtt and the second track to be assigned txt/vtt when guessing mimetypes, despite both having the same file extension.

I haven't debugged it fully, the PR provided by Fredrik fixes the issue by correcting the bad mime type, but it's confusing me why shaka would choose two different ones for near identical tracks.

joeyparrish pushed a commit that referenced this issue Jan 24, 2023
We were seeing uncaught TypeErrors when changing subbtitle
tracks.

Closes #4929
@joeyparrish
Copy link
Member

it's confusing me why shaka would choose two different ones for near identical tracks.

We don't know the extension until we load the playlist, and since v4.3.0, we only load the playlists of tracks that we are streaming.

One instance was hard-coded, and the other used a lookup table that contained a typo. Sorry for the trouble, and thanks for the fix!

@martinstark
Copy link
Contributor

Workaround while waiting for a new shaka release:

  shaka.text.TextEngine.registerParser(
    "txt/vtt",
    () => new shaka.text.VttTextParser()
  );

joeyparrish pushed a commit that referenced this issue Jan 30, 2023
We were seeing uncaught TypeErrors when changing subbtitle
tracks.

Closes #4929
joeyparrish pushed a commit that referenced this issue Jan 30, 2023
We were seeing uncaught TypeErrors when changing subbtitle
tracks.

Closes #4929
joeyparrish pushed a commit that referenced this issue Jan 30, 2023
We were seeing uncaught TypeErrors when changing subbtitle
tracks.

Closes #4929
joeyparrish pushed a commit that referenced this issue Jan 30, 2023
We were seeing uncaught TypeErrors when changing subbtitle
tracks.

Closes #4929
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Mar 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: HLS The issue involves Apple's HLS manifest format priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants