Det her script virker fint i Internet Explorer, men ikke i Opera, selvom Opera siger "browser er ikke MSIE"..
Hvis man bare skriver EMBED-koden, uden JavaScript's document.write, virker der fint..
<script type="text/JavaScript" language="JavaScript">
function vis_video()
{
var ua = navigator.userAgent;
//alert(ua + "\n" + ua.indexOf("MSIE"));
if (ua.indexOf("MSIE") > -1)
{
alert("browser er MSIE");
document.write('');
document.write('<OBJECT id="VIDEO" width="320" height="240" ');
document.write(' style="position:absolute; left:0;top:0;"');
document.write(' CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"');
document.write(' type="application/x-oleobject">');
document.write(' ');
document.write(' <PARAM NAME="URL" VALUE="
http://nhlogic.aspdotnet.dk/3kilo/TVAd_ApriliaMag_30sec.wmv">');
document.write(' <PARAM NAME="SendPlayStateChangeEvents" VALUE="True">');
document.write(' <PARAM NAME="AutoStart" VALUE="True">');
document.write(' <PARAM name="uiMode" value="none">');
document.write(' <PARAM name="PlayCount" value="9999">');
document.write('</OBJECT>');
} else {
alert("browser er ikke MSIE");
document.write('<EMBED');
document.write('TYPE="application/x-mplayer2"');
document.write('PLUGINSPAGE = "
http://www.microsoft.com/Windows/MediaPlayer/"');
document.write('SRC="
http://nhlogic.aspdotnet.dk/3kilo/TVAd_ApriliaMag_30sec.wmv"');
document.write('WIDTH="320"');
document.write('HEIGHT="284"');
document.write('AUTOPLAY="1"');
document.write('SHOWSTATUSBAR="1">');
}
}
vis_video();
</script>
<!--
<EMBED
TYPE="application/x-mplayer2"
PLUGINSPAGE = "
http://www.microsoft.com/Windows/MediaPlayer/"SRC="
http://nhlogic.aspdotnet.dk/3kilo/TVAd_ApriliaMag_30sec.wmv"WIDTH="320"
HEIGHT="284"
AUTOPLAY="1"
SHOWSTATUSBAR="1">
<!-- -->