I init a videojs instance and when I get a new source, I want to change the source. Unfortunately I get an error.
here are an example in jsbin.
https://jsbin.com/qusiwik/edit?html,output
1.init a videojs instance
2.change the source
change video source
source change failed and i get an error

v7.3.0
chrome(I haven't tried in other browser)
Do I use wrong function? waiting for your anwser~~thx
👋 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.
Unfortunately, due to the way that Video.js works currently, if a type is not given and it cannot figure the type out from the URL, it cannot play it back. Adding a type as a source object (or working around it by adding #.mp4 to the url makes it work. The source object approach is the preferred one.
player.src({
src: 'http://img-ys011.didistatic.com/static/didiglobal/do1_pcUZZjSG7vFlMbdr8fA6',
type: 'video/mp4'
});
player.src('http://img-ys011.didistatic.com/static/didiglobal/do1_pcUZZjSG7vFlMbdr8fA6#.mp4')
Hope this helps
it works~thx
You're welcome.
This should be documented somewhere...
I tried to do this but now my video stops playing after one second of play. Please suggest something that I can do
"video.js": "^6.13.0"
"videojs-contrib-hls.js": "^3.2.0"
"vue-video-player": "^5.0.2"
我已解决此问题
It's working at this link, But why is it not working with the youtube link or google drive link?
Unfortunately, due to the way that Video.js works currently, if a type is not given and it cannot figure the type out from the URL, it cannot play it back. Adding a type as a source object (or working around it by adding
#.mp4to the url makes it work. The source object approach is the preferred one.player.src({ src: 'http://img-ys011.didistatic.com/static/didiglobal/do1_pcUZZjSG7vFlMbdr8fA6', type: 'video/mp4' });player.src('http://img-ys011.didistatic.com/static/didiglobal/do1_pcUZZjSG7vFlMbdr8fA6#.mp4')Hope this helps
It's working at this link, But why is it not working with the youtube link or google drive link?
Most helpful comment
Unfortunately, due to the way that Video.js works currently, if a type is not given and it cannot figure the type out from the URL, it cannot play it back. Adding a type as a source object (or working around it by adding
#.mp4to the url makes it work. The source object approach is the preferred one.Hope this helps