3 // @description Turn RaiTV silverlight objects into video tags
4 // @namespace http://oblomov.myopenid.com
5 // @include http://rai.tv/*
6 // @include http://www.rai.tv/*
7 // @author Giuseppe "Oblomov" Bilotta
13 function getURL(name) {
14 var list = document.getElementsByName(name) ;
15 if (list && list[0]) {
16 return list[0].content;
23 std: getURL('videourl'),
24 mp4: getURL('videourl_mp4'),
25 wmv: getURL('videourl_wmv'),
26 h264: getURL('videourl_h264'),
27 m3u8: getURL('videourl_m3u8'),
30 function H5video(fmt) {
32 return '<source src="' + urls[fmt] + '" ' + (fmt == 'std' ? '' : 'type="video/' + fmt + '" ') + '/>'
38 var sch = document.getElementById("silverlightControlHost");
40 // prevent other JS with messing with this element further
41 sch.id = 'html5videoHost';
42 sch.innerHTML = "<video style='width:100%; height:100%' controls>" +
43 H5video('mp4') + H5video('wmv') +
44 H5video('h264') + H5video('m3u8') +