mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
iphone fix
This commit is contained in:
parent
f7f745a083
commit
d91c0ef83e
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue