function play_stream(wmastream, htmlstream, width, height) {
	var agent=navigator.userAgent.toLowerCase();
	
	var is_ipad  = ((agent.indexOf('ipad')!=-1));
	var is_iphone = ((agent.indexOf('iphone')!=-1));
	var is_mac = ((agent.indexOf('mac')!=-1));

  var has_video_support = 0;
  if ($('html').hasClass('video')) { has_video_support = 1; }
	
	
	if((is_ipad == true) || (is_iphone == true) || ( is_mac == true && has_video_support == 1) ) {
		document.write("<video src='" + htmlstream + "' width='" + width + "' height='" + height + "' autobuffer autoplay controls></video>");
		//alert("html5 video");
	} else {
		
			if(Silverlight.isInstalled("1.00") == true) { // silverlight is aanwezig?
				//document.write("<div id='playerdiv'></div>");
				
				var cnt = document.getElementById("mediaspace");
				var src = 'http://q-music.be/silverlight/wmvplayer.xaml';
				var cfg = {
					
					file: wmastream,
					image:'http://q-music.be/silverlight/logoQ.jpg',
						width:'290',
						height:'200',
						autostart:'true',
								volume:'25',                       
								bufferlength:'9',
								lightcolor :'ff0000',
								shownavigation :'true',
								showdigits:'false',
								backcolor:'ffffff',
								showstop:'true',
					windowless:'true'
				};
				var ply = new jeroenwijering.Player(cnt,src,cfg);		

			//alert("silverlight is aanwezig");
			} 
			
			else { // gewoon object embed methode
				
					//document.write('<OBJECT ID="MediaPlayer" WIDTH="512" HEIGHT="288" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">');
					//document.write('<PARAM NAME="FileName" VALUE="' + wmastream +'">');
					//document.write('<PARAM name="autostart" VALUE="true">');
					//document.write('<PARAM name="ShowControls" VALUE="true">');
					//document.write('<param name="ShowStatusBar" value="false">');
					//document.write('<PARAM name="ShowDisplay" VALUE="false">');
					//document.write('<EMBED TYPE="application/x-mplayer2" SRC="'+ wmastream +'" NAME="MediaPlayer"');
					//document.write('WIDTH="512" HEIGHT="288" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="1"> </EMBED>');
					//document.write('</OBJECT>');
				
				//alert("object embed code");
/*			
document.write('<OBJECT ID="MediaPlayer" WIDTH="512" HEIGHT="288" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"');
document.write('STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">');
document.write('<PARAM NAME="FileName" VALUE="mms://vmmalivewm.fplive.net/vmmalive-live/live-event">');
document.write('<PARAM name="autostart" VALUE="true">');
document.write('<PARAM name="ShowControls" VALUE="true">');
document.write('<param name="ShowStatusBar" value="false">');
document.write('<PARAM name="ShowDisplay" VALUE="false">');
document.write('<EMBED TYPE="application/x-mplayer2" SRC="mms://vmmalivewm.fplive.net/vmmalive-live/live-event" NAME="MediaPlayer"');
document.write('WIDTH="512" HEIGHT="288" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="1"> </EMBED>');
document.write('</OBJECT>');
*/

/*
document.write('<OBJECT ID="MediaPlayer" WIDTH="512" HEIGHT="288" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject"><PARAM NAME="FileName" VALUE="mms://vmmalivewm.fplive.net/vmmalive-live/live-event"><PARAM name="autostart" VALUE="true"><PARAM name="ShowControls" VALUE="true"><param name="ShowStatusBar" value="false"><PARAM name="ShowDisplay" VALUE="false"><EMBED TYPE="application/x-mplayer2" SRC="mms://vmmalivewm.fplive.net/vmmalive-live/live-event" NAME="MediaPlayer"WIDTH="512" HEIGHT="288" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="1"> </EMBED></OBJECT>');			

*/

document.write('<OBJECT ID="MediaPlayer" WIDTH="290" HEIGHT="200" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject"><PARAM NAME="FileName" VALUE="mms://vmmalivewm.fplive.net/vmmalive-live/live-event"><PARAM name="autostart" VALUE="true"><PARAM name="ShowControls" VALUE="true"><param name="ShowStatusBar" value="false"><PARAM name="ShowDisplay" VALUE="false"><EMBED TYPE="application/x-mplayer2" SRC="mms://vmmalivewm.fplive.net/vmmalive-live/live-event" NAME="MediaPlayer" WIDTH="290" HEIGHT="200" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="1"> </EMBED></OBJECT>');	
			
			
			
			}
			
		
		

	}
}
