Link to home
Start Free TrialLog in
Avatar of Teehee99
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-394A-11d3-B153-00C04F79FAA6">
                    <param name="url" value="xxxx.wmv">
                    <param name="autostart" value="1">
                    <param name="uiMode" value="mini">
                    <embed type="application/x-mplayer2"
                        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 ?

Avatar of stebesplace
stebesplace

Well, if you gave the whole page code that would be good. i would say to add more px to the height, keep the width to 20px on both sides, remove all menu items unless you want them, and keep controls how they are. So. . .

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
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-394A-11d3-B153-00C04F79FAA6">
                   <param name="url" value="1.mp3">
                   <param name="autostart" value="1">
                   <param name="uiMode" value="mini">
                   <embed type="application/x-mplayer2"
                       name="wmtPlayer"
                       src="1.mp3"
                       autostart="1"
                       uimode="mini"
                       width=300 height=280>
                   </embed>
               </object>

</td></tr>
</table>
</body>
================================
ASKER CERTIFIED SOLUTION
Avatar of code404
code404

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
body style="margin:0" onload="top.window.focus();moveTo(0,0);">

<object style="margin:0" name="wmtPlayer" width="300" height="280"
                   classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
                   <param name="url" value="xxxx.wmv">
                   <param name="autostart" value="1">
                   <param name="uiMode" value="mini">
                   <embed type="application/x-mplayer2"
                       name="wmtPlayer"
                       src="xxxx.wmv"
                       autostart="1"
                       uimode="mini"
                       width=300 height=280>
                   </embed>
               </object>

</body>


Cd&