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 ?

LVL 1
Teehee99Asked:
Who is Participating?
 
code404Connect With a Mentor Commented:
Another suggestion ;)
The player should fit up tight to the top of the window.

In your body tag add this before the onload
marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" onload="top.window.focus();moveTo(0,0);">
<div align="center">
<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>
</div>
</body>

Hope this helps!
code404
0
 
stebesplaceCommented:
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
0
 
amitabhraiCommented:
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>
================================
0
 
COBOLdinosaurCommented:
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&
0
All Courses

From novice to tech pro — start learning today.