Details
Description
I am using ionic to build a stream audio player (spotify like) and trying to build the player using cordova media plugin.
I tried to follow the instruction in Cordova media plugin page to get duration, but it showing a different result.
The audio file (.ogg) that I upload has 4:18, but in my android, it only has 3:17. Is there something wrong with the code?
here is my getDuration Method
var self = this;
var counter = 0;
var timerDur = $interval(function() {
counter = counter + 100;
if (counter > 2000)
var dur = self.media.getDuration();
if (dur > 0) {
$interval.cancel(timerDur);
//document.getElementById('audio_duration').innerHTML = (dur) + " sec";
self.duration = dur * 1000;
}}, 100);