cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerwin Brunner <gerwin.brun...@gmail.com>
Subject Re: Media getCurrentPosition kills app after a while (cpu usage increases continously
Date Mon, 01 Jun 2015 08:16:08 GMT
Anybody got an idea why this happens?

Gerwin Brunner wrote:
> 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-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message