ionic-audio icon indicating copy to clipboard operation
ionic-audio copied to clipboard

Add an onProgress event to the audio track

Open KadjoFamian opened this issue 8 years ago • 2 comments

Hi, I am looking for a way to arbitrary stop the current track. I need a kind of "sample listening". the idea is to be able to stop the music after X second of playing.

Here is an example of how that feature can look

`onProgress(track){

//stop after 30 seconds if(track.progress == 30){ this.audioProvider.tracks[track.id].stop(); } }

`

I guess that it is the same feature used to update the progress bar (time and position).

I could be very interesting to add this.

Thanks for your time

KadjoFamian avatar Nov 22 '17 19:11 KadjoFamian

The event i was looking for is 'ontimeupdate'. I noticed that in "ionic-audio-web-track.ts", all the traditionnal events are implemented. But i don't know how to access them since AudioTrackComponent class provide only one method : "onFinish"

Does anybody know how to listen to web audio traditionnal event ?

any idea will be appreciated, Thanks

KadjoFamian avatar Dec 05 '17 11:12 KadjoFamian

Hi, did you figure out how to get the progress value?

ghonche avatar Apr 28 '20 18:04 ghonche