I’m trying to get currentTime value. Code works well in Velo preview.
The problem is, that Console in Google Chrome shows not the number, but ’ onTimeUpdated ’ value.
On my site:
In first step I load .src of audio
.then search database, get previous currentTime value
.then audio.seek(fromDatabase)
.then I set Player.onPause event listener.
When I start playing, then pause, output is the same (‘onTimeUpdated’), so my theory that audio.seek messes up in currentTime searching, rather doesn’t work here.
$w("#audioPlayer1").onPause((event) => {
let ctime = $w("#audioPlayer1").currentTime;
console.log("Time taken: "+Object.values(ctime)); //value in Chrome: Time taken: onTimeUpdated
let ttime = Number(ctime);
console.log("Time taken: "+ttime); //Time taken: NaN
}