Teehee99
asked on
How to center embedded Media Player in pop-up window ?
Hi all ,
I have buttons on my webpage that pop up a html page and resize it in a window (310,290) . The window just contains an embedded Windows Media Player :
body onload="top.window.focus() ;moveTo(0, 0);">
<object name="wmtPlayer" width="300" height="280"
classid="CLSID:6BF52A52-39 4A-11d3-B1 53-00C04F7 9FAA6">
<param name="url" value="xxxx.wmv">
<param name="autostart" value="1">
<param name="uiMode" value="mini">
<embed type="application/x-mplaye r2"
name="wmtPlayer"
src="xxxx.wmv"
autostart="1"
uimode="mini"
width=300 height=280>
</embed>
</object>
</body>
The window (20 pixels bigger to accomodate the player controls ) pops up ok and plays fine BUT the player is never centered in IE or Netscape ..always sitting a little low in the window . Any ideas how to center it exactly in Netscape and IE so there is no gaps or cutoffs around the player ?
I have buttons on my webpage that pop up a html page and resize it in a window (310,290) . The window just contains an embedded Windows Media Player :
body onload="top.window.focus()
<object name="wmtPlayer" width="300" height="280"
classid="CLSID:6BF52A52-39
<param name="url" value="xxxx.wmv">
<param name="autostart" value="1">
<param name="uiMode" value="mini">
<embed type="application/x-mplaye
name="wmtPlayer"
src="xxxx.wmv"
autostart="1"
uimode="mini"
width=300 height=280>
</embed>
</object>
</body>
The window (20 pixels bigger to accomodate the player controls ) pops up ok and plays fine BUT the player is never centered in IE or Netscape ..always sitting a little low in the window . Any ideas how to center it exactly in Netscape and IE so there is no gaps or cutoffs around the player ?
Use table tag to center. Hope this is what you are looking for.
=======================
<body onload="top.window.focus() ;moveTo(0, 0);">
<table width=100% height=100% cellpadding=0>
<tr><td align=center valign=middle>
<object name="wmtPlayer" width="300" height="280"
classid="CLSID:6BF52A52-39 4A-11d3-B1 53-00C04F7 9FAA6">
<param name="url" value="1.mp3">
<param name="autostart" value="1">
<param name="uiMode" value="mini">
<embed type="application/x-mplaye r2"
name="wmtPlayer"
src="1.mp3"
autostart="1"
uimode="mini"
width=300 height=280>
</embed>
</object>
</td></tr>
</table>
</body>
========================== ======
=======================
<body onload="top.window.focus()
<table width=100% height=100% cellpadding=0>
<tr><td align=center valign=middle>
<object name="wmtPlayer" width="300" height="280"
classid="CLSID:6BF52A52-39
<param name="url" value="1.mp3">
<param name="autostart" value="1">
<param name="uiMode" value="mini">
<embed type="application/x-mplaye
name="wmtPlayer"
src="1.mp3"
autostart="1"
uimode="mini"
width=300 height=280>
</embed>
</object>
</td></tr>
</table>
</body>
==========================
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
body style="margin:0" onload="top.window.focus() ;moveTo(0, 0);">
<object style="margin:0" name="wmtPlayer" width="300" height="280"
classid="CLSID:6BF52A52-39 4A-11d3-B1 53-00C04F7 9FAA6">
<param name="url" value="xxxx.wmv">
<param name="autostart" value="1">
<param name="uiMode" value="mini">
<embed type="application/x-mplaye r2"
name="wmtPlayer"
src="xxxx.wmv"
autostart="1"
uimode="mini"
width=300 height=280>
</embed>
</object>
</body>
Cd&
<object style="margin:0" name="wmtPlayer" width="300" height="280"
classid="CLSID:6BF52A52-39
<param name="url" value="xxxx.wmv">
<param name="autostart" value="1">
<param name="uiMode" value="mini">
<embed type="application/x-mplaye
name="wmtPlayer"
src="xxxx.wmv"
autostart="1"
uimode="mini"
width=300 height=280>
</embed>
</object>
</body>
Cd&
then in the html of the table which you should set it in, have it centered. The cell that is. Then the player resides in the cell which is centered on the page, and also make the cell exactly the size of the player.
-Steve