Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wmv file play

Status
Not open for further replies.

redletterrocko

Programmer
Aug 8, 2005
53
US
Hi everyone, I think this question should be pretty straightforward. I was wondering how I would embed a media player window in the browser to play a .wmv file. If you could just point me to a site that explains it, that would be fine. I already googled for it, but I couldn't find anything that looked like it would help me.

Thanks,
Paul
 
I didn't write this but found it somewhere.
To the author I appologize for not getting your info.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
body {
margin:0;
padding:0;
text-align:center;
}
</style>
<script type="text/javascript">
var detect = navigator.userAgent.toLowerCase();
var OS,browser,thestring;
var theFile="Your.wmv";[COLOR=red]//the file you wish to play[/color]
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
</script>
</head>

<body>
<div id="player">
<script type="text/javascript">
if (checkIt('msie')&&checkIt('windows')){
document.getElementById('player').innerHTML='<object width="500" height="345" '
      +'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
      +'codebase="[URL unfurl="true"]http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"'[/URL]
      +'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
      +'<param name="url" value="'+theFile+'">'
      +'<param name="uiMode" value="full">'
      +'<param name="autoStart" value="true">'
      +'<param name="loop" value="true">'
	  +'<\/object>';
}
else {
document.getElementById('player').innerHTML='<embed src="'+theFile+'" style="width:500px;height:345px;" showcontrols="true" autostart="true"></embed>';
}
</script>
</div>
</body>
</html>

Glen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top