1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00

iphone fix

This commit is contained in:
DanieL 2022-09-06 10:37:00 -03:00
parent f7f745a083
commit d91c0ef83e

View file

@ -1114,13 +1114,18 @@ function setCurrentTime(currentTime) {
initdone = false;
// wait for video metadata to load, then set time
player.on("loadedmetadata", function () {
console.log('setCurrentTime loadedmetadata', currentTime);
player.currentTime(currentTime);
});
// iPhone/iPad need to play first, then set the time
// events: https://www.w3.org/TR/html5/embedded-content-0.html#mediaevents
player.on("canplaythrough", function () {
if (!initdone) {
console.log('setCurrentTime canplaythrough will set time', currentTime);
setTimeout(function(){
console.log('setCurrentTime canplaythrough', currentTime);
player.currentTime(currentTime);
},1000);
initdone = true;
}
});