fandy chandra created CB-11820:
----------------------------------

             Summary: Cordova Media Plugin media.getDuration
                 Key: CB-11820
                 URL: https://issues.apache.org/jira/browse/CB-11820
             Project: Apache Cordova
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Plugin Media
    Affects Versions: 3.4.0
         Environment: Android 4.4 above
            Reporter: fandy chandra


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) {
      $interval.cancel(timerDur);
   }
   var dur = self.media.getDuration();
   if (dur > 0) {
      $interval.cancel(timerDur);
      //document.getElementById('audio_duration').innerHTML = (dur) + " sec";
      self.duration = dur * 1000;
   }}, 100);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to