× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This is a multi-part message in MIME format.
--
When i execute the TestJMF.java programe it gives the Run Time exception i.w
Player not realized. Is any body want to help me as i am really thankful for
that. Hopefully waiting for early response.





_________________________________________________________________
Unlimited Internet access for only $21.95/month.  Try MSN!
http://resourcecenter.msn.com/access/plans/2monthsfree.asp
--
import javax.media.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.io.*;

public class TestJMF extends JFrame implements ControllerListener{
Player p;
Component cc;
Component vc;
Object waitSync=new Object();
boolean stateTransitionOK;
Container c=getContentPane();
public TestJMF(String file){
setLocation(170,80);
setSize(250,250);

try{
MediaLocator ml=new MediaLocator(file);
p=Manager.createRealizedPlayer(ml);
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e.toString());
}
  p.realize();
if(!waitForState(p.Realized)){
   JOptionPane.showMessageDialog(null,"Player Can not be realized" );
}
p.addControllerListener(this);
show();
}

    public void controllerUpdate(ControllerEvent ce){
    if(ce instanceof RealizeCompleteEvent)
    p.prefetch();
    if(ce instanceof PrefetchCompleteEvent)
    cc=p.getControlPanelComponent();
    if(cc !=null){
    c.add(BorderLayout.SOUTH,cc);
    }
    vc=p.getVisualComponent();
    if(vc !=null){
    c.add(BorderLayout.CENTER,vc);
    }
    }

    boolean waitForState(int state){
      synchronized (waitSync){
        try{
          while(p.getState() <state && stateTransitionOK)
            waitSync.wait();
          }catch(Exception e){
          JOptionPane.showMessageDialog(null,e.toString());
          }
          return stateTransitionOK;
      }
    }
public static void main(String args[]){
TestJMF t=new TestJMF("file:///h://1.mpeg");
t.addWindowListener(new WindowAdapter(){
public void windowClosed(java.awt.event.WindowEvent A) {
System.exit(0);
}
});
    }
}



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.