JMF and client side Applet problem



HI,

I need to create an Applets and applications that will transmits and
receive media using RTP in [JMF]Java Compatible environment--
including Web browsers--without
having to worry about client side JMF installation.Will it be possible
to deploy a java applet on a client browser without having the client
to install stuff?

My Applet will run on client machine and need to capture and play
audio and video using JMF.
My Applet also needs JMF classes so, i send jmf.jar file with my
applet.
My Applet is also signed.

I also try with some alternate on client machine where JMF is not
installed.
I keep perform.wav on client machine at location c:\perform.wav and
try to create Processor object using MediaLocator but it is also not
working.

MediaLocator ml = new MediaLocator("file://c:/perform.wav");

above line works but :->

processor = Manager.createProcessor(ml);

is not working.

so can any one clear that, for creating Processor object we also need
JMF installation at client machine even we send jmf.jar file with our
applet.

Note here I am not trying to Capture Client Device

import javax.media.*;
import javax.media.control.*;
import javax.media.datasink.*;
import javax.media.format.*;
import javax.media.protocol.*;
import javax.media.control.TrackControl;
import jmapps.util.StateHelper;

import java.io.*;
import java.util.*;

public class SoundApplet extends java.applet.Applet {

public void init() {
//doSpeak();
//doSpeakJMF();
doRTPWork();
}

private void doRTPWork() {

MediaLocator ml = null;

Processor processor = null;
StateHelper sh = null;

try{
ml = new MediaLocator("file://c:/perform.wav");
}catch(Exception ex){
System.out.println("*exceptoin* "+ex);
}
//http://groups.google.co.in/group/comp.lang.java.programmer/
browse_thread/thread/1fa2b20a25eadba0/965262ce1bdeb4bb?lnk=st&q=jmf
+applet+without+installation&rnum=1&hl=en#965262ce1bdeb4bb
try{
System.out.println("a");
processor = Manager.createProcessor(ml);
System.out.println("b");
sh = new StateHelper(processor);
System.out.println("c");
}/*catch (IOException e) {
System.out.println("**22** io exception:-> "+e);
System.exit(-1);
}*/catch (NoProcessorException e) {
System.out.println("*33* no processor exception:-> "+e);
System.exit(-1);
}catch(Exception ex){
System.out.println("*44*:-> "+ex);
}

// Configure the processor
processor.configure();
while (processor.getState() != Processor.Configured){
System.out.println("state:-> "+processor.getState());
System.out.println("configured:-> "+Processor.Configured);
}

processor.realize();
while(processor.getState()!=Processor.Realized);

System.out.println("d");
if (!sh.configure(10000))
System.exit(-1);

System.out.println("e");

// Set the output content type and realize the processor
//processor.setContentDescriptor(new
FileTypeDescriptor(FileTypeDescriptor.WAVE));
//processor.setContentDescriptor(new
ContentDescriptor( ContentDescriptor.RAW));
processor.setContentDescriptor(new
ContentDescriptor( ContentDescriptor.RAW_RTP));
System.out.println("f");

/*if (!sh.realize(10000))
System.exit(-1);*/

// create a File protocol MediaLocator with the location of
the
// file to which the data is to be written
MediaLocator dest = new MediaLocator("rtp://
192.168.1.7:8080");
System.out.println("h");
// get the output datasource of the processor and exit
// if we fail
DataSource source = null;

try {

source = processor.getDataOutput();
System.out.println("i");
}catch (NotRealizedError e) {
System.out.println("*5* no realized error:-> "+e);
System.exit(-1);
}catch (Exception e) {
System.out.println("*6* exception creating datasource:->
"+e);
System.exit(-1);
}

// hand this datasource to manager for creating an RTP
// datasink our RTP datasink will multicast the audio
try{
DataSink d = Manager.createDataSink(source, dest);
System.out.println("j");
d.open();
System.out.println("k");
d.start();
System.out.println("l");
processor.start();
System.out.println("m");
}catch (Exception e) {
System.out.println("*7*:-> "+e);
System.exit(-1);
}
}
}

.



Relevant Pages

  • Re: how to connect a chat applet to the server
    ... I have just started dabbling in applets and as a practise am trying to develop a chat server and client. ... RMI by itself does not necessarily eliminate polling. ... Do note, however, that if the client is implemented as an applet, then either the applet must be digitally signed, or the chat server must be the same machine as the one the serves up the applet. ...
    (comp.lang.java.programmer)
  • Re: SSL Authentication using Java or JSP
    ... letting the browser get involved. ... where the Applet can be loaded. ... The app at that URL gets the information from the client cert, and writes it into the user's session, i.e. authenticates the session. ... In this way, all the sensitive data is conveyed over client-cert authenticated connections, and you have the guarantee that there is no access to sensitive info without the client cert. ...
    (comp.lang.java.programmer)
  • Re: Calling a DLL from a Java Applet
    ... >> The applet runs on the client. ... >> jar, a dll or whatever, the code runs on the client. ... >> Then make the applet a client of that server. ...
    (comp.lang.java)
  • Re: newbie: Java applets (authentication?)
    ... >>client and the server. ... This will add some complextiy to your applet but ... >>should be easy enough to configure on your webserver. ... communicate through a central webserver running PHP scripts. ...
    (comp.lang.java.help)
  • Re: AJAX v Applet
    ... The browser who host an applet is a thick client: ... A client that uses Ajax it not a thick client. ...
    (comp.lang.java.programmer)