JMF Project - Urgent help needed!! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

JMF Project - Urgent help needed!!

sockysocky Posts: 1Member

Hi all

I am writing a jmf based applet to play mp3's for my final year project, but can't get it to work.
I've checked all the examples i could find on the net and still can't see what i'm doing wrong. When i try to load the the page i keep getting "Applet Crashed". JMF is correctly installed on my system. I've been stuck with it for over a month, and the project is due in the next week

If anyone has experience with JMF i'd appreciate it greatly if you could take a look at my code and maybe you can help point out where i'm going wrong

thanks

Tim

[email protected]

[email protected]_

package playerappletfinal;

import java.applet.*;
import java.awt.*;
import java.net.*;
import javax.media.*;

/**
*

Title: NetRadio Applet

*
*

Description: Applet to play an mp3 when loaded

*
*

Copyright: Copyright (c) 2005

*
*

Company:

*
* @author not attributable
* @version 1.0
*/

public class NetRadio extends Applet implements ControllerListener
{
Player netRadio = null;

public void init()
{
setLayout( new BorderLayout() );
String fileName = getParameter( "FILE" );
try
{
MediaLocator fileAddress = new MediaLocator( fileName );
netRadio = Manager.createPlayer( fileAddress );
netRadio.addControllerListener( this );
netRadio.realize();
}
catch (Exception error)
{
System.err.println( "Exception " + error );
}
}

public void start()
{
netRadio.start();
}

public void stop()
{
netRadio.stop();
netRadio.deallocate();
}

public void destroy()
{
netRadio.close();
}

public synchronized void controllerUpdate( ControllerEvent event )
{
if ( event instanceof RealizeCompleteEvent )
{
Component component;
if ( ( component = netRadio.getControlPanelComponent() ) != null )
add ( "Center", component );
}
}
}

_________________________________________________________________






Sign In or Register to comment.