Navigation: Including movies > Using the JMF |
![]() ![]() ![]() |
HM2JHelp includes a simple helper class that extends the com.sun.java.help.impl.JHSecondaryViewer. The class can be used to play certain time-based media using the Java Media Framework API(JMF). Note that the codecs that the JMF can play are limited –see JMF 2.1.1 Supported formats.
To use this feature you must first must download the JMF library.
You then need to modify the object.properties file to tell the objects to use the new viewer. The file provided with the installation includes example entries for use with the JMF.
Enter a line in the objects.properties file for the classID of the object you want to call the JMF. The value of the line must begin with the __SECONDARY_VIEWER__ tag. Any text after the tag is used to label the link in the JavaHelp.
e.g.
CLSID\:x-x-x-x-x=__SECONDARY_VIEWER__Windows Media Player\: __SOURCE__
Set the objectClassid for the popup window to use the HelpJMFViewer class. i.e.
objectClassid=java\:uk.henspace.hm2jhelp.viewers.HelpJMFViewer
Set the link style to either a button or a link. i.e.
viewerActivator=javax.help.LinkLabel
or
viewerActivator=javax.help.LinkButton
When you run HM2JHelp, if you want to be able to play the movies when the helpset is launched, you need to tell the program where your JMF files are. To do this, open the StartWithJMF.bat batch file in a text editor and change the JMFHOME variable to point to the location of your JMF installation. E.g.
set JMFHOME=C:\MyPath\JMF-2.1.1e
You can now launch the program by running StartWithJMF.bat.
When your JavaHelp is built, an object calling the new viewer will be created and, assuming the codec is understood, clicking on the link will result in a popup window containing the movie appearing. If your JavaHelp displays ?? instead of the link, this means that the JMF files cannot be found in the Java classpath. If you are trying to view the movie after building in HM2JHelp, this probably means that you did not use the StartWithJMF.bat to start the program or have not correctly installed the JMF.