Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Continual Music across pages

Featured Replies

I have a client who broadcast live radio not internet based, they require a live player on their site. We have found Shoutcast (www.shoutcast.com), their website has a player that plays across the site, even when you change pages, short of using an iframe does anyone know how we can achieve this function.

 

Also I would like to ask if there is an alternative to target_blank should we wish to have a player open in a new window that does not use javascript or jquery as we do not want to exclude those who turn javascript off in their browsers.

Thanks

Edited by kezzyme85

My approach would be to use Ajax for the whole website. You'll need JavaScript for that though.

 

To be honest, I really think you are better to build the website with JS as a requirement and warn users that they need it switched on in order to use the website. I'm not sure of exact stats, but the significant majority have JavaScript enabled.

 

I agree, the percentage of websites that require JavaScript now is huge, you'd be pretty used to many sites simply not working if JavaScript was turned off, if possible we should try to provide a fallback, but it's not always practical to do so. The number of folk who browse with JS turned off must be really low now.

All radio sites i use always opens the player in a new window, this would be the easiest way if the site is already developed, if not as they said above js/ajax would be the best option. Maybe have them both so you can support non JS users

...Also I would like to ask if there is an alternative to target_blank should we wish to have a player open in a new window that does not use javascript or jquery as we do not want to exclude those who turn javascript off in their browsers...

target="_blank" is your only option for new windows if you do not want to use JavaScript window,open(); but why not use both:

Set up links where you prevent the default link-action for js users (event.preventDefault(); or return false;) then use the href attribute of your links as the url parameter.

Somthing like:

window.open(this.href);

for non js users the links would gracefully degrade to target="_blank"

I don't usually comment in the development section but since in this case kezzyme85 is my business partner i think i need to make the question a little clearer.

 

Although you have all given an answer to the question itself, we thank you for that, would anyone know how shoutcast in perticular have achieved it?

 

Neither of us know ajax but javascript or jquery may be an option, although we did not want to use target blank because its deprecated

 

Thanks

Wynn is correct. The target blank attribute is not deprecated it was taken out of the XHTML Strict specs because it was considered best to let users determine how links should open. But It was back in the HTML5 specs again.

I think Shoutcast are using jPlayer.

There is nothing wrong with using target="_blank". It may have been depreciated in XHTML but is perfectly valid HTML5.

http://www.w3.org/TR/2014/REC-html5-20141028/browsers.html#valid-browsing-context-name-or-keyword

Wynn is correct. The target blank attribute is not deprecated it was taken out of the XHTML Strict specs because it was considered best to let users determine how links should open. But It was back in the HTML5 specs again.

Thank you, i never realised

We do however still wish to find out how we could have the player continue to play across pages without opening a new window ( as it is in the example site) the reason for this is because i am thinking about the ux and ui for users on mobile devices, whether opening a new window would destroy ux. Accessability is a concern, I realise that those who turn off javascript are small in number but we prefer not to exclude them if we can. Maybe there is a php solution? Sonething that could emulate frames for example without actually being a frame?

Thank you, i never realised

We do however still wish to find out how we could have the player continue to play across pages without opening a new window ( as it is in the example site) the reason for this is because i am thinking about the ux and ui for users on mobile devices, whether opening a new window would destroy ux. Accessability is a concern, I realise that those who turn off javascript are small in number but we prefer not to exclude them if we can. Maybe there is a php solution? Sonething that could emulate frames for example without actually being a frame?

In that case an AJAX solution is really your best option. Use a solution where you load different page content into a single page so that all http requests are executed without a page refresh (which would stop the musicplayer) . The easiest way to use AJAX is with jQuerys load() method. Alternatively you could load the content for the different pages in a main content iframe on a single page and target that frame for all your menu links. That solution is not recomended by many but it would require no JS.

Edited by Nillervision

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.