Java Player/Applet

Hi Guys. I am trying to get an applet to play a mpeg file through an html page and I have it setup like below. Every time I run it, it gives an error saying that Applet PlayerApplet notinited. I'm sure i'm doing something wrong.
Please help (Btw - the video clip is called mmvcd.mpeg and all these files/html/class etc are on my desktop)

If another approach is better to make this play thats cool too. Just need something ultra simple.
Thanks kindly

The html page says:
<HEAD><TITLE>Test Program</TITLE></HEAD>

<APPLET CODE=PlayerApplet
<PARAM NAME=FILE VALUE="mmvcd.mpeg">


The Java Code Says:
import java.applet.*;
import java.awt.*;

public class PlayerApplet extends Applet implements ControllerListener {
   Player player = null;
   public void init() {
      setLayout(new BorderLayout());
      String mediaFile = getParameter("FILE");
      try {
         URL mediaURL = new URL(getDocumentBase(), mediaFile);
         player = Manager.createPlayer(mediaURL);
      catch (Exception e) {
         System.err.println("Got exception "+e);
   public void start() {
   public void stop() {
   public void destroy() {
   public synchronized void controllerUpdate(ControllerEvent event) {
      if (event instanceof RealizeCompleteEvent) {
         Component comp;
         if ((comp = player.getVisualComponent()) != null)
            add ("Center", comp);
         if ((comp = player.getControlPanelComponent()) != null)
            add ("South", comp);         

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don't believe you can just use the classes in an applet
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

pauldhadiallaAuthor Commented:
Thanks Tim, any suggestion on how I can run a basic mpeg file with a applet. Still very new fo JMF here.

AFAIK, Java does not ordinarily support mpeg. See
pauldhadiallaAuthor Commented:
CEHJ - i'm even trying .mov files and .wmv files and I keep getting this error saying Applet PlayerApplet "notinited"

I check the plug-in settings for Java Plug-in too and they seem to be ok for my browser (IE)
Have a look for exceptions in the plugin console
pauldhadiallaAuthor Commented:
CEHJ where is this plug-in console you are referring to?

I did go into IE options and started using the Microsoft VM and now the error doesn't come up any more
It just says done and no video.
>>CEHJ where is this plug-in console you are referring to?

That varies depending on what browser version you're using. The following may help:
Is the plugin set as the default VM for your browser? and do you have JMF installed?
ie. you need both

(and jmf does support mpeg)
pauldhadiallaAuthor Commented:
Objects - i have installed JMF yes, and fixed the classpath to point to the jmf and sound jar files

The default VM for my browser - I tried using both the MS version and the JAVA one. When i have the MS version enabled, the error Applet PlayerApplet "notinited"
 goes away from IE - and it just says Done. When i turn it on for IE - it gives me the same error

I even downloaded Netscape 7.2 and it also gives me that error Applet PlayerApplet "notinited".

CEHJ - here is the ouput from the console after I open my web page and i get the error (using Sun Java JVM) - if I use MS VM then no output in console - but no video in applet either.

java.lang.NoClassDefFoundError: javax/media/ControllerListener

      at java.lang.ClassLoader.defineClass0(Native Method)

      at java.lang.ClassLoader.defineClass(Unknown Source)

      at Source)

      at sun.applet.AppletClassLoader.findClass(Unknown Source)

      at Source)

      at java.lang.ClassLoader.loadClass(Unknown Source)

      at sun.applet.AppletClassLoader.loadClass(Unknown Source)

      at java.lang.ClassLoader.loadClass(Unknown Source)

      at sun.applet.AppletClassLoader.loadCode(Unknown Source)

      at sun.applet.AppletPanel.createApplet(Unknown Source)

      at sun.plugin.AppletViewer.createApplet(Unknown Source)

      at sun.applet.AppletPanel.runLoader(Unknown Source)

      at Source)

      at Source)

looks like jmf is not installed on the client correctly
i'd suggest copying the jars to the jre's 'ext' directory (<jre>/lib/ext)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.