...

View Full Version : Controling WMP object



Alphamonkey
01-31-2007, 02:08 AM
i have an object



<object
id="mediaPlayer"
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject">
<param name="fileName" value=""value is here.mp3" />
<param name="animationatStart" value="true" />
<param name="transparentatStart" value="true" />
<param name="autoStart" value="true" />
<param name="showControls" value="true" />
</object>


I want to know how i would get the value of the param "fileName"

_Aerospace_Eng_
01-31-2007, 02:21 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function getParamVal(what)
{
var params = document.getElementById('mediaPlayer').getElementsByTagName('param');
for(var i = 0; i < params.length; i++)
{
if(params[i].getAttribute('name') == what)
{
alert(params[i].getAttribute('value'));
}
}
}
window.onload = function()
{
getParamVal('fileName');
}
</script>
</head>
<body>
<object id="mediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="fileName" value="value is here.mp3">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="true">
<param name="showControls" value="true">
</object>
</body>
</html>

Alphamonkey
01-31-2007, 03:02 AM
thanx that helped



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum