Java Reference
In-Depth Information
Chapter 9
Using the Media Classes
We keep moving forward, opening new doors, and doing new things, because we're curious and
curiosity keeps leading us down new paths.
—Walt Disney
In the previous chapters you have learned how to create applications using the JavaFX library. Now we make good use
of that knowledge while creating applications that explore the audio and video capabilities of the JavaFX platform.
The Foundation
Since JavaFX 2.0, the media classes in JavaFX are based on an open source multimedia framework named GStreamer. 1
This is a big change from the media library in the early versions of JavaFX, where the native media capabilities of the
various supported platforms were used directly. In comparison, the GStreamer-based library provides better stability
and more consistency across platforms. The latter should be seen in the light of the “Write Once, Run Anywhere”
paradigm of Java. In JavaFX 1, there were large differences between JavaFX Media applications on different platforms.
Today, the consistency has the drawback that in some cases, fewer features are provided, but the different platforms
provide the same functionality.
Supported Media Formats
Table 9-1 shows the file formats that are supported by the JavaFX media classes. Four audio formats and three video
formats are supported. The four audio formats supported in JavaFX (MP3, WAV, AIFF, and AAC) are very common and
are all well supported by most audio tools on the market. You should have no trouble obtaining your source audio files
in, or converting them to, one of the formats supported by JavaFX.
http://gstreamer.freedesktop.org/
1
 
Search WWH ::




Custom Search