Open unixfox opened 4 months ago
👋 Thanks for opening your first issue here! 👋
If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.
The difference is that the video el sourceset event is handled by default in v8, when the sources cache is updated here the absolute URL from the sourceset event is compared to the source els. If the test here used getAbsoluteURL(sourceObj.src) === getAbsoluteURL(src)
(from /src/js/utils.js) currentSources()
would be as before - but that causes tests in /test/unit/sourceset.test.js to fail.
@mister-ben Sorry I'm not that familiar with how the inner of video.js works, but does this mean it's considered a valid regression compared to video.js 7? Or is it considered as a bug?
Right now https://github.com/silvermine/videojs-quality-selector doesn't work due to this issue because it thinks that currentSources()
will always give all the existing source URLs, not in a case of absolute URLs or not.
@unixfox there's quite a bit to unpick here. You could disable the sourceset behaviour by using enableSourceset: false
in the player options. Hopefully that can unblock you.
Sorry for the late reply. Thank you @mister-ben, setting enableSourceset
indeed fixes the issue: https://unixfox.github.io/videojs-currentsources-issue/videojs8-enableSourceset-false.html
Description
Hello,
When you declare multiple sources inside the
<video>
HTML element and the first source do not have an absolute URL, then you can't get all the other sources usingplayer.currentSources()
when the video is playing.This bug exists since video.js 8.0.0, and I can't replicate it on video.js 7.21.5. I think this is a regression from video.js 7 to video.js 8.
HTML demo URLs:
GitHub repository source files: https://github.com/unixfox/videojs-currentsources-issue
Due to this bug,
silvermine/videojs-quality-selector
does not work without absolute URLs: https://github.com/silvermine/videojs-quality-selector/issues/107Thank you for taking a look at this bug.
Reduced test case
https://unixfox.github.io/videojs-currentsources-issue/videojs8.html
Steps to reproduce
source1.mp4
andsource2.mp4
(can use https://sample-videos.com/ for demo videos)Errors
No response
What version of Video.js are you using?
8.13.0
Video.js plugins used.
No response
What browser(s) including version(s) does this occur with?
Chrome 124.0.6367.78 and Firefox 125.0.2
What OS(es) and version(s) does this occur with?
ArchLinux