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:
-----------------------
<HTML>
<HEAD><TITLE>Test Program</TITLE></HEAD>
<BODY>


<APPLET CODE=PlayerApplet
WIDTH=352 HEIGHT=240>
<PARAM NAME=FILE VALUE="mmvcd.mpeg">
</APPLET>

</BODY>
</HTML>




The Java Code Says:
------------------------
import java.applet.*;
import java.awt.*;
import java.net.*;
import javax.media.*;

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);
         player.addControllerListener(this);
      }
      catch (Exception e) {
         System.err.println("Got exception "+e);
      }
   }
   public void start() {
      player.start();
   }
   public void stop() {
      player.stop();
      player.deallocate();
   }
   public void destroy() {
      player.close();
   }
   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);         
         validate();
      }
   }
}

pauldhadiallaAsked:
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.

TimYatesCommented:
I don't believe you can just use the javax.media classes in an applet
0
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.

Regards.
0
CEHJCommented:
AFAIK, Java does not ordinarily support mpeg. See http://www.alphaworks.ibm.com/tech/mpeg-4
0
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)
0
CEHJCommented:
Have a look for exceptions in the plugin console
0
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.
Hmm
0
CEHJCommented:
>>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:

http://www.fitwise.com/testjava.asp
0
objectsCommented:
Is the plugin set as the default VM for your browser? and do you have JMF installed?
0
objectsCommented:
ie. you need both

(and jmf does support mpeg)
0
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 java.security.SecureClassLoader.defineClass(Unknown Source)

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

      at sun.plugin.security.PluginClassLoader.findClass(Unknown 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 sun.applet.AppletPanel.run(Unknown Source)

      at java.lang.Thread.run(Unknown Source)

0
objectsCommented:
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)
0

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
CEHJCommented:
8-)
0
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
Java

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.