image mastering api v2 download
Name: image mastering api v2 download
Category: Free
Published: draglothethoug1976
Language: English
21.6 Playing V >A simple video can concisely and effectively convey a great deal of information. Recognizing the value of bringing extensible multimedia capabilities to Java, Sun Microsystems, Intel and Silicon Graphics worked together to produce the multimedia API Java Media Framework (JMF), discussed briefly in Section 21.1. Using the JMF API, programmers can create Java applications that play, edit, stream and capture many popular media types. While the features of JMF are quite extensive, this section briefly introduces some popular media formats and demonstrates playing video using the JMF API.
IBM and Sun developed the latest JMF specificationversion 2.0. Sun also prov >Microsoft Audio/Video Interleave ( .avi ), Macromedia Flash 2 movies ( .swf ), Future Splash ( .spl ), MPEG Layer 3 Audio ( .mp3 ), Musical Instrument Digital Interface (M >.mid or .rmi extensions), MPEG-1 videos ( .mpeg , .mpg ), QuickTime ( .mov ), Sun Audio file format ( .au extension), and Macintosh AIFF file format ( .aif or .aiff extension). You have already seen some of these files types.
Currently, JMF is available as an extension separate from the Java 2 Software Development Kit. The most recent JMF implementation (2.1.1e) can be downloaded from:
You need to accept the license agreement prior to downloading.
The JMF Web site provides versions of the JMF that take advantage of the performance features of certain platforms. For example, the JMF Windows Performance Pack provides extensive media and device support for Java programs running on Microsoft Windows platforms (Windows 95/98/NT 4.0/2000/XP). JMF's official Web site ( java.sun.com/products/java-media/jmf ) provides continually updated support, information and resources for JMF programmers.
Once the file finishes downloading, open it and follow the on-screen instructions to install the program. Leave all options at their defaults. You may need to restart your computer to finish the installation.
Creating a Simple Media Player.
The JMF offers several mechanisms for playing media. The simplest mechanism is using objects that implement interface Player declared in package javax.media . Package javax.media and its subpackages contain the >URL object that refers to it. Then pass the URL as an argument to static method createRealizedPlayer of >Manager to obtain a Player for the media clip. > Manager declares utility methods for accessing system resources to play and to manipulate media. Figure 21.6 declares a JPanel that demonstrates some of these methods.
The constructor (lines 1551) sets up the JPanel to play the media file specified as a URL parameter to the constructor. MediaPanel uses a BorderLayout (line 17). Line 20 invokes static method setHint to set the flag Manager.LIGHTWEIGHT_RENDER to true . This instructs the Manager to use a lightweight renderer that is compatible with lightweight Swing components, as opposed to the default heavyweight renderer. Ins >try block (lines 2238), line 25 invokes static method createRealizedPlayer of >Manager to create and realize a Player that plays the media file. When a Player realizes, it >createRealizedPlayer throws three checked exceptions, NoPlayerException , CannotRealizeException and IOException . A NoPlayerException indicates that the system could not find a player that can play the file format. A CannotRealizeException indicates that the system could not properly >IOException indicates that there was an error while reading the file. These exceptions are handled in the catch block in lines 3950.
Line 28 invokes method getVisualComponent of Player to get a Component that displays the visual (generally v >getControlPanelComponent of Player to get a Component that prov >video and control , respectively. The if statements in lines 3132 and lines 3435 add the video and the controls if they exist. The video Component is added to the CENTER region (line 32), so it fills any available space on the JPanel . The controls Component , which is added to the SOUTH region, typically provides the following controls:
A positioning sl >Line 37 calls Player method start to begin playing the media file. Lines 3950 handle the various exceptions that createRealizedPlayer throws.
http://www.onfeetnation.com/profiles/blogs/fringe-season-3-soundtra...