1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
This commit is contained in:
daniel 2020-01-13 21:43:46 -03:00
parent ee5a685cc4
commit c4493c5d17

View file

@ -475,10 +475,10 @@ function inIframe() {
}
var promisePlayTimeoutTime = 0;
var promisePlayTimeout;
var promisePlay;
var promisePlay;
function playerPlay(currentTime) {
if (typeof player !== 'undefined') {
promisePlayTimeoutTime+=1000;
promisePlayTimeoutTime += 1000;
if (currentTime) {
player.currentTime(currentTime);
}
@ -491,15 +491,14 @@ function playerPlay(currentTime) {
playerPlay(currentTime);
}, promisePlayTimeoutTime);
console.log("playerPlay: promise found");
console.log(promisePlay);
promisePlay.then(function () {
console.log("playerPlay: Autoplay started");
clearTimeout(promisePlayTimeout);
}).catch(function (error) {
console.log("playerPlay: Autoplay was prevented, trying to mute and play");
// Show something in the UI that the video is muted
console.log("playerPlay: Autoplay was prevented, trying to mute and play ***");
player.muted(true);
playerPlay(currentTime);
});
} else {
promisePlayTimeout = setTimeout(function () {