Hi,

I'm experiencing a very strange behavior in the Media API.
I just play a MP3 file and update the time spent playing.

Here is a very simplistic code:

var self;
self = this;
self.interval = 50;
self.audioFile= "asd.wav";

self.audio = new Media(self.audioFile, function() {
  return console.log("Success");
}, function(error) {
  return console.log("Error " + error);
});

self.audio.play();

self.getPos = function() {
  return self.audio.getCurrentPosition(function(pos) {
    //console.log("pos", pos);
    return window.setTimeout(self.getPos, self.interval);
  });
};

window.setTimeout(self.getPos, self.interval);


The cpu usage continually increases during usage and after a while the whole app freezes or gets totally unresponsive.

I have no clue what causes this increase in CPU usage. Do you have a clue what the reason for this could be?



I also found this related question on StackOverflow
http://stackoverflow.com/questions/27146849/media-plugin-getcurrentposition-repeated-call-stops-after-some-time

Cheers,
Gerwin

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

Reply via email to