You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to code up something that acts like a timeline. playing FROM a specific time is easy. but playing UNTIL a certain time is not so easy. It seems like 'player.currentTime' temporal resolution to the browser is very low.
If I use the below code, it works, the pause kicks in up to a 1.5seconds passed where I want it to. so i have to pad my mp4 a lot.
//START PLAY FROM BUTTON
var b = document.getElementById("mylinkb");
b.onclick=function(){
player.currentTime = 4;
player.play();
return false;
}
//STOP PLAY AT SPECIFIC TIME
function runFunction() {
let y = (player.currentTime);
if (y>5.3) {player.pause();}
}
Any suggestions for tightening up player.currentTime ? it slips quite a bit. Thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to code up something that acts like a timeline. playing FROM a specific time is easy. but playing UNTIL a certain time is not so easy. It seems like 'player.currentTime' temporal resolution to the browser is very low.
If I use the below code, it works, the pause kicks in up to a 1.5seconds passed where I want it to. so i have to pad my mp4 a lot.
//START PLAY FROM BUTTON
var b = document.getElementById("mylinkb");
b.onclick=function(){
player.currentTime = 4;
player.play();
return false;
}
//STOP PLAY AT SPECIFIC TIME
function runFunction() {
let y = (player.currentTime);
if (y>5.3) {player.pause();}
}
Any suggestions for tightening up player.currentTime ? it slips quite a bit. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions