Working with Digital Media in PDF Documents
Integrating Media into Documents
8
Integrating Media into Documents
You may use Acrobat JavaScript to integrate media into documents, which may be played
in either
Screen Annot
objects or floating windows. The
doc.media
object is useful for
accessing Screen Annot objects in which the media clips can be played.
Topics
Adding Movie Clips
Adding Sound Clips
Adding and Editing Renditions
Setting Multimedia Preferences
Adding Movie Clips
It is possible to embed a movie in a document or create a link to one. To add a movie clip to
a document, you must first obtain a media player capable of playing it. Do this by invoking
the
app.media
object’s
getPlayers
method, which accepts an optional parameter
specifying the MIME type. For example, the code below shows how to obtain a player that
can play a movie:
// create the media player object
var player = app.media.createPlayer();
// filter for those that can play a movie (specify MIME type)
player.settings.players = app.media.getPlayers("video/x-mpg");
// choose which file to play
player.settings.data = "myClip.mpg";
// open the player
player.open();
Acrobat JavaScript Scripting Guide
151