Curious to know if there is a feature in Howler JS that allows for notifications every second? This would be useful for updating a state variable that keeps track of the duration a song has been playing. One approach could be:
var audio = new Howl({
xhr: {
method: 'POST',
headers: {
Authorization: 'Access-Control-Allow-Origin:*',
},
withCredentials: true,
},
loop: true,
volume: 1,
format: ['mp3'],
src: [mp3],
});
audio.play();
let timePosition: number = 0;
const timer = interval(1000).subscribe((v) => {
console.log(v);
if (!audio.playing()) {
timer.unsubscribe();
}
timePosition = audio.seek();
console.log(timePosition);
I am interested in finding out if Howler offers a function like:
const interval = 1000;
song.on(interval, callback)
This way the callback would be executed until the song finishes playing?