trying to stream video
"sunaram patir" <[email protected]>
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Could anyone tell me what is the problem with the following code?
firefox asks me to download plugins, internet explorer does nothing on
clicking on 'play'.
<a href='javascript:openPlayer("fileName")'>Play</a>
<script language='javascript'>
<!--
function openPlayer(fileToPlay){
var oTable=document.createElement("table");
oTable.setAttribute("border","0");
oTable.setAttribute("cellpading","0");
oTable.setAttribute("align","center");
var oTbody=document.createElement("tbody");
oTable.appendChild(oTbody);
var oTr=document.createElement("tr");
oTbody.appendChild(oTr);
var oTd=document.createElement("td");
oTr.appendChild(oTd);
var oObject=document.createElement("object");
oObject.setAttribute("id","mediaPlayer");
oObject.setAttribute("width","320");
oObject.setAttribute("height","285");
oObject.setAttribute("classid","CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95");
oObject.setAttribute("codebase","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701");
oObject.setAttribute("standby","Loading Microsoft Windows Player
Components...");
oObject.setAttribute("type","application/x-oleobject");
oTd.appendChild(oObject);
var oParam1=document.createElement("param");
oParam1.setAttribute("name","fileName");
oParam1.setAttribute("value",fileToPlay);
oObject.appendChild(oParam1);
var oParam2=document.createElement("param");
oParam2.setAttribute("name","animationatStart");
oParam2.setAttribute("value","true");
oObject.appendChild(oParam2);
var oParam3=document.createElement("param");
oParam3.setAttribute("name","transparentatStart");
oParam3.setAttribute("value","true");
oObject.appendChild(oParam3);
var oParam4=document.createElement("param");
oParam4.setAttribute("name","autoStart");
oParam4.setAttribute("value","true");
oObject.appendChild(oParam4);
var oParam5=document.createElement("param");
oParam5.setAttribute("name","showControls");
oParam5.setAttribute("value","true");
oObject.appendChild(oParam5);
var oParam6=document.createElement("param");
oParam6.setAttribute("name","loop");
oParam6.setAttribute("value","true");
oObject.appendChild(oParam6);
var oEmbed=document.createElement("embed");
oEmbed.setAttribute("type","x-mplayer2");
oEmbed.setAttribute("pluginspage","http://microsoft.com/windows/mediaplayer/en/download/");
oEmbed.setAttribute("id","mediaPlayer");
oEmbed.setAttribute("name","mediaPlayer");
oEmbed.setAttribute("displaysize","4");
oEmbed.setAttribute("autosize","-1");
oEmbed.setAttribute("bgcolor","darkblue");
oEmbed.setAttribute("showcontrols","true");
oEmbed.setAttribute("showtracker","-1");
oEmbed.setAttribute("showdisplay","0");
oEmbed.setAttribute("showstatusbar","-1");
oEmbed.setAttribute("videoborder3d","-1");
oEmbed.setAttribute("width","320");
oEmbed.setAttribute("height","285");
oEmbed.setAttribute("src",fileToPlay);
oEmbed.setAttribute("autostart","true");
oEmbed.setAttribute("designtimesp","5311");
oEmbed.setAttribute("loop","true");
oObject.appendChild(oEmbed);
document.body.appendChild(oTable);
}
//-->
</script>
Unsubscribe
[email protected]
List info
http://www.quirksmode.org/dom/list.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wdf-dom/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/