|
-
December 7th, 2007, 04:26 AM
#2
Re: Guide to play sound in web page
In the above code, its not a good thing to do to load PLAYSOUND.HTM (function htmlSound) everytime a sound needs to be played. You can replace the htmlSound function with a public constant named htmlSound with the file's content as a continued string, without the Chr(13) and Chr(10), just one line. Be carefull with the " characters, it needs to be doubled in vb.net's environment.
If you do that, then the following line must be replace in sub PlaySound as following:
Code:
obj.Text = htmlSound.Replace("$MEDIA_URL$",URLThatKeepsMyMediaFiles & MediaFile)
and also no need for the file playsound.htm to exist in your app's root folder.
There is a demo of this technique in a game with questions i made :
http://www.deltatv.gr/games/questions.aspx
A sound is played when ever a user selects an answer (correct or wrong).
Ok its greeks, sorry for that
p/s
if you are going to replace the lblSound object with a Anthem label control and not a asp one, be sure to set the AutoUpdateAfterCallback property to TRUE.
Last edited by dtv; December 7th, 2007 at 05:19 AM.
- Better live in the digital world -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|