I have multiple audio players on a page for narration. For example, clicking a graphic item triggers playback of a particular player. The issue is that seek(0) only works on the second click. On the first trigger, the audio cues from whatever position it’s at, rather than seeking to 0 first.
Is this a bug? The code is below. I have a switch to turn narration on/off and the “target” is the videoPlayer object passed to the function. It works fine except it initially doesn’t go to 0 until you click a second time. It does the same if I seek(0) directly in the calling function. It doesn’t seek until the second time it’s called.
export function playAudio(target){
$w(target).seek( 0 ); if ($w( “#narrate” ).checked == true )
{
$w(target).play();
}
}
I tried firing .seek(0) twice in the function, still doesn’t work until the function is called the second time.