silvermine / videojs-quality-selector

MIT License
180 stars 56 forks source link

Initially selected source has to have absolute URL #107

Open ingomueller-net opened 4 months ago

ingomueller-net commented 4 months ago

I initially had a snippet like this one:

<video id="vjs-video" class="video-js vjs-default-skin" width="640" height="360" preload="metadata" controls poster="static/video.jpg">
  <source src="static/video-1080.mp4" type='video/mp4' label='1080' selected='true' />
  <source src="static/video-720.mp4" type='video/mp4' label='720' />
</video>

When I would change the quality in the GUI, I'd get the following error in the console in Chrome (and the quality would not change):

video.min.js:12 VIDEOJS: ERROR: TypeError: Cannot set properties of undefined (setting 'selected')
    at b.<anonymous> (silvermine-videojs-quality-selector.js:3443:22)
    at a.dispatcher.a.dispatcher (video.min.js:12:12786)
    at ht (video.min.js:12:13782)
    at b.trigger (video.min.js:12:17775)
    at o.value (silvermine-videojs-quality-selector.js:3276:23)
    at o.handleClick_ (video.min.js:12:84197)
    at a.dispatcher.a.dispatcher (video.min.js:12:12786)

When I changed the src of the first, i.e., initially selected source, everything worked as expected. I guess that this is a bug?

unixfox commented 4 months ago

Can replicate, this bug has started to appear in video.js 8.

EDIT: Seems like it's due to an upstream bug, I have created a github issue: https://github.com/videojs/video.js/issues/8712

unixfox commented 1 month ago

@ingomueller-net or anyone else reading, there is a fix for this here: https://github.com/videojs/video.js/issues/8712#issuecomment-2183049154