I’m using a simple Media call such as:
var mymusic = new Media(SRC);
mymusic.play();
And I see in the console, this warning:
THREAD WARNING: ['Media'] took '22.630859' ms. Plugin should use a background thread
Now, the time is high ( 22ms ) because I accidentally did something like this ( since I had problems loading the Media file and did this to debug it ):
function prepare_music() {
var mymusic = new Media(SRC);
mymusic.play();
return mymusic;
}
var song1 = prepare_music();
song1.play()
And it got me thinking - if it played it twice, how’s that I didn’t hear it twice ?! I only heard my first click to play the music.
Removing the “mymusic.play();” from the function, lowered the time to 16ms ( and I still see the warning )
So,
- I read in PhoneGap that Apple doesn’t like UI blockers, so I wonder if this is a concern.
- How do I take something to the background ?
- How do I play/overlap the music ? ( like playing 2 sounds, one for background music, 2nd for clicks and stuff … )