Quantcast
Channel: Adobe Community : Popular Discussions - PDF Language and Specifications
Viewing all articles
Browse latest Browse all 46145

Javascript doesn't play() embedded sound

$
0
0
This is a question about the PDF specification regarding how to use the javascript API
to play a sound object.
Specifically, why in my basic example is the javascript able to see the sound,
but can't play() it?

I have a test PDF illustrating my problem at
http://www.affexion.net/test/PDF/test-scriptsound.pdf

This is a stripped down example.
The sound is referenced from a simple annotation
on the left. Double-clicking it plays the sound as expected.

On the right is a button which when activated is supposed to
execute a javascript.
<< /S /JavaScript /JS ( console.show(); try {this.sounds[0].play(); } catch(e) { console.println(e.toString()); } console.println(this.sounds[0].name); ) >>

I see the console open up, and I see it print the name of the sound "mySound",
but I don't get the sound played.

Do I need to do something in my javascript before I call this.sounds[0].play?
Is there some other mistake in the way I have the sound object embedded and referenced?

Thanks very much for any help.

Viewing all articles
Browse latest Browse all 46145

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>