...

View Full Version : Best way to display uninterupted audio player across a multi-page website



jzdesigns
09-10-2011, 03:52 AM
I am creating a very content rich news/media website that requires an audio player. The audio player should be seen by the user as soon as they enter the website and the playlist should play throughout their time spent at the website and should not be restarted or stopped when navigating the website.

We originally were using a frameset for the audio player, but the fact that none of the pages through out the site could be reached through a link in the URL bar proved to be too much of an issue.

So the new idea was to open the audio player in a javascript pop-up window. But because of the nature of the website, we found that it was very common for users to go "back" in their browser to the homepage after they had navigated away, which would cause the pop-up code to be activated again and would make the pop-up reload, interrupting the audio.

So then we moved the pop-up code to the splash page so that when you enter the main page, its already open, and it can't be interrupted. But THEN we found that the pop-up window was of course opened behind the main website's window, which made it hidden and useless.

So we currently have no solutions! All we need is for this pop-up window to take focus and be the very top window, and once its opened to never be reloaded/refreshed again. Does anyone have a solution?!

Any help is appreciated! :confused:

Old Pedant
09-10-2011, 05:04 AM
cookie.



So the new idea was to open the audio player in a javascript pop-up window. But because of the nature of the website, we found that it was very common for users to go "back" in their browser to the homepage after they had navigated away, which would cause the pop-up code to be activated again and would make the pop-up reload, interrupting the audio.


If the cookie is already active, don't pop up the audio window.

Another possible way:

Popup the window using _blank. That is, force a new window each time.

Before you start piaying, check to see if a window with a given name (e.g., "OURPLAYER") is already open. If so, close the popup window and quite.

If not, change the name of the popup window to "CURPLAYER" and start playing the audio.

To find out if a window of a given name is already open, just use

var w = window.open("", "CURPLAYER", "...size and so on...");

Using the blank URL, if the window is already open, nothing happens except you get a reference to the already-open window of that name.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum