Media player maturity (on Mac)
David DeHaven
david.dehaven at oracle.com
Thu Mar 12 19:48:38 UTC 2015
> > One more question regarding this. Is it OK to have many instances of AudioClip or MediaPlayer if only a few of them actually play stuff or do they block audio resources even when they are stopped?
>
> You can have as many as memory will allow :) They don’t tie up hardware resources until actually playing. I actually recommend pre-loading AudioClips to avoid startup latency, especially if they’re fetched remotely.
>
> Thanks for the info!
Oh, and if you have a lot of AudioClips, it’s best to spawn a new thread to load them up asynchronously, otherwise you could block the main application thread which will render the UI unresponsive while it’s loading. We’ve seen this happen on a couple occasions...
I wanted to provide a library API to handle pre-loading, but didn’t have the time or resources :(
-DrD-
More information about the openjfx-dev
mailing list