Tom Wang

Greenhorn
+ Follow
since Apr 01, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tom Wang

OS: Win XP PRO
Java: jdk/jre 1.6.0, JMF 2.1.1e
Web Browser: IE 6.0 and Firefox 1.5.0.9

source code: Java Media Framework (JMF) 2.1 - Sample Code.
http://java.sun.com/products/java-media/jmf/2.1.1/samples/samples/SimplePlayerApplet.java

html file (Note: you may change java_sound.wav to other audio/video files):
<html>
<applet code=SimplePlayerApplet width=320 height=300>
<param name=file value="java_sound.wav">
</applet>
</html>

Problem description
This applet runs well in IE or Firefox. However, when I click the Refresh button rapidly (as fast as I can), the Java Console

prints out the following message in most cases:
java.lang.NullPointerException
at sun.plugin.AppletViewer.loadJarFiles(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

From time to time, it prints out
java.lang.NullPointerException
at sun.plugin.AppletViewer.loadJarFiles(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at sun.plugin.viewer.WNetscapePluginObject$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

This problem is quite weird to me bacause SimplePlayerApplet.java is Sample Code of JMF.
Any ideas about how to fix that?
Thanks in advance!

Tom
17 years ago
Description: Sometimes the control panel strip of MediaPlayer is blank when content is playing. All the buttons on the panel are then invisible.

OS: Microsoft Windows XP [Version 5.1.2600]

Java: java version "1.5.0_06", Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05), Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed

mode, sharing)

JMF: jmf-2_1_1e-windows

Web browser: IE 6.0.2900.2180.xpsp_sp2_gdr.050301-1519 or Firefox 1.0.7

Source code: MediaPlayerSample.java under the "JMF_samples" directory

Reproduce:
1. Run MediaPlayerSample.java as an Applet with any .wav audio file or .avi video file
2. Click the "refresh" button of your browser (I use IE or Firefox) until the control panel strip turns to blank.
In general, it appears within 20 clicks of "refresh" button.
Related bugs: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4235319
Bug ID: 4235319
Synopsis ControlPanel is not compatible with Swing

The URL is http://www.cs.ualberta.ca/~taowang/test_jmf/MediaPlayerSample.html
The Java code is available at http://www.cs.ualberta.ca/~taowang/test_jmf/MediaPlayerSample.java
The VIDEO file is at http://www.cs.ualberta.ca/~taowang/test_jmf/1.avi
The AUDIO file is at http://www.cs.ualberta.ca/~taowang/test_jmf/1.wav

Does anyone know how to correct it?
Thanks in advance!

T.W.
17 years ago
To correct this problem, I changed the deallocate() to close() in method destroy()
17 years ago
A bug of JMF(when JMF is playing video, InterruptedException occurs after the "refresh" button of IE is clicked)?

problem description:
1. I modified the MediaPlayerSample.java of JMF_samples, to see how does it work. However, when JMF is playing video, InterruptedException occurs after the

"refresh" button of IE is clicked:
MediaNode event thread java.lang.InterruptedException
Timer: timeLoop() wait interrupted java.lang.InterruptedException
Timer: timeLoop() wait interrupted java.lang.InterruptedException
Timer: timeLoop() wait interrupted java.lang.InterruptedException
Timer: timeLoop() wait interrupted java.lang.InterruptedException
MediaNode event thread java.lang.InterruptedException
java.lang.ThreadDeath
at java.lang.Thread.stop(Unknown Source)
at java.lang.ThreadGroup.stopOrSuspend(Unknown Source)
at java.lang.ThreadGroup.stop(Unknown Source)
at sun.awt.AppContext.dispose(Unknown Source)
at sun.applet.AppletClassLoader.release(Unknown Source)
at sun.plugin.security.PluginClassLoader.release(Unknown Source)
at sun.applet.AppletPanel.release(Unknown Source)
at sun.applet.AppletPanel.sendEvent(Unknown Source)
at sun.plugin.AppletViewer.onPrivateClose(Unknown Source)
at sun.plugin.AppletViewer$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2. I tried Firefox but this exception didn't appear.
I searched in google but found nothing about this problem.

My questions are:
1. Is it a bug of JMF or IE?
2. If it is a bug of JMF, how to correct it?

Thanks in advance!

The URL is http://www.cs.ualberta.ca/~taowang/test_jmf/MediaPlayerSample.html
The Java code is available at http://www.cs.ualberta.ca/~taowang/test_jmf/MediaPlayerSample.java
The AVI file is at http://www.cs.ualberta.ca/~taowang/test_jmf/1.avi
17 years ago
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.
17 years ago
Thank you, Simon.
I will surely try it.

Best wishes,
Tom Wang
17 years ago
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
17 years ago
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
17 years ago