8
Working with Digital Media in PDF Documents
Media Players: Control, Settings, Renditions, and Events
The next example illustrates how to play back the alternate text of a rendition in a floating
window:
// set up the alternate text
var rendition = this.media.getRendition("myClip");
var settings = rendition.getPlaySettings();
var args = {
settings: settings,
showAltText: true,
showEmptyAltText: true
};
var selection = rendition.select();
settings = app.media.getAltTextSettings(args, selection);
settings.data = "A.C. Robat");
// set up the floating window
settings.windowType = app.media.windowType.floating;
settings.floating = {
canResize: app.media.canResize.keepRatio,
hasClose: true,
width: 400,
height: 100
};
// play the alternate text in the floating window
args = {
rendition: rendition,
annot: this.media.getAnnot({
nPage: 0,
cAnnotTitle: "myScreen"
}),
settings: settings
};
app.media.openPlayer(args);
148
Acrobat JavaScript Scripting Guide