?
Solved

How to center embedded Media Player in pop-up window ?

Posted on 2003-02-21
4
Medium Priority
?
426 Views
Last Modified: 2008-01-16
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 ?

0
Comment
Question by:Teehee99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:stebesplace
ID: 7997007
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
 

Expert Comment

by:amitabhrai
ID: 7997027
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
 

Accepted Solution

by:
code404 earned 800 total points
ID: 7997240
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7998985
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

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question