|
| |
|
|
womynaloud
Posts: 142 Joined: 1/17/2002 From: Ponca City Oklahoma USA Status: offline
|
audio file to play once - 12/30/2004 9:52:34
Hey guys, I hate background audio as much as anyone, but I've got a client who wants a short (like 5 or 6 sec) clip to play when you go to their site. That I can do, but there has to be a way to get it to only play one time when you 1st go to their home page, and then not play again. Kind of like the pop up code Thomas has in tutorials, where it sets a cookie and you can specify how many days until the pop up happens again, but I have no idea how to do that with an audio file. Thanks for the help, Gayle
_____________________________
The box said "requires windows 98 or better" so I installed Linux!
|
|
|
|
Giomanach
Posts: 6136 Joined: 11/19/2003 From: England Status: offline
|
RE: audio file to play once - 12/30/2004 10:13:22
Hi Gayle What's the coding your using the play the sound? <bgsound src="file.mid" loop="false"> <embed src="file.mid" hidden="true" autostart="true" loop="false"></embed> Dan
_____________________________
|
|
|
|
dpf
Posts: 7126 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: audio file to play once - 12/30/2004 10:39:32
if you only want it to open the first time you open the page and not when you return, I dont think Dan's code will do that. Dan's code will stop it fron looping and only play one time but it will play each time you open the page. I think your solution would be a cookie and javascript. at least that would be ione solution
_____________________________
Dan
|
|
|
|
womynaloud
Posts: 142 Joined: 1/17/2002 From: Ponca City Oklahoma USA Status: offline
|
RE: audio file to play once - 12/30/2004 10:43:38
That's what I figured, dan. I'm just not sure how to write the script. So far, I've been able to convince clients that bdgrnd music is a bad thing, but this is a furniture store website, and he wants his jingle to play when you go to the page. I'm just hoping I can convince him that playing it once a day (using a cookie) is enough.
_____________________________
The box said "requires windows 98 or better" so I installed Linux!
|
|
|
|
dpf
Posts: 7126 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: audio file to play once - 12/30/2004 11:20:15
basically, what you would do is not have the code embedded in html.. instead, your js would check to see if there is a cookie present, if there is- it releases to the html page which has no sound embedded. if no cookie is present, the js does 2 things: 1. write a cookie 2. use document.write to write the html to add the sound file and play it only once as dans code shows
_____________________________
Dan
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|