Tag Archives: javascript

Embed BBC iPlayer content

BBC’s iPlayer service is a great, if UK-only service that lets you catch up with any content shown on BBC terrestrial channels from the recent past. (Outside the UK? Try Hotspot Shield’s VPN, or read this guy’s blog)

Wouldn’t it be great if you could embed these shows into your blog?

Well, you can.

*update*

Thanks to Ryan at upyourego.com for a much nicer, easier and altogether more professional method of creating the embed. Check it here:

http://upyourego.com/pip/

*old method*

All credit to watchification.com for the method and code, and it’s a little hack-sy, but here you go:

<div class="vidembed" align="center">
<div id="
insertPIDhere" class="player">
<embed id="bbc_emp_embed_
insertPIDhere" width="512" height="323" flashvars="domId=insertPIDhere&config_settings_showFullScreenCta=false&playlist=http://www.bbc.co.uk/iplayer/playlist/insertPIDhere&config=http://www.bbc.co.uk/emp/iplayer/config.xml&config_settings_suppressCodec=h264" allowscriptaccess="always" allowfullscreen="true" wmode="default" quality="high" bgcolor="#000000" name="bbc_emp_embed_insertPIDhere" style="" src="http://www.bbc.co.uk/emp/9player.swf?revision=7276_7623" type="application/x-shockwave-flash"/>
</div>
<script type="text/javascript">
1
2 var emp = new embeddedMedia.Player();
3 emp.setWidth("512");
4 emp.setHeight("323");emp.setDomId("
insertPIDhere");
5emp.set("config_settings_showFullScreenCta","false");
6emp.setPlaylist("http://www.bbc.co.uk/iplayer/playlist/
insertPIDhere");
7 emp.setConfig("http://www.bbc.co.uk/emp/iplayer/config.xml");
8 emp.write();
9
</script>
</div>

Replace the seven pids (programme IDs) in the code (where it says insertPIDhere) from the correct show, and you’re away. PIDs can be found in the URL on the page for the episode you want to embed. For example, http://www.bbc.co.uk/iplayer/episode/b00gq734/QI_Series_6_Fight_or_Flight/, you’d want b00gq734.

It’s worth noting that the whole reason the BBC doesn’t allow embedding is because programmes expire after a certain time. Something you’d want to bear in mind if using this method.

Advertisements