1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Some updates regarding autoplay and loop

https://github.com/WWBN/AVideo/issues/3699
This commit is contained in:
DanielnetoDotCom 2020-09-24 10:58:12 -03:00
parent 515fb52c75
commit 9f6394f3b0

View file

@ -647,7 +647,13 @@ function tooglePlayerLoop() {
setPlayerLoop(!isPlayerLoop());
}
var setPlayerLoopSetTimeout;
function setPlayerLoop(loop) {
clearTimeout(setPlayerLoopSetTimeout);
if(typeof player === 'undefined'){
setPlayerLoopSetTimeout = setTimeout(function(){setPlayerLoop(loop)},1000);
return false;
}
if (loop) {
console.log("Loop ON");
$.toast("Loop ON");
@ -690,7 +696,7 @@ function toogleImageLoop(t) {
function isPlayerLoop() {
var loop = Cookies.get('playerLoop');
if (!loop || loop === "false") {
return false;
return player.loop();
} else {
return true;
}