8
Working with Digital Media in PDF Documents
Integrating Media into Documents
Adding Sound Clips
The procedure for adding a sound clip is similar to that for movie clips. Specify the MIME
type and the sound data to be played. In the example below, a sound clip is loaded from a
URL and played in a floating window:
var myURLClip = "http://myWebSite.com/mySoundClip.mp3";
var args = {
URL: myURLClip,
mimeType: "audio/mp3",
doc: this,
settings: {
players: app.media.getPlayers("audio/mp3"),
windowType: app.media.windowType.floating,
data: app.media.getURLData(myURLClip, "audio/mp3"),
floating: {height: 400, width: 600}
},
};
app.media.openPlayer(args);
Adding and Editing Renditions
A
rendition
object contains information needed to play a media clip, including
embedded media data (or a URL), and playback settings, and corresponds to the
Rendition
in the Acrobat user interface. When you add a movie or sound clip to your document, a
default rendition is listed in the
Multimedia Properties
dialog box and is assigned to a
Mouse Up
action. In case the rendition cannot be played, you may add other renditions or
edit the existing ones.
If you add alternate versions of the media clip, these become new renditions that can serve
as alternates in case the default choice cannot be played. It is then possible to invoke the
rendition
object’s
select
method to obtain the available media players for each
rendition.
There are several types of settings that can be specified for a given rendition: media
settings, playback settings, playback location, system requirements, and playback
requirements. You can use Acrobat JavaScript to customize some of these settings through
the
rendition
object. There are several properties to which you have read-only access
when editing a rendition. These are listed below in
Table 8.5.
152
Acrobat JavaScript Scripting Guide