...

View Full Version : Help needed



walidos22
05-21-2012, 11:22 AM
Hello!

I am currently having some troubles finishing my website.
www.djbobambo.com.

I would like the music to play on every html page but the problem is that when i change a pages the music resets and begins from the beginning. I would like it to continue so when you change from page to page the music keeps playing.
Any ideas? Thanks!

This is the code i use:



<img id="music" onclick="musicfunc()" src="images/buttons/on.png" width="195" height="20" style="float: center; padding-right: 50px; padding-top: 58px;">
<OBJECT id="MediaPlayer" width="1" height="1" style="position:absolute; left:0;top:0;" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
<PARAM name="URL" value="home.mp3">
<PARAM name="AutoStart" value="True">
<PARAM name="PlayCount" value="9999">
</OBJECT>
<script type="text/javascript">
var musicstat = "1";function musicfunc(){if(musicstat == "0"){document.getElementById ('music').src="images/buttons/on.png";musicstat = "1";document.getElementById("MediaPlayer").setAttribute("URL", "home.mp3");}else if(musicstat == "1"){document.getElementById ('music').src="images/buttons/off.png";musicstat = "0";document.getElementById("MediaPlayer").setAttribute("URL", "");}}
</script>

Philip M
05-21-2012, 01:07 PM
Hello!

I am currently having some troubles finishing my website.
www.djbobambo.com.

I would like the music to play on every html page but the problem is that when i change a pages the music resets and begins from the beginning. I would like it to continue so when you change from page to page the music keeps playing.
Any ideas? Thanks!



Not possible AFAIK. I take it that it is the same music on each HTML page?
If so you could try opening new pages as new windows (popups).

You link returns a 404 error.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

jalarie
05-21-2012, 06:20 PM
I expect lots of objections to this solution, but ... what works, works. Here goes, anyway:

You're asking for something to stay constant even though the page being viewed changes. Use frames. The frame which changes is set to 100% and the one which plays the music is set to "*" to take up the "rest" of the page.

xelawho
05-21-2012, 06:46 PM
you could try getting the current position of the song at window.onbeforeunload


var pos=document.getElementById("MediaPlayer").Controls.currentPosition

and passing that as a query string in the link to the next page and starting the song from that position



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum