/**
 * MP3 Player Thead class
 * 
 * Simple thread that plays a JLayer Player object
 * Created by Philip Peng
 * Last updated: 2007/10/09
 * 
 */

// Use basic player
import javazoom.jl.player.Player;

public class MP3PlayerThread extends Thread {
	
	public Player player;
	
	/**
	 * Instantiates a thread with JLayer's Player object as argument
	 */
	public MP3PlayerThread ( Player player ) {
		try {
			this.player = player;
		} catch ( Exception e ) {
			e.printStackTrace();
		}
	}
	
	/**
	 * Plays JLayer's Player object; called by start()
	 */
	public void run() {
		// Play the stream
		try {
			player.play();
		} catch( Exception e ) {
			e.printStackTrace();
		}
	}

}
