Problem initializing device in applet for logitech camera
I have an applet that uses a logitech camera.
It works fine in the applet viewer for JBuilder 2005, but cannot initialize the camera in IE browser.
The applet is signed, so that is not the problem.
The error occurrs in the following line
di = CaptureDeviceManager.getDevice(str2);
in the following method:
public boolean initCamera()
{
try
{
System.out.println( "Initializing device = " + str2 );
try
{
System.out.println("device = " + CaptureDeviceManager.getDevice(str2));
di = CaptureDeviceManager.getDevice(str2);
}
catch( Exception ex )
{
System.out.println( ex.toString() );
}
System.out.println( "Capture device = " + di.toString());
ml = di.getLocator();
System.out.println( "Locator = " + ml.toString() );
player = Manager.createRealizedPlayer(ml);
System.out.println( "Player = " + player.toString());
player.start();
System.out.println( "Player started" );
}
catch( Exception e )
{
System.out.println( "Error initializinig video player");
System.out.println( e.toString() );
return false;
}
return true;
}
I get the following error in the Applet
Initializing device = vfw:Microsoft WDM Image Capture (Win32):0
device = null
Error initializinig video player
java.lang.NullPointerException
I get the following in the Applet Viewer
Initializing device = vfw:Microsoft WDM Image Capture (Win32):0
device = vfw:Microsoft WDM Image Capture (Win32):0 : vfw://0
<camera list snipped>
Locator = vfw://0
Player = com.sun.media.content.unknown.Handler@6295eb
Player started
Camera started

