mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
This commit is contained in:
parent
08049138a1
commit
b39883db49
1 changed files with 5 additions and 2 deletions
|
@ -401,7 +401,7 @@ var promisePlaytry = 10;
|
|||
var promisePlayTimeoutTime = 0;
|
||||
var promisePlayTimeout;
|
||||
var promisePlay;
|
||||
|
||||
var browserPreventShowed = false;
|
||||
function playerPlay(currentTime) {
|
||||
if(typeof player === 'undefined' || !player.isReady_){
|
||||
setTimeout(function(){playerPlay(currentTime);},200);
|
||||
|
@ -413,7 +413,10 @@ function playerPlay(currentTime) {
|
|||
}
|
||||
if (promisePlaytry <= 0) {
|
||||
console.log("playerPlay: promisePlaytry <= 0");
|
||||
$.toast("Your browser prevent autoplay");
|
||||
if(!browserPreventShowed){
|
||||
browserPreventShowed = true;
|
||||
$.toast("Your browser prevent autoplay");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
promisePlaytry--;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue