@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, thedurationvalue 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