Skip to main content

How to embed a "multimedia player" into java GUI?

5 replies [Last post]
bigwood
Offline
Joined: 2006-04-01
Points: 0

How to embed a "multimedia player" into java GUI?

Environment: WIN XP, jdk1.5.0, Flash 8, ...
I need to embed a "multimedia player" into java GUI. It shall be able to:
1) Call other programs or java class to play multimedia contents (i.e, 1. play .avi video 2. play .swf Flash 3. play .wav audio 4 display .jpg & .gif image 5. run .exe file

(by OpenGL) to display 3D graphics 6. run java class (by java 3D) file to display 3D graphics)
2) The contents must be displayed in a java GUI container (i.e, JPanel or any other container)
I searched the Internet and noticed I might use Runtime.getRuntime().exec(), http://java.sun.com/developer/JDCTechTips/2003/tt0304.html
This approach can surely satisfy requirement 1), but I am thinking that the requirement 2) is very hard to satisfy.
For instance, I can call Windows Media Player to play an .avi video, or call Flash Player to play an .swf file.
However, how can I embed the Windows Media Player or Flash Player into any java GUI container?
Windows will pop out an new window and I can not embed the new window into a Java GUI container!
Shall I use JMF (I know nothing about JMF)?

Any advice or suggestion will be highly appreciated.
Thanks in advance.
TW

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bigwood
Offline
Joined: 2006-04-01
Points: 0

Thank you.
I've tried JMF.
It works, however, it only supports very limited audio and video formats.
I tested the applet with some .wav audio files and some .avi video files. For the .wav audio files, it workds well. However, for some .avi video files, it can only play the video without sound. It's really weird.

littlejohn
Offline
Joined: 2006-06-06
Points: 0

You may take a look at:

http://jvlc.ihack.it

and try jvlc. It contains a video widgets for AWT/Swing/SWT frameworks.

Cheers,
fc

bigwood
Offline
Joined: 2006-04-01
Points: 0

nokissme and trembovetski , thank you very much for your information!
I will follow you suggestions and try to figure it out.

trembovetski
Offline
Joined: 2003-12-31
Points: 0

You'll need to use the JAWT interface.

Here's some info:
http://java.sun.com/j2se/1.3/docs/guide/awt/AWT_Native_Interface.html
http://www.javaworld.com/javaworld/javatips/jw-javatip86.html

http://developer.apple.com/samplecode/JAWTExample/JAWTExample.html

You might want to take a look at how JOGL is implemented - take a look at https://jogl.dev.java.net/ .

Thanks,
Dmitri

nokissme
Offline
Joined: 2006-04-02
Points: 0

Here is my advise. you can still use a java GUI container, in the container you can place a WEB page control in it. Then you can specify your program to call different web page to open different types of file.