0

I need to be able to launch the default medial player to a pop-up window. As anyone done this before and can point me to a method to do this.
Thanks!
WBR

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by rouse
0

This is the solution I put together. A link from my menu that calls a JavaScript file to build the popup window, and then a call from the script to load the HTML. (I made a quick attempt to edit out irrelevant portions of the HTML file)

The link:

<a onclick="javascript:showMedia();return false" />Paint Removal Demo</a>

The JS file:

unction showMedia(){
var width  = 600;
var height = 400;
var left   = (screen.width  - width)/2;
var top    = (screen.height - height)/2;
var params = 'width='+width+', height='+height;
params += ', top='+top+', left='+left;
params += ', directories=no';
params += ', location=no';
params += ', menubar=no';
params += ', resizable=no';
params += ', scrollbars=no';
params += ', status=no';
params += ', toolbar=no';
newwin=window.open('external/paintRemovalDemo.html','media01', params);
if (window.focus){
newwin.focus();
}
return false;

The HTML file:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Paint Removal Demo</title>
</head>
<script type="text/javascript" src="JavaScript/media.js"></script>
<body>


<CENTER>
<div id="video">
<OBJECT ID="MediaPlayer2" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
width="400" height="320">
<PARAM NAME="URL" VALUE="../video/PaintRemoval.wmv">
<PARAM NAME="ClickToPlay" VALUE="TRUE">
<PARAM NAME="AutoStart" VALUE="FALSE">
<PARAM NAME="ShowControls" VALUE="TRUE">
<PARAM NAME="ShowDisplay" VALUE="FALSE">
<PARAM NAME="ShowStatusBar" VALUE="FALSE">
<embed TYPE="application/x-mplayer2"  pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"
filename="../video/PaintRemoval.wmv"  SRC="../video/PaintRemoval.wmv"  Name=MediaPlayer2
ClickToPlay=1 AutoStart=0 ShowControls=1 ShowDisplay=0 ShowStatusBar=0
controls="PlayButton" width=400  height=320>
</embed>
</OBJECT>
</div>
</CENTER>


<CENTER>
<FORM><INPUT type="button" value="Close Window"
onClick="window.close()"></FORM>
</CENTER>
</body>
</html>

Hope this helps someone.
WBR

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.