View Single Post
Old 01-16-2013, 01:03 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,103
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by tpeck View Post
This is a bit odd. The sound will play and then go to the video (which is what I want) but only if I include the alert!

Code:
soundManager.play('scratch','../../media/mp3/scratch.mp3');
alert("why do you need me?");
document.writeln("<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\"480\" height=\"336\">");
document.writeln("<param name=\"src\" value=\"file:///"+driveletter+":/MEDIA/VIDEO/Lesson27.mov\">");
document.writeln("<embed width=\"480\" height=\"336\" type=\"video/quicktime\" pluginspage=\"http://www.apple.com/quicktime/download/\" src=\"file:///"+driveletter+":/MEDIA/VIDEO/Lesson27.mov\" controller=\"true\" autoplay=\"true\" scale=\"aspect\"></embed>");
document.writeln("<param name=\"controller\" value=\"true\">");
document.writeln("<param name=\"autostart\" value=\"true\">");
document.writeln("<param name=\"scale\" value=\"aspect\">");
document.writeln("</object>");
}}
If I take out the alert, the sound gets bypassed.

How can I get rid of the alert and have the sound play then go to the video?

Something about giving the sound enough time to play?
Try wrapping the code for the video in a function with setTimeout with a couple of seconds delay.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote