# Embedded audio on BBC website: how is it done?

**URL:** <https://boards.straightdope.com/t/embedded-audio-on-bbc-website-how-is-it-done/526466>\
**Category:** Factual Questions\
**Created:** [January 26, 2010, 3:41am UTC](https://boards.straightdope.com/t/embedded-audio-on-bbc-website-how-is-it-done/526466 "2010-01-26T03:41:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Polerius](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@Polerius](https://boards.straightdope.com/u/Polerius)\
**Post date:** [January 26, 2010, 3:41am UTC](https://boards.straightdope.com/t/embedded-audio-on-bbc-website-how-is-it-done/526466/1 "2010-01-26T03:41:01Z")

</div>

Here’s the [link to the website](http://www.bbc.co.uk/radio1/chart/singles/).

They have a “Play” button for each song. When one song’s play button is pressed, any other song playing is stopped and the new one starts (there are surely many sites with similar features, this is just an example)

I tried looking at the page source, but after a quick perusal I can’t figure out what they are using to get the desired effect.

Are they using Flash with a Javascript wrapper? Something else?

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [January 26, 2010, 4:52am UTC](https://boards.straightdope.com/t/embedded-audio-on-bbc-website-how-is-it-done/526466/2 "2010-01-26T04:52:24Z")

</div>

They are using Flash and JS, yes. It appears they’re feeding the buttons using XML too (scroll all the way to the end of the source).

I’ve used the Flash player described in [this tutorial](http://www.macloo.com/examples/audio_player/) before and I am 90% sure that it stops all other music when a new button is pressed.

---

<div class="post-metadata">

**Author:** ![xash](https://avatars.discourse-cdn.com/v4/letter/x/c6cbf5/32.png) [@xash](https://boards.straightdope.com/u/xash)\
**Post date:** [January 26, 2010, 5:16am UTC](https://boards.straightdope.com/t/embedded-audio-on-bbc-website-how-is-it-done/526466/3 "2010-01-26T05:16:38Z")

</div>

I think the BBC uses the RealNetworks Helix Media Server:

[http://www.realnetworks.com/products-services/helix/media/server\_proxy.aspx](http://www.realnetworks.com/products-services/helix/media/server_proxy.aspx)

The code on the BBC website shows the following:

Radio player code:

```auto

<script src="/radio/aod/radioplayer.js" type="text/javascript"></script>
<script type="text/javascript">
<!--//
function launchInMainWindow( url ) {
	opener.location=url;
	opener.focus();
}
//-->
</script>

```

and

Play button code:

```auto

  <div class="button_container">
		<a onclick="return false;" href="#" class="previewItem" id="button">
			<span class="loader"></span>
		</a>
	  </div>	  						
      <a href="/music/artists/ad279295-653f-42e1-9aaa-b731df2e78ba">		

```

So when the user clicks the Play button, it sends the song ID and url to the radioplayer.js, and starts to play the song. Your browser most likely has a pre-installed plugin to handle the audio format.
