Working with Digital Media in PDF Documents
Setting Multimedia Preferences
8
T
ABLE
8.5
Rendition Object Properties
Property
Description
The alternate text string for the rendition
The document that contains the rendition
Returns the filename or URL of an external media clip
A
MediaRendition
object or a rendition list
The name of the rendition
altText
doc
fileName
type
uiName
In addition to these properties, you may invoke the
rendition
object’s
getPlaySettings
method, which returns a
MediaSettings
object. As you learned
earlier in
Specifying Playback Settings,
you can adjust the settings through this object. You
may also invoke its
testCriteria
method, with which you can test the rendition against
any criteria specified in the PDF file, such as minimum bandwidth.
Setting Multimedia Preferences
In general, you may choose which media player should be used to play a given clip,
determine whether the Player Finder dialog box is displayed, and set accessibility options
for impaired users (these include subtitles, dubbed audio, or supplemental text captions).
In addition, you may use Acrobat JavaScript to access or customize multimedia preferences.
For example, the
doc.media
object’s
canPlay
property may be used to indicate
whether multimedia playback is allowed for the document. The
MediaSettings
object’s
bgColor
property can be used to specify the background color for the media player
window. Examples of each are given below:
var canPlay = doc.media.canPlay;
if (canPlay.no) {
// determine whether security settings prohibit playback:
if (canPlay.no.security) {
if (canPlay.canShowUI)
app.alert("Security prohibits playback.");
else
console.println("Security prohibits playback.");
}
}
// Set the background color to red:
settings.bgColor = ["RGB", 1, 0, 0];
Acrobat JavaScript Scripting Guide
153