/**
* Instantiate low-level player.
*/
public void loadJS()
{
BasicPlayer bplayer = new BasicPlayer();
List mixers = bplayer.getMixers();
if (mixers != null)
{
Iterator it = mixers.iterator();
String mixer = config.getAudioDevice();
boolean mixerFound = false;
if ((mixer != null) && (mixer.length() > 0))
{
// Check if mixer is valid.
while (it.hasNext())
{
if (((String) it.next()).equals(mixer))
{
bplayer.setMixerName(mixer);
mixerFound = true;
break;
}
}
}
if (mixerFound == false)
{
// Use first mixer available.
it = mixers.iterator();
if (it.hasNext())
{
mixer = (String) it.next();
bplayer.setMixerName(mixer);
}
}
}
// Register the front-end to low-level player events.
bplayer.addBasicPlayerListener(mp);
// Adds controls for front-end to low-level player.
mp.setController(bplayer);
}