Issue preloading PiratePig on Firefox Android

I found another bug on html5 firefox android browser. The preloader always stuck. I’ve tried with piratepig examples and the result same. But on android chrome working fine.

I’ve tried with or without -Dcanvas the result still stuck on firefox android.

For desktop browser working fine.

Have you tried debugging, to see if it is throwing an error? Do you think it is possible it is the font it is getting stuck on? (DisplayingABitmap has an image, but no font, PlayingSound has sound, but no font, etc)


How to debugging on firefox android?

Here’s debugging result on pirate pig :

Also I tried -verbose on my game, It show error font again. But the loading assets still continue after that stuck again in the end at 484/545

Is it have any connection with this issue again ?

Note : for piratepig examples sometimes get stuck not always, but for my game it’s always stuck. I tried to downgrade the openfl version to 4.9.2 the result still same like above. No error from openfl / lime.
I can provide you my source code if you need it.


After I remove fonts, the error of font disappear but still stuck.

After I remove fonts and sound the preloader successfully loaded. For Sound I’m using .mp3 and .ogg.

Also for first time load including font and sound assets (clean cache), I get this error, on 2nd reload no error font and sound but my preloader still stuck :

Do you know what is wrong?

Hmm, it’s strange because it seems like other sounds loaded fine. Do you think it is a sound limit?

I already tried only include 4 sound only in folder sound but the result still same preloader stucked.

And like I said, on 2nd reload there is no error assets. But the preloader still stucked.

Also sometimes .png too. The assets that Error loading asset seem randomly like previous issue before (Openfl 4.8.1 : Preloader error load assets cause stopping loading at html5)

Ok, I think it’s because of .mp3 sound. Everytime I include .mp3 on firefox android it cause preloader stuck. If I only include .ogg without .mp3 the preloader load success.

But If I only include .ogg, some browser can’t load .ogg sound too. I must include .mp3 and .ogg.

I’ve tried save the .mp3 with any method still not working.

Any solution about this?

Ah you’re right. It’s because of sound limit on firefox android. Total I have 120 sound (60.mp3 and 60.ogg). If I reduce it become 100 sound the preloader run success. Is there any way to increase the sound limit on firefox android?

This is the first I have heard of it. Perhaps it would be possible to set sounds to embed="false" and load/unload them at runtime later, as you probably don’t need them all at once?

Can you give me some example? I’ll try it.

In the project.xml, something like,

<assets path="sounds" embed="false" />

That should prevent loading them as part of the preloader. Then, later, you should be able to load on your own:

Assets.loadSound ("sounds/sound1.ogg").onComplete (function (sound) { ... });

When you do this, we should keep it in cache, so you may have to either set caching to false in loadSound or go to Assets.cache to remove the sound when you are done with it.

It might also be necessary to call sound.close () to get our HTML5 sound library to dump the loaded sound

Thank you for the example. I use Assets.LoadLibrary instead of Assets.loadSound.

But, today I tried with 100sounds limitation still get stucked again same source code like yesterday.

It’s very confusing now :joy:

But the main issue was .mp3, because when I not include .mp3 the preloader was successful on firefox android.

And even when using Assets.LoadLibrary I still get error when load the sound:
The buffer passed to decodeAudioData contains invalid content which cannot be decoded successfully.

Or I’m wrong when saving .mp3? I already tried it with any method of saving .mp3 and this .mp3 issue only at firefox android.

Or maybe it’s bug from firefox android self? I’m using the latest version 54.0.1 on android device.

Perhaps we can blacklist the browser somehow, and not fetch MP3s for multi-format sounds in that case :confused:

Is there a way to do that? It will be great.