-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Internet Content: Update BBC iPlayer HTML to use SWFPlayer.
Better fullscreen experience, and if I ever figure the Javascript API out, it'll be possible to control from the remote.
- Loading branch information
Robert McNamara
committed
Dec 9, 2010
1 parent
8d49bf3
commit 885129b
Showing
1 changed file
with
111 additions
and
26 deletions.
There are no files selected for viewing
137 changes: 111 additions & 26 deletions
137
mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/bbciplayer.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,114 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> | ||
<html> | ||
<head> | ||
<!-- Author: R.D. Vaughan Apr 28th, 2010 | ||
Purpose: Implement full screen browser video display for the BBC iPlayer | ||
Example: | ||
file:///usr/local/share/mythtv/mythnetvision/scripts/nv_python_libs/configs/HTML/bbciplayer.html?videocode=b00s5nfv | ||
--> | ||
<script type="text/javascript"> | ||
function gup( name ) | ||
{ | ||
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | ||
var regexS = "[\\?&]"+name+"=([^&#]*)"; | ||
var regex = new RegExp( regexS ); | ||
var results = regex.exec( window.location.href ); | ||
if( results == null ) | ||
return ""; | ||
else | ||
return results[1]; | ||
} | ||
|
||
var videocode = gup( 'videocode' ); | ||
var embedded = '<embed width="100%" height="98%" allowfullscreen="true" allowscriptaccess="always" wmode="default" quality="high" flashvars="embedReferer=&embedPageUrl=http%3A%2F%2Fwww.bbc.co.uk%2Fiplay er%2Fepisode%2FVIDEOCODE%2F%3F t%3D2m53s&domId=bip-play-emp&config=http%3A%2F%2Fwww.bbc.co.uk%2Femp %2Fiplayer%2Fconfig.xml&playlist=http%3A%2F%2Fwww.bbc.co.uk%2Fiplayer%2F playlist%2FVIDEOCODE&holdingImage=http%3A%2F%2Fnode1.bbcimg.co.uk%2Fiplay er%2Fimages%2Fepisode%2FVIDEOCODE_640_360.jpg&config_settings_bitrateFloo r=0&config_settings_bitrateCeiling=2500&config_settings_transportHei ght=35&config_settings_cueItem=b00rqkg0%3A173&config_settings_autoPl ay=true&config_settings_showPopoutCta=false&config_messages_diagnost icsMessageBody=Insufficient%20bandwidth%20to%20stream%20this%20programme.%20 Try%20downloading%20instead%2C%20or%20see%20our%20diagnostics%20page.&co nfig_settings_language=en&guidance=unset" id="bbc_emp_embed_bip-play-emp" src="http://www.bbc.co.uk/emp/10player.swf?revision=15501_15796" type="application/x-shockwave-flash"/>'; | ||
document.write('<title>BBC iPlayer Full Screen</title>'); | ||
document.write(embedded.replace(/VIDEOCODE/g, videocode)); | ||
|
||
</script> | ||
</head> | ||
<head> | ||
<style type="text/css"> | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
</style> | ||
|
||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> | ||
|
||
<script type="text/javascript"> | ||
/* gup function by R.D. Vaughan */ | ||
function gup( name ) | ||
{ | ||
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | ||
var regexS = "[\\?&]"+name+"=([^&#]*)"; | ||
var regex = new RegExp( regexS ); | ||
var results = regex.exec( window.location.href ); | ||
if( results == null ) | ||
return ""; | ||
else | ||
return results[1]; | ||
} | ||
|
||
var video_id = gup( 'videocode' ); | ||
var myth_player = null; | ||
var paused = false; | ||
var volume = 50; | ||
|
||
var embedPage = "http://www.bbc.co.uk/iplayer/episode/"; | ||
embedPage = embedPage.concat(video_id); | ||
embedPage = embedPage.concat("/Top_Gear_Series_13_Episode_1_(new_series)/?t=00m01s"); | ||
|
||
var pl = "http://www.bbc.co.uk/iplayer/playlist/"; | ||
pl = pl.concat(video_id); | ||
|
||
var hi = "http://node2.bbcimg.co.uk/iplayer/images/episode/"; | ||
hi = hi.concat(video_id); | ||
hi = hi.concat("_640_360.jpg"); | ||
|
||
function play() { | ||
if (myth_player) { | ||
if (paused) { | ||
myth_player.play(); | ||
paused = false; | ||
} | ||
else if (!paused) { | ||
myth_player.pause(); | ||
paused = true; | ||
} | ||
} | ||
} | ||
|
||
function seek(amount) { | ||
if (myth_player) { | ||
myth_player.seekTo(myth_player.getCurrentTime() + amount); | ||
} | ||
} | ||
|
||
function adjustVolume(amount) { | ||
if (myth_player) { | ||
volume += amount; | ||
if (volume > 100) | ||
volume = 100; | ||
if (volume < 0) | ||
volume = 0; | ||
myth_player.setVolume(volume); | ||
} | ||
} | ||
|
||
var flashvars = { | ||
embedReferer: '', | ||
embedPageUrl: embedPage, | ||
domId: 'bip-play-emp', | ||
config: 'http://www.bbc.co.uk/emp/iplayer/config.xml', | ||
playlist: pl, | ||
holdingImage: hi, | ||
config_settings_bitrateFloor: 0, | ||
config_settings_bitrateCeiling: 2500, | ||
config_settings_transportHeight: 35, | ||
config_settings_cueItem: "b00ldy1k:875", | ||
config_settings_showPopoutCta: false, | ||
config_messages_diagnosticsMessageBody: "Insufficient bandwidth to stream this programme. Try downloading instead, or see our diagnostics page.", | ||
config_settings_language: "en", | ||
guidance: "unset" | ||
}; | ||
|
||
var params = { | ||
allowscriptaccess: 'always', | ||
allowfullscreen: 'true', | ||
wmode: 'opaque', | ||
}; | ||
|
||
var attributes = { id: "mybbcplayer" }; | ||
|
||
swfobject.embedSWF("http://www.bbc.co.uk/emp/9player.swf?revision=10344_10570", "myth_player", window.innerWidth, window.innerHeight, "9.0.0", "expressInstall.swf", flashvars, params, attributes); | ||
|
||
function onPlayerReady(playerId) { | ||
myth_player = document.getElementById("mybbcplayer"); | ||
myth_player.setVolume(50); | ||
if (videocode != "") { | ||
myth_player.loadVideoById(videocode); | ||
myth_player.playVideo(); | ||
} | ||
} | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<div id="myth_player"/> | ||
</body> | ||
</html> |