-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Retry after network error #1805
Comments
That would be cool. For the most part we try to mimic how the video element works exactly in the core player, but I think that could be a really useful plugin. Any interest in putting one together? |
okay sure! |
Nice! I'm gonna close this issue since it doesn't require changes to core, but we can continue to discuss this here if you have any questions or want feedback. |
Happen to know if something like this ever came about? We started tracking errors/exceptions in production and there is surprisingly a lot of network issues: "The video could not be loaded, either because the server or network failed or because the format is not supported." or "A network error caused the video download to fail part-way.". If not, what would be the best approach for a plugin? Listen for when VideoJS throws error code 2 and then reload the source? Thanks! |
@ksheurs I know a few other folks did something along those lines, so I think that sounds reasonable. |
Already a plugin to solve this problem? |
I have a similar problem. player.on('error', function(event) { how to restart the video, it is desirable from the same position when the network is restored |
Any updates on this? |
any updates? |
I try this and solve the problem.
|
I experience this often. Almost identical to what @ksheurs said. Would love an official workaround or solution for this... |
This seems like an often requested feature that when a source errors to try the next source in the list, if available. Given that videojs tries to make life easier, this seems like something that should be in core, so, I'm going to re-open this. |
@gkatsev thanks |
It's great if this feature added in video.js core. I resolve this issue according to @sylvio-ruiz(#4044) and @billwing . var timer;
function onerror(){
switch(player.error().code){
case 2:
document.getElementById('loadvideo').style.display = 'block';
timer=player.setInterval(()=>{player.load().currentTime(time).play()},5000)
break;
}
}
function onplaying(){
player.clearInterval(timer);timer=null;
} I want to know which API should I use , There is an another issue: player error event doesn't fire on mobile #5089. |
I am looking for exactly this and I am not able to answer these questions myself from the docs atm:
Reloading on error is very important for a robust experience. It would be very appreciated if videojs devs would like to tackle this, make this a first class feature and add some canonical documentation about it, so it is clear how to handle that, which feature details exactly are supported and what the user has to do to. Thank you very much for your attention! |
Bump. |
It's been a while, but we're finally adding this in. For now, we're doing it just as an option, but we'll consider enabling it by default in the future. See #7038 |
Add a `retryOnError` option. When set, during source selection, if a source fails to load, we will retry the next item in the sources list. In the future, we may enable this by default. A source that fails during playback will *not* trigger this behavior. Fixes videojs#1805.
Add a `retryOnError` option. When set, during source selection, if a source fails to load, we will retry the next item in the sources list. In the future, we may enable this by default. A source that fails during playback will *not* trigger this behavior. Fixes videojs#1805.
Cloudflare has a bug or something that when a video is streaming for about ten minutes, It'll close the connection. You'll have to refresh the page to reload the video and fast forward to where you were.
It'd be nice to make videojs catch that error and retry to download the video atleast once.
The text was updated successfully, but these errors were encountered: