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

Some manifest files crash player when using hls.light.min.js with undefined (hasAutoSelect) error #6316

Closed
5 tasks done
harsh-mn-yral opened this issue Mar 27, 2024 · 6 comments · Fixed by #6342
Closed
5 tasks done
Labels
Bug Confirmed Bug report confirmed or reproduced.
Milestone

Comments

@harsh-mn-yral
Copy link

harsh-mn-yral commented Mar 27, 2024

What version of Hls.js are you using?

v1.5.7 (hls.light.min.js from jsdeliver)

What browser (including version) are you using?

Firefox/Chrome latest

What OS (including version) are you using?

Mac Sonoma

Test stream

https://github.com/harshbaz/hlsjs-desktop-playback-error
Codesandbox: https://codesandbox.io/p/github/harshbaz/hlsjs-desktop-playback-error/main

Configuration

{
maxBufferLength: 5,
debug:true
}

Additional player setup steps

Sorry about the checklist, but the error only happens when few conditions are met:

  • Client is a desktop (plays fine on mobiles)
  • Client is using Chrome/Firefox (desktop)
  • CDN script hls.light.min.js is used. (plays fine with hls.min.js)

I have created a separate repository and there's no extra logic in there: https://github.com/harshbaz/hlsjs-desktop-playback-error

Checklist

Steps to reproduce

  1. Just clone the repo and run the app, trying to play first manifest will result in an error while second manifest plays fine.

Expected behaviour

Both the manifest files should play fine. If there is an error, an error event should be thrown and error should be handled gracefully

What actually happened?

The Hls player crashes will no ability to react to the error while trying to play

Console output

Uncaught TypeError: Cannot read properties of undefined (reading 'hasAutoSelect')
    at hls.light.min.js:1:88185
    at Array.forEach (<anonymous>)
    at hls.light.min.js:1:88070
    at Array.reduce (<anonymous>)
    at hls.light.min.js:1:87523
    at t.findBestLevel (hls.light.min.js:1:88349)
    at e.get (hls.light.min.js:1:91633)
    at e.get (hls.light.min.js:1:293524)
    at t.get (hls.light.min.js:1:147632)
    at e.get (hls.light.min.js:1:291649)

Chrome media internals output

No response

@harsh-mn-yral harsh-mn-yral added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Mar 27, 2024
@harsh-mn-yral harsh-mn-yral changed the title Playing some manifest files crashes Hls.js with an error Playing some manifest files crashes Hls.js with an error when using hls.light.min.js Mar 27, 2024
@harsh-mn-yral harsh-mn-yral changed the title Playing some manifest files crashes Hls.js with an error when using hls.light.min.js Playing some manifest files crashes Hls.js when using hls.light.min.js Mar 27, 2024
@harsh-mn-yral harsh-mn-yral changed the title Playing some manifest files crashes Hls.js when using hls.light.min.js Some manifest files crash player when using hls.light.min.js with undefined hasAutoSelect error Mar 27, 2024
@harsh-mn-yral harsh-mn-yral changed the title Some manifest files crash player when using hls.light.min.js with undefined hasAutoSelect error Some manifest files crash player when using hls.light.min.js with undefined (hasAutoSelect) error Mar 27, 2024
@robwalch robwalch added Confirmed Bug report confirmed or reproduced. and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Mar 27, 2024
@robwalch robwalch added this to the 1.5.8 milestone Mar 27, 2024
@robwalch robwalch mentioned this issue Apr 4, 2024
1 task
@davidgoli
Copy link

I'm able to repro this on the vanilla (non-light) version as well

@davidgoli
Copy link

Confirmed the fix (#6342) works for the non-light version also

@robwalch
Copy link
Collaborator

robwalch commented Apr 11, 2024

Hi @davidgoli,

Thanks for the confirmation.

Can you provide an example of this failure with the full version (using 1.5.7)? I'm interested to know how you would end up with a variant listing an audio-group-id that could not be found in hls.allAudioTracks.

@davidgoli
Copy link

Great question! I have a video with no audio tracks at all:

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="jochgifscake-39001_1080.cmfv",BYTERANGE="842@0"
#EXTINF:4,
#EXT-X-BYTERANGE:810454@842
jochgifscake-39001_1080.cmfv
#EXTINF:1,
#EXT-X-BYTERANGE:107892@811296
jochgifscake-39001_1080.cmfv
#EXT-X-ENDLIST

I admittedly did not debug super deeply when I hit the bug, I just upgraded to latest hls.js and found it fixed it.

@robwalch
Copy link
Collaborator

Great question! I have a video with no audio tracks at all

In that case, the code that was throwing for this bug shouldn't have run at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed Bug report confirmed or reproduced.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants