4 Replies Latest reply: Feb 10, 2012 10:35 AM by 916640 RSS

    Player Exception quick Help

      i have a code to see through the webcam
      import javax.media.Manager;
      import javax.media.MediaLocator;
      import javax.media.Player;
      import javax.swing.*;
      import java.awt.Component;
      public class SwingCapture {
           public static void main(String[] args) {
                otro perro=new otro();
      class otro extends JFrame{
           JLabel Imagen;
                Imagen=new JLabel();
                setLayout( null ); // use a BorderLayou      
                setTitle("Prueba de Camara Web");
           public void proceso(){
                     Manager.setHint( Manager.LIGHTWEIGHT_RENDERER, true );
                     MediaLocator ml = new MediaLocator("vfw://0");
                     Player p = Manager.createRealizedPlayer(ml);
                     Component video = p.getVisualComponent();
                     if ( video != null ){
                          // add video to the component
                      add( video);
                }catch(Exception e){
      but it throw the next exception
      javax.media.NoPlayerException: Cannot find a Player for :vfw://0
           at javax.media.Manager.createPlayerForContent(Manager.java:1412)
           at javax.media.Manager.createPlayer(Manager.java:417)
           at javax.media.Manager.createRealizedPlayer(Manager.java:553)
           at ratatouille.otro.proceso(SwingCapture.java:31)
           at ratatouille.SwingCapture.main(SwingCapture.java:14)
      where is the error?

      PD:sorry for my bad english

      Edited by: 913637 on 09-feb-2012 20:39

      Edited by: RockBytes on 10-feb-2012 7:47