Let's talk about exceptions ...
How do you handle exceptions? Do you think upfront about the type of exceptions that you want to catch or do you just let the outside world handle it?

-- Jeroen van Bergen in JW Blogs

Newsletter sign-up

Sign up for our technology specific newsletters.

Enterprise Java
View all newsletters

Email Address:

Java Media Framework Player API

Multimedia playback comes to Java! Learn how to start using audio and video in your applets and applications

What is the Java Media Framework?

The JMF is a set of three new APIs being co-defined by the JMF Working Group members -- Sun, Silicon Graphics, and Intel. These APIs eventually will include Java Media Player, Capture, and Conferencing. The first to be delivered, the Player API provides a framework for implementors to build media players and provide them in a standard way on all Java platforms. The JMF specification is flexible enough to allow developers to extend players by adding their own nodes (such as images filters, audio reverb effects, and so on) or to use the standard players without making any additions.

Before the JMF Player API, multimedia playback support in Java was extremely limited. Programmers had to generate their own GUI controls. (JMF returns a standard set of controls in the form of a ControlPanel and other Control objects.) The supported media types in the core Java API were limited (Sun's muLaw format for sound, and no media option for video), so developers were forced to implement their own players without any underlying framework to assist them.

With the JMF Player API, however, Java programmers can implement support for almost any audio or video format by building upon an established media playback framework. In addition, standard implementations (see Resources for URLs pointing to more information on implementations from Intel, Silicon Graphics, and Sun) provide built-in support for common Web formats such as muLaw, Apple AIFF, and Microsoft PC WAV for audio, as well as Apple QuickTime video, Microsoft AVI video, and Motion Picture Expert Group's MPEG-1 and MPEG-2 for video. MIDI currently is supported in the Silicon Graphics IRIX implementation and is slated for support in Intel's Windows implementation. If you want to use one of these standard Web-based formats, you are now able to easily integrate multimedia playback into applets and applications alike with only a few lines of code.

JMF allows player implementors to use native methods as need be underneath the covers for greater speed. This lets the implementors optimize performance on each platform. At the same time, the common Java Media Player API ensures that applets and standalone applications will run on any Java platform.

Installing JMF software

Installation of the JMF software is straightforward. You need only download a package containing the classes, documentation, and accompanying files for your platform and install it using the standard method.

Implementations currently are available from Silicon Graphics and Intel for IRIX and Windows 95/NT, respectively. Sun currently is working on a Solaris implementation. Note that you can use JMF with Sun's Java Development Kit (JDK) or with a browser. Implementations that work for Netscape Navigator 3.01 are available on all platforms, and Intel's Windows 95/NT implementation also supports Microsoft Internet Explorer 3.01.

To interact with the JMF applets embedded in this article, you must have the JMF Player implementation for your platform. See Resources for URLs at which you can download and install JMF.

Resources
  • JavaSoft's API Overview provides information on current and upcoming Java APIs. Schedule information and links to documentation and implementations are available
    http://java.sun.com/products/apiOverview.html
  • The Java Media Player Specification site provides links for the viewing and downloading of the JMF Player specification and API. Information also is provided on how to submit reviewer comments
    http://java.sun.com/products/java-media/jmf
  • Java Media Player Guide, also available from the Java Media Player Specification site in PDF and PS formats, provides a good introduction to the implementation and use of JMF players. Example code is provided
    http://java.sun.com/products/java-media/jmf
  • Java Media Player API Documentation, available in PDF and PS formats from the Java Media Player Specification site as well, gives the complete javadoc generated documentation for the JMF Player API. All classes and methods supported in the API are outlined here with comments on their structure and use
    http://java.sun.com/products/java-media/jmf