PDA

View Full Version : Opening link in new window questions...


KOMI
06-07-2005, 08:04 PM
Hey,

Very simply, I have links on my site that will open a new window which will play an embedded video within it. So, what I'd like to know is:

1. How can I make the newly opened windows only be the size of the media player that I have embedded? Like, it's not a fullscreen site, just the size of the screen of the video?

2. How can I make this new window always open in the CENTER of your screen?

and 3. How can I make this new window UN-RESIZABLE?

Thanks for the info, I'm told this is simple to accomplish, but I'm not the smartest in the HTML world. I use Frontpage AND Dreamweaver.

Thanks! :)

- KOMI

_Aerospace_Eng_
06-07-2005, 09:21 PM
Something like this?
<!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>Untitled Document</title>
<script type="text/javascript">
function player(video,wid,hgt,title){
sw=(screen.width-wid)/2;
sh=(screen.height-hgt)/2;
thgt=hgt-35;
mediaplayer=window.open('','player','width='+wid+',height='+hgt+',top='+sh+',left='+sw+',menubars=0, toolbars=0,status=0,directories=0,resizable=0');
mediaplayer.document.open();
mediaplayer.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"');
mediaplayer.document.write('"http://www.w3.org/TR/html4/loose.dtd">');
mediaplayer.document.write('<html>\n<head>\n<title>'+title+'</title>\n</head>\n');
mediaplayer.document.write('<body style="margin:0;padding:0;">\n');
mediaplayer.document.write('<object id="mediaPlayer" width="'+wid+'" height="'+thgt+'" \n'
+'classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" \n'
+'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" \n'
+'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">\n'
+'<param name="fileName" value="'+video+'">\n'
+'<param name="animationatStart" value="true">\n'
+'<param name="transparentatStart" value="true">\n'
+'<param name="autoStart" value="true">\n'
+'<param name="showControls" value="true">\n'
+'<param name="loop" value="true">\n'
+'<embed type="application/x-mplayer2" \n'
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" \n'
+'showcontrols="true" width="'+wid+'" height="'+thgt+'" \n'
+'src="'+video+'" autostart="true" loop="true">\n'
+'</embed>\n'
+'</object>');
mediaplayer.document.close();
mediaplayer.resizeTo(wid,hgt);
mediaplayer.focus();
}
</script>
</head>
<body>
<a href="yourmovie.wmv" onclick="player(this.href,'300','300','Some Title');return false;">Play Video</a>
</body>
</html>

KOMI
06-07-2005, 09:52 PM
Wow...

That is, wow, perfect! =:O

Thanks a lot. This place is full of Geniuses! :thumbup:

- KOMI

_Aerospace_Eng_
06-07-2005, 09:58 PM
Your welcome.