mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
try to reload videojs in case it fail
This commit is contained in:
parent
bd6094f03b
commit
86397835aa
2 changed files with 29 additions and 0 deletions
|
@ -2843,4 +2843,29 @@ function videoJSRecreateSources(defaultSource){
|
|||
if(!empty(fixResolutionMenu)){
|
||||
fixResolutionMenu();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* MEDIA_ERR_ABORTED (numeric value 1)
|
||||
MEDIA_ERR_NETWORK (numeric value 2)
|
||||
MEDIA_ERR_DECODE (numeric value 3)
|
||||
MEDIA_ERR_SRC_NOT_SUPPORTED (numeric value 4)
|
||||
MEDIA_ERR_ENCRYPTED (numeric value 5)
|
||||
*/
|
||||
var AvideoJSErrorReloadedTimes = 0;
|
||||
function AvideoJSError(code){
|
||||
switch (code) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
if(empty(AvideoJSErrorReloadedTimes)){
|
||||
AvideoJSErrorReloadedTimes++;
|
||||
setTimeout(function(){
|
||||
reloadVideoJS();
|
||||
},2000);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue