August 1999
RealAudio Detection
(State of the Art in 1999)
Displaying the results
<div style="border: 3px double blue;padding: 1rem;">
<script>
if (RealMode || RealPlayer5 || RealPlayer4) {
document.writeln("You're a-okay.");
} else {
document.writeln("Houston, it's a no-go");
}
</script>
</div>
Source Code
<script language="JavaScript">
<!--
var RealMode=0;
var RealPlayer5=0;
var RealPlayer4=0;
if (navigator.userAgent.indexOf("MSIE")<0 )
{
numPlugins = navigator.plugins.length;
for (i = 0; i < numPlugins; i++)
{
plugin = navigator.plugins[i];
if (plugin.name.substring(0,10)=="RealPlayer")
{
RealMode=1;
}
}
}
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('RealPlayer5 = (NOT IsNull(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control(32-bit)")))\n');
document.write('RealPlayer4 = (NOT IsNull(CreateObject("RealVideo.RealVideo(tm) ActiveX Control(32-bit)")))\n');
document.write('</script\> \n');
//-->
</script>