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

Discussion in 'Java' started by steven robinson, Nov 9, 2003.

  1. 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
     
    steven robinson, Nov 9, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel
    Replies:
    0
    Views:
    829
    Daniel
    Apr 12, 2005
  2. dan bean

    JMF Player DRIVING ME CRAZY!

    dan bean, Jan 31, 2006, in forum: Java
    Replies:
    0
    Views:
    479
    dan bean
    Jan 31, 2006
  3. Christian Otteneuer

    Swing and JMF Media Player

    Christian Otteneuer, Apr 23, 2006, in forum: Java
    Replies:
    4
    Views:
    15,845
    sumanjara
    May 28, 2010
  4. Replies:
    1
    Views:
    777
    Andrew Thompson
    Jul 20, 2006
  5. Replies:
    0
    Views:
    2,405
Loading...

Share This Page