Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JMF Applet without client side installation

Reply
Thread Tools

JMF Applet without client side installation

 
 
amitatgroups@gmail.com
Guest
Posts: n/a
 
      07-28-2007
Hi,
Thanks for reply,

i need/want to implement an Applet which will run on Client machine
using my web page(web browser). Applet is used to establish voice
chatting using VOIP but without client side Installation stuff.

Applet need to get voice from Microphone and send that voice using RTP
protocol, JMF support RTP.

I already created such applet with JMF support but when i run such
applet over box which contain JMF will run smoothly but when i run
such applet on box which don't contain JMF fail to work.

help me to resolve the issue for box which do not have JMF. I don't
want to install JMF on client machine.

Thanks...





 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      07-28-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
...
>i need/want to implement an Applet which will run on Client machine
>using my web page(web browser). Applet is used to establish voice
>chatting using VOIP but without client side Installation stuff.


You explained a lot in this post, but I am still not
clear on any answer to 'why not use web start'?

This will be *very* difficult to deploy as a standard
applet embedded in a web page.

Note that web start does offer the ability to get
an applet or application running on a client PC,
"..using my web page(web browser)" that is one
of its major strengths.

As to the 'without installation' part, forget it.
The code *must* be present for the app. to run,
there is no way around that. The real issue here
(as far as I understand) is to not force the user to
go through any 'special setup'* to use the app., and
that can be achieved fairly easily, using web start.

* Short of OK'ing some confirmation dialogs, which
is what an applet that captures audio would need to
do, anyway.

As an aside, one perennial problem with capturing
sound in an applet using JMF, is that even if the applet
is signed, the JMF code uses a configuration setting
within the JMF registry to decide whether to allow the
applet to record. That setting defaults to 'no' in the
JMF set-up installer, and most people accept that
setting.

Besides that, there a variety of security issues with
applets that might trip up this applet, people are very
cautious about allowing applets out of their 'sandbox',
with good cause ("the web page, that watches you
back!").

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.asp...neral/200707/1

 
Reply With Quote
 
 
 
 
amitatgroups@gmail.com
Guest
Posts: n/a
 
      07-28-2007
Thanks,

I got your point,
You suggest me to use Java Web Start for Java Based Application, JWS
will take care of installation at client machine right.

1) Is JMF based applet need installation, if yes is there no way to
avoid installation stuff.
2) For applet can i use JWS because I'll suppose to develop VOICE Chat
using Applet using JMF, If yes can u suggest any example.

Thanks,


 
Reply With Quote
 
Amit Jain
Guest
Posts: n/a
 
      08-09-2007
Hi Andrew,
I go through your suggestion and tried deployment of my applet using
"Java WebStart" and succeed. But my applet is still not able to
capture the client machine device.

can you suggest me next approach to resolve the problem.
can you give me your email id so that i can send you my web
application folder containing all .jnlp and .jar files.



 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-09-2007
Amit Jain wrote:
>Hi Andrew,


G'day Amit. Thanks for reminding me of this thread,
I had not realised I left it 'hanging'. But your further
post reminded me that it required my attention..

(and no need to mention the MP matter again - it
is solved and over)

>I go through your suggestion and tried deployment of my applet using
>"Java WebStart" and succeed.


Great, but..

>...But my applet is still not able to
>capture the client machine device.


I don't think it ever will. The problem is the JMF
setting that says 'no applet capture' (or whatever).
A JWS <installer> might be able to change that
setting to 'heck yeah, allow applets to do everything'.
But that seems not to be quite fitting the basic need
to do all this 'in a web page'.

>can you suggest me next approach to resolve the problem.


I'm sorry, but I do not believe that the 'ease' that
you are after can be achieved by an applet capturing
through a *web* *page* using standard JMF.

If you went into the JMF source code and changed it,
it might be possible to rebuild the JMF so that simply
any 'signed and trusted' applet could do as it needs,
but I am sure it would require change to the JMF code
itself.

>can you give me your email id so that i can send you my web
>application folder containing all .jnlp and .jar files.


No. Or at least, not unless it is as consultancy,
I do not provide private help for free. If your are
interested in consultancy, yell and I'll be there.

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.asp...neral/200708/1

 
Reply With Quote
 
Amit Jain
Guest
Posts: n/a
 
      08-10-2007
Thanks for replying,
Really i can't understand what to do now. I found many peoples facing
same problem and with no solution. I also look at sun forums and found
many thread with same query with no answer. Really something is wrong
with JMF and sun.
JMF is dead... [ ]

Thanks

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-10-2007
Amit Jain wrote:
...
>JMF is dead... [ ]


Yeah, it is dead. There has been no development in the
JMF API itself for a *long* time, and Sun is looking to
hook into the native player for Java 7, so their interest in
JMF will be 'slightly less than zero'.

Did that point not come up during the thread?

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

 
Reply With Quote
 
Amit Jain
Guest
Posts: n/a
 
      08-10-2007
So, It means there no way to get answer for query.
" JMF Applet without client side Installation ".

It's too bad for me and persons who having same query.

Thanks

 
Reply With Quote
 
Yogesh Tiwari
Guest
Posts: n/a
 
      08-10-2007
Hi,
i watch this thread regularly and hoping that you people will found
the solution but...


Yogesh Tiwari



 
Reply With Quote
 
Amit Jain
Guest
Posts: n/a
 
      08-18-2007
Hi,
when i execute below program, i didn't got any runtime exception and
my program goal is to capture device and send voice data using RTP but
when i check using ethereal i couldn't found any RTP packet.

please give me some guide line...

/*
* JWSApplet.java
*
* Created on August 8, 2007, 1:02 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

/**
*
* @author Client1 Computer Amit Jain
*/
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 javax.media.rtp.*;
import javax.media.rtp.rtcp.*;
import javax.media.rtp.event.*;
import com.sun.media.rtp.*;
import com.sun.media.ui.*;

import java.io.*;
import java.util.*;
import java.awt.*;
import java.net.InetAddress;
import java.applet.*;

public class JWSApplet extends Applet{

/** Initialization method that will be called after the applet is
loaded
* into the browser.
*/
public void init() {
doSendProcessor();
}

private void doSendProcessor(){
CaptureDeviceInfo di = null;
Processor processor = null;
di = getDeviceInfo();

// create a processor for this capturedevice and exit if we
cann't create it
try{
processor =
Manager.createProcessor(di.getLocator());
}catch(IOException ioEX){
ioEX.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}

//configure the processor
processor.configure();
while(processor.getState()!=processor.Configured){
//System.out.println(processor.getState()+" state
"+processor.Configured);
}

processor.setContentDescriptor(new
ContentDescriptor(ContentDescriptor.RAW));
TrackControl track[] = processor.getTrackControls();
//value of encodingOK determine we can send GSM data or not
//if value of encodingOK is true means we can send GSM data
boolean encodingOK = false;
//go through the tracks and try to program one of them to
//output GSM Data
for(int i=0;i<track.length;i++){
//System.out.println("track:-> "+track[i]);
if(!encodingOK && track[i] instanceof FormatControl){
boolean abc = track[i] instanceof FormatControl;
//System.out.println("track[i] instanceof
FormatControl:-> "+abc);

if((track[i]).setFormat(new
AudioFormat(AudioFormat.GSM_RTP,8000,8,1))==null){
track[i].setEnabled(false);
}else{
encodingOK = true;
}
}else{
track[i].setEnabled(false);
}
}

//System.out.println("encodingOK:-> "+encodingOK);

//realize the processor
if(encodingOK){
processor.realize();
while(processor.getState()!=Processor.Realized){
//System.out.println(processor.getState()+" real
"+processor.Configured);
}
}

// get the output datasource of the processor and exit if we
fail
DataSource ds = null;
try{
ds = processor.getDataOutput();
}catch(NotRealizedError e){
e.printStackTrace();
}

// use datasource fot creating an RTP datasink
//our RTP datasink will multicast the audio.
/*
try{
String url = "rtp://192.168.1.7:5000/audio/1";
MediaLocator m = new MediaLocator(url);
DataSink d = Manager.createDataSink(ds,m);

d.open();

d.start();

processor.start();

}catch(Exception e){
System.out.println("");
e.printStackTrace();
}
*/


//create a SessionManager and hand over the
//datasource for SendStream creation

try{
SessionManager rtpsm = new RTPSessionMgr();

SessionAddress localaddr = new SessionAddress();
InetAddress destaddr =
InetAddress.getByName("192.168.1.2");
SessionAddress sessaddr = new SessionAddress(destaddr,
5000,destaddr,5000+1);
//ask RTPSM to generetion the local participant CName
String cname = rtpsm.generateCNAME();
SourceDescription[] userdesclist = new SourceDescription[]
{new
SourceDescription(SourceDescription.SOURCE_DESC_EM AIL,"(E-Mail Removed)",
1,false) ,new
SourceDescription(SourceDescription.SOURCE_DESC_CN AME,cname,
1,false),new SourceDescription(SourceDescription.SOURCE_DESC_TO OL,"JMF
RTP Player v2.0",1,false)};

// the session manager then needs to be initialized and
started:
rtpsm.initSession(localaddr,userdesclist,0.05,0.25 );
rtpsm.startSession(sessaddr,1,null);
SendStream sendStream = rtpsm.createSendStream(ds, 0);
sendStream.start();
}catch(IOException io){
//System.out.println("");
io.printStackTrace();
}catch(UnsupportedFormatException e){
//System.out.println("");
e.printStackTrace();
}catch(Exception e){
//System.out.println("");
e.printStackTrace();
}
}

private CaptureDeviceInfo getDeviceInfo(){
CaptureDeviceInfo di = null;
AudioFormat a = new AudioFormat (AudioFormat.LINEAR, 8000, 16,
1);
Vector deviceList = CaptureDeviceManager.getDeviceList(a);

if(deviceList!=null){
if(deviceList.size()>0)
di = (CaptureDeviceInfo) deviceList.elementAt(0);
else
System.out.println("no device is captured");
}else{
//g.drawString("Vector not Initialized",50,25);
System.out.println("Vector not Initialized");
}
return di;
}
}

Thanks...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running signed applet without creating policy file in client side abcd Software 0 02-17-2009 06:37 AM
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
API Jmf:Transcoding to different formats (Solution SUN jmf: "Transcode.java ) Misterysword@hotmail.com Java 0 08-13-2007 11:40 AM
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
A bug of JMF(when JMF is playing video, InterruptedException occurs after the "refresh" button of IE is clicked)? taowang.gml@gmail.com Java 1 07-19-2006 11:21 PM



Advertisments