3 | | <head> |
4 | | <!-- Author: R.D. Vaughan |
5 | | Apr 28th, 2010 |
6 | | Purpose: Implement full screen browser video display for the BBC iPlayer |
7 | | Example: |
8 | | file:///usr/local/share/mythtv/mythnetvision/scripts/nv_python_libs/configs/HTML/bbciplayer.html?videocode=b00s5nfv |
9 | | --> |
10 | | <script type="text/javascript"> |
11 | | function gup( name ) |
12 | | { |
13 | | name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); |
14 | | var regexS = "[\\?&]"+name+"=([^&#]*)"; |
15 | | var regex = new RegExp( regexS ); |
16 | | var results = regex.exec( window.location.href ); |
17 | | if( results == null ) |
18 | | return ""; |
19 | | else |
20 | | return results[1]; |
21 | | } |
22 | | |
23 | | var videocode = gup( 'videocode' ); |
24 | | var embedded = '<embed height="98%" width="100%" type="application/x-shockwave-flash" src="http://s.ytimg.com/yt/swf/watch-vfl170492.swf" id="movie_player" flashvars="rv.7.length_seconds=136&rv.2.thumbnailUrl=http%3A%2F%2Fi2.ytimg.com%2Fvi%2FIFhhaXDziZ4%2Fdefault.jpg&rv.0.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBf04aUZMIVQ&rv.0.view_count=28868&vq=auto&rv.6.author=krlitosito&rv.3.view_count=34084&rv.0.length_seconds=251&rv.4.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FzI9C9j0QgU4%2Fdefault.jpg&fmt_url_map=34%7Chttp%3A%2F%2Fv11.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D99.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D902303%252C906712%26algorithm%3Dthrottle-factor%26itag%3D34%26ipbits%3D8%26burst%3D40%26sver%3D3%26expire%3D1276203600%26key%3Dyt1%26signature%3D977BE213A3E74A1B3597CC270D8990872B299745.B36097223339C126F6C108E54090CDAEFE383D73%26factor%3D1.25%26id%3Db9493e8e24226592%2C5%7Chttp%3A%2F%2Fv14.lscache2.c.youtube.com%2Fvideoplayback%3Fip%3D99.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D902303%252C906712%26algorithm%3Dthrottle-factor%26itag%3D5%26ipbits%3D8%26burst%3D40%26sver%3D3%26expire%3D1276203600%26key%3Dyt1%26signature%3D42F8774F51ED24983133B8D8F797908F97D8C371.3B0C17A6728074833130840B82BE167F4CA1035D%26factor%3D1.25%26id%3Db9493e8e24226592&csi_page_type=wwad&cr=CA&rv.1.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPzeRpPSZOjI&rv.6.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FBwBz4h_4POA%2Fdefault.jpg&host_language=en&rv.3.rating=4.92660550459&fmt_list=34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0&rv.7.id=P5y-yjheRKE&targeting_video_doc_id=&rv.0.rating=4.97297297297&invideo=True&rv.5.id=6oHEgkK9wj0&tk=Rqbx09U3FZ_vusI7vVWVX-zIbWbZAIm1Q2GN6gt7W3SQKWb-qm-Lvw%3D%3D&sffb=True&rv.0.id=Bf04aUZMIVQ&rv.5.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6oHEgkK9wj0&timestamp=1276178843&rv.0.author=WaspEnterprise&rv.3.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2F663CI_o4sTY%2Fdefault.jpg&rv.2.author=8Etech8&rv.6.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBwBz4h_4POA&ad_host=ca-host-pub-4790912793353039&ad_eurl=http%3A%2F%2Fwww.youtube.com%2Fvideo%2FVIDEOCODE&mpu=True&hl=en_US&ad_flags=1&rv.0.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FBf04aUZMIVQ%2Fdefault.jpg&rv.5.length_seconds=282&rv.7.author=krlitosito&rv.5.view_count=7517&rv.1.length_seconds=251&rv.3.id=663CI_o4sTY&rv.2.id=IFhhaXDziZ4&rv.2.length_seconds=316&t=vjVQa1PpcFMjs5n51hkGar4Hp9uA3GYTt6LvegEYo00%3D&rv.6.id=BwBz4h_4POA&cafe_experiment_id=&rv.6.view_count=2565&rv.3.author=krlitosito&rv.4.id=zI9C9j0QgU4&fexp=902303%2C906712&allow_embed=1&ad_host_tier=54235&fmt_stream_map=34%7Chttp%3A%2F%2Fv11.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D99.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D902303%252C906712%26algorithm%3Dthrottle-factor%26itag%3D34%26ipbits%3D8%26burst%3D40%26sver%3D3%26expire%3D1276203600%26key%3Dyt1%26signature%3D977BE213A3E74A1B3597CC270D8990872B299745.B36097223339C126F6C108E54090CDAEFE383D73%26factor%3D1.25%26id%3Db9493e8e24226592%2C5%7Chttp%3A%2F%2Fv14.lscache2.c.youtube.com%2Fvideoplayback%3Fip%3D99.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D902303%252C906712%26algorithm%3Dthrottle-factor%26itag%3D5%26ipbits%3D8%26burst%3D40%26sver%3D3%26expire%3D1276203600%26key%3Dyt1%26signature%3D42F8774F51ED24983133B8D8F797908F97D8C371.3B0C17A6728074833130840B82BE167F4CA1035D%26factor%3D1.25%26id%3Db9493e8e24226592&rv.2.rating=4.88311688312&shownextbutton=1&rv.1.id=PzeRpPSZOjI&rv.4.length_seconds=228&ad_logging_flag=1&rv.7.view_count=3940&rv.6.length_seconds=253&length_seconds=295&fmt_map=34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0&enablejsapi=1&video_id=VIDEOCODE&plid=AASIrYqnNA1liVSJ&afv=True&rv.5.rating=4.98&ad_tag=http%3A%2F%2Fad-g.doubleclick.net%2Fpfadx%2Fcom.ytpwatch.music%2Fmain_6%3Bsz%3DWIDTHxHEIGHT%3Bmpvid%3DAASIrYqpBw0C8F4n%3B%21c%3D6%3Bytexp%3D902303.906712%3Bytps%3Ddefault%3Bklg%3Den%3Bkvid%3DVIDEOCODE%3Bctb%3D1%3Bkt%3DK%3Bko%3Dc%3Bkpid%3D6%3Bkga%3D-1%3Bkr%3DN%3Bshortform%3D1%3Bu%3DVIDEOCODE%7C6%3Bkgg%3D-1%3Bkcr%3Dca%3Bafv%3D1%3Bkhd%3D0%3Bdc_dedup%3D1%3Bkpu%3Desther1208%3B&ad_video_pub_id=ca-pub-6219811747049371&rv.4.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzI9C9j0QgU4&rv.1.author=0rganix&rv.1.rating=4.97674418605&rv.5.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2F6oHEgkK9wj0%2Fdefault.jpg&watermark=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf&rv.7.rating=4.73333333333&rv.3.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D663CI_o4sTY&rv.2.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIFhhaXDziZ4&cid=6&rv.7.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DP5y-yjheRKE&rv.2.view_count=31320&ad_channel_code_overlay=invideo_overlay_480x70_cat10%2Cafv_overlay%2Cafv_ugc%2Cytps_default%2Cyt_mpvid_AASIrYqpBw0C8F4n%2Cyt_cid_6%2Cytexp_902303.906712&rv.4.view_count=1325763&ad_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fad-vfl170492.swf&rv.1.view_count=22657&dclk=True&rv.6.rating=5.0&sk=lsWSaZl1UFLCUxUw44Lon-hoi_2GTCy-C&ctb=True&rv.1.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FPzeRpPSZOjI%2Fdefault.jpg&mpvid=AASIrYqpBw0C8F4n&rv.3.length_seconds=330&rv.5.author=Ulrick31&rv.4.rating=4.90052939537" allowscriptaccess="always" allowfullscreen="true" bgcolor="#000000" />'; |
25 | | document.write('<title>YouTube Full Screen</title>'); |
26 | | document.write(embedded.replace(/VIDEOCODE/g, videocode)); |
27 | | |
28 | | </script> |
29 | | </head> |
| 3 | <head> |
| 4 | <style type="text/css"> |
| 5 | body { |
| 6 | padding: 0; |
| 7 | margin: 0; |
| 8 | } |
| 9 | </style> |
| 10 | |
| 11 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> |
| 12 | <script type="text/javascript"> |
| 13 | /* gup function by R.D. Vaughan */ |
| 14 | function gup( name ) |
| 15 | { |
| 16 | name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); |
| 17 | var regexS = "[\\?&]"+name+"=([^&#]*)"; |
| 18 | var regex = new RegExp( regexS ); |
| 19 | var results = regex.exec( window.location.href ); |
| 20 | if( results == null ) |
| 21 | return ""; |
| 22 | else |
| 23 | return results[1]; |
| 24 | } |
| 25 | |
| 26 | var myth_player = null; |
| 27 | |
| 28 | var params = { |
| 29 | allowScriptAccess: "always", |
| 30 | allowfullscreen: 'true', |
| 31 | wmode: 'opaque' |
| 32 | }; |
| 33 | var atts = { id: "myytplayer" }; |
| 34 | swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=ytplayer", |
| 35 | "myth_player", window.innerWidth, window.innerHeight, "8", null, null, params, atts); |
| 36 | |
| 37 | function onYouTubePlayerReady(playerId) { |
| 38 | myth_player = document.getElementById("myytplayer"); |
| 39 | myth_player.setVolume(50); |
| 40 | var videocode = gup('videocode'); |
| 41 | if (videocode != "") { |
| 42 | myth_player.cueVideoById(videocode); |
| 43 | myth_player.playVideo(); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | function play() { |
| 48 | if (myth_player) { |
| 49 | var state = myth_player.getPlayerState(); |
| 50 | if (state == 1) // Playing |
| 51 | myth_player.pauseVideo(); |
| 52 | else if (state != 3) // Video is either unstarted, ended, paused or cued |
| 53 | myth_player.playVideo(); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | function seek(amount) { |
| 58 | if (myth_player) { |
| 59 | myth_player.seekTo(myth_player.getCurrentTime() + amount, true); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | function adjustVolume(amount) { |
| 64 | if (myth_player) { |
| 65 | myth_player.setVolume(myth_player.getVolume() + amount); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | window.onresize = function() { |
| 70 | document.body.style.width = window.innerWidth; |
| 71 | document.body.style.height = window.innerHeight; |
| 72 | if (myth_player) { |
| 73 | // myth_player.setSize(window.innerWidth, window.innerHeight); |
| 74 | document.getElementById("myytplayer").width = window.innerWidth; |
| 75 | document.getElementById("myytplayer").height = window.innerHeight; |
| 76 | } |
| 77 | }; |
| 78 | </script> |
| 79 | </head> |
| 80 | <body> |
| 81 | <div id="myth_player"/> |
| 82 | </body> |