jmf player skipping, do I need to start player within a thread?

  • Thread starter steven robinson
  • Start date
S

steven robinson

Hi
I am having problems with media player. When there are other processes
running in the background or foreground the jmf media player starts
skipping and sounds terrible. Here is my code:

private void createPlayer()
{
if(file == null)
{
System.out.println("file has null content");
return;
}
removeOldPlayer();//remove earlier players
try
{
//create a new player
player = Manager.createPlayer(file.toURL());
player.addControllerListener(this);//add listener to my player
player.start();
}

catch(Exception e)
{
System.err.println("Error creating player, possible missing file");
}

The code works fine and plays the audio file with no problem, its only
when my computer is doing other things that the player goes to pot.
Should I be running the player in a thread? If so how do I do that, I
have no experience with threads. Please help.

Thanks
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top