Playing Audio with Javascript
OK - I am sort of piggybacking off of this thread
Selecting and playing audio with javascript
In my case, I only have a single audio file that I would like to play on the click of a button.
Now... I know I can do this easily with an on success action and it works perfectly.
I also know that I can play the audio with an advanced action and it works fine.
But... I can do several other simple actions on a button with a single line of javascript.
cp.show
cp.hide
cp.disable
cp.enable
cp.changeState
window.parent.cpAPIInterface.gotoSlide
var=(++var)
var=(--var)
just to name a few...
I prefer to use these whenever I can because it is much faster to type or copy/paste longer strings of stuff than doing all the clicks in the GUI
So to my question...
Is there a short and sweet thing for playing an audio file you have in the library as well?
You know - something like
cp.play("sound.mp3");
cp.playAudio("sound.mp3");
window.parent.cpAPIInterface.play("sound.mp3");
I have tried many other combinations of things similar to the above as well with no luck. The thread referenced above was the only thing that really touched it that I came across. I have also tried these with the audio loaded to the slide as a background to see if it would play again
Something that can run under Execute Javascript vs HTML Animation?
What am I missing? I am clearly not hitting the right syntax. Or is there really that much more going on behind the 'On Success - Play Audio'?
