aspose file tools*
The moose likes JSP and the fly likes Unable to play media inside my JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Unable to play media inside my JSP" Watch "Unable to play media inside my JSP" New topic
Author

Unable to play media inside my JSP

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hi all.
I have the following applet:
this applet is from sdk's demo..

where applets, is a folder under the application context
the problem is, the applet doesn't work ...
(note : opera 7.1 has JRE 1.4.1 and all sdk's examples are work well using opera)
also I have the following problem :

also, it doesn't work !
any help or ideas ?
[ May 20, 2004: Message edited by: Nathan Pruett ]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

It would help quite a lot if you went into more detail about exactly what "it doesn't work" means - do you get any exceptions/errors, what is in the HTML output of the page, etc.

Some preliminary ideas on the problem, though -
1.) The codebase value for the APPLET tag (and thus, the jsp:plugin tag) should be a relative URI to the directory holding the class files, not a full URL - so the value should be "/applets" (if the page your tag is in is located in the directory above it. Creative use of "../" is needed to navigate to the directory correctly if you are located elsewhere.)
2.) The EMBED tag syntax depends on the plugin being used - what plugin are you using for MP3 files?
[ May 19, 2004: Message edited by: Nathan Pruett ]

-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

I mean, nothing displayed (java console shows that its loads nothing)
I have tested, /applet , applet and nothing work..
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

OK, here's the results I got... I made up a test applet, also called Clock, and put it in the applets subdirectory of my web app. All it does is display the version of the JVM it is running under and any params that are passed to it. When I used your original code (plus fixing the codebase problem as mentioned in my previous post) I got an "uninstalled plugin" icon (puzzle piece in Firebird, red X in IE), and a popup asking me to install the 1.4.0 Java Plugin. I have the 1.5.0 plugin installed, and I didn't want to uninstall it, so I removed the jreversion option from the jsp :p lugin tag. This time it wanted me to install the 1.2.2 Java Plugin! (Which is really weird, because I thought the default was 1.1?) So I replaced the jsp:plugin tag with a regular old HTML APPLET tag -



This time the applet loaded, and it printed out that I was using the "1.5.0-beta" version of the Java Plugin. I went back and changed the jreversion in your original code to the specific Java plugin version I have installed.



This time the applet showed up again. It's really a pain that the jreversion attribute's default is 1.2.2 and that you are required to install the specific version of the Java Plugin that is asked for. (On a related note, does anyone know if there is a good way of getting around the problem of installing a specific version of the plugin? i.e. of saying jreversion="1.4.0+" and have it recognize 1.5.0 is OK? )
[ May 20, 2004: Message edited by: Nathan Pruett ]
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
I use this:


This works on both IE and Mozilla as long as you have a 1.4 or better plugin installed (though to be honest, I haven't tried it with 1.5) and you have your browser configured to use the plugin.

I'm not positive if all of those are needed or not but it works for me so I left it. Give it a try - I'm curious to see if it does indeed work for 1.5.

Brian


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Thanks Brian, it's working under the 1.5.0-beta plugin for me, so I guess the HTML APPLET tag is smart enough to know that I don't need to 'upgrade' to 1.4.0. I guess you could also put a link to the plugin inside the applet tag that gets displayed if they can't run the applet.

Since you mentioned 'as long as you have a 1.4 or better plugin installed' what happens if the user doesn't have a 1.4+ plugin installed? Does the applet attempt to run under the existing plugin anyway, or does the applet not even start?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to play media inside my JSP