Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

[MediaPlugin] How to know the aduio playback is done?

$
0
0

@danielle113 wrote:

Hi,

In my app, user clicks the button to play an audio file (a 3gp file, in my android tablet).
I'd like to disable the button during the playback and enable it again when done.

I considered to get the file duration like below, then getCurrentPosition() to compare the two value.
However, the duration value is -1. What can I do to achieve the desire?

// get file duration
let audioObject: MediaObject = this.media.create(fileURI);
let duration = audioObject.getDuration();
console.log(duration);

Thanks,
Danielle

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>