Java Reference
In-Depth Information
Media—Audio and Video
In JavaFX, there is really no distinction between audio and video. They are both
considered playable media, and the same JavaFX classes are used for both types.
In line with this, there is one media class, javafx.scene.media.Media , that
points to the audio or video location. This class also provides meta-data about
the media, like duration, possible width and height resolution, and possible infor-
mation like artist, title, and so on. The amount of meta-data varies based on the
underlying media format.
There is a player, javafx.scene.media.MediaPlayer , that controls the play of
the media. Do not confuse this with the conventional view of a Media Player
application with skins and such that runs on your computer. The javafx
.scene.media.MediaPlayer is just a class that allows a program to do control
actions, like play, pause, resume play, and so on. Your job is to use these classes
and the rest of JavaFX to create your own cool Media Player application.
For video, there is a viewer class, javafx.scene.media.MediaView . This is a node
that you can place in your scene along with other nodes to actually view the video.
To support audio and video playback, JavaFX uses three underlying frameworks.
For cross-platform support, including mobile phones, JavaFX uses the On2
VideoVP6 framework from On2 Technologies. For Windows, JavaFX uses the
DirectShow framework from Microsoft; for Mac OS, JavaFX uses the Core Video
by Apple. Table 8.2 shows the audio/visual formats supported on each platform.
Ta b l e 8 . 2
Supported Media Formats
Windows
XP
Windows
Vista
MacOS
10.4+
Linux/
Solaris
Format
MPEG-3(.mp3)
X
X
X
X
Flash Video (.flv)
X
X
X
X
Adobe Film Strip .fxm (Sun defined
FLV subset)
X
X
X
X
3GPP and 3GPP2
X
Audio Video Interleave (.avi)
X
X
X
QuickTime (.mov)
X
continues
 
 
Search WWH ::




Custom Search