mirror of
https://gitea.invidious.io/iv-org/invidious
synced 2024-12-26 08:44:32 +01:00
Reload player on error
This commit is contained in:
parent
097cbcdae3
commit
b38a2bbd12
@ -114,6 +114,18 @@ var player = videojs("player", options, function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
player.on('error', function(event) {
|
||||||
|
console.log("An error occured in the player, reloading...");
|
||||||
|
|
||||||
|
var currentTime = player.currentTime();
|
||||||
|
player.load();
|
||||||
|
if (currentTime > 0.5) {
|
||||||
|
currentTime -= 0.5;
|
||||||
|
}
|
||||||
|
player.currentTime(currentTime);
|
||||||
|
player.play()
|
||||||
|
});
|
||||||
|
|
||||||
player.share(shareOptions);
|
player.share(shareOptions);
|
||||||
|
|
||||||
<% if params[:video_start] > 0 || params[:video_end] > 0 %>
|
<% if params[:video_start] > 0 || params[:video_end] > 0 %>
|
||||||
|
Loading…
Reference in New Issue
Block a user