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

Retry the video in case of Network error #26

Open
avinlakhera opened this issue Jun 16, 2017 · 4 comments
Open

Retry the video in case of Network error #26

avinlakhera opened this issue Jun 16, 2017 · 4 comments

Comments

@avinlakhera
Copy link

Hi,

How can i retry for the video when I gets network error. I have tried to get error using

this.player.on('error',(e)={ 
 console.log(e)
})

But this one doesn't catch any error even though I am getting 404 error in console.

Any suggestion for this one

Thanks,

@ganigeorgiev
Copy link
Contributor

ganigeorgiev commented Aug 28, 2017

@avinlakhera I had a similar issue. After looking at the code, it seems that all hls.js events are broadcasted to the tech component (https://github.com/Peer5/videojs-contrib-hls.js/blob/master/src/videojs5.hlsjs.js#L96):

player.tech_.on('manifestLoadError', function () {
  // do something...
});

Full list with error events thrown by hls.js - hls.js errors (hls.js API)

@hoodsy
Copy link

hoodsy commented Dec 13, 2017

@ganigeorgiev I'm unable to trigger any of the error handlers on tech_. What was the scenario that fired the error for you?

@ganigeorgiev
Copy link
Contributor

@hoodsy Oops, probably I didn't check the exact event error in my previous comment or something has changed from the last time I used it.

Looking back at the code (Line #100) only Hls Runtime Events are broadcasted. To handle the error you could listen to Hls.Events.ERROR and check its type (or other error data specific property).

jsfiddle example - https://jsfiddle.net/m3sf8nav/

@hoodsy
Copy link

hoodsy commented Dec 13, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants