Solved

How to eliminate the animation display in Windows Media Player

Posted on 2008-10-01
11
477 Views
Last Modified: 2013-12-07
I have successfully placed a Windows Media Player object in my web page but since I am using it to play an audio file instead of video, I would prefer that the video portion of the player, not display so that only the controls are visible.

I have reduced the height of the player from the standard 290px to 50px and that solves my problem using IEv7, but neither FireFox, Safari, or viewing the page on my iPhone, respect the smaller size player. Might someone know which parameter I need to change to eliminate the unneeded "video" portion of the object?
Thanks.
0
Comment
Question by:lepirtle
[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
  • 6
  • 5
11 Comments
 
LVL 14

Expert Comment

by:yessirnosir
ID: 22619590
I couldn't find any parameter that would do it, but found a workaround:  if you wrap your object in a div like this:  <div style="height:50px;width:auto;">   it seems to work in both IE and FF.
0
 

Author Comment

by:lepirtle
ID: 22619776
Hi yessirnosir,
Thanks for the quick response but I tried your suggestion and am still getting the same results.
0
 
LVL 14

Expert Comment

by:yessirnosir
ID: 22620786
Ok, I'm stumped.  Have attached a screen shot and the accompanying test code to show you why I thought I'd solved it:   I put some text before and after the WMP.  Originally it left white space equal to the size of the full video player before the second text line.  After adding the fixed height div, it brought the second text line right up below the WMP.  So I thought it was fixed.  But what I didn't notice is that the scroll bar on the right is active, which means Firefox thinks there is something bigger on the page, i.e. the full size player.   You can even see when the page load that it goes very briefly into full screen mode and then immediately collapses to the small size once it realizes it is playing an audio file.

I messed around with it some more and couldn't get any better result.  Maybe someone else will chime in to help.
<div> some text before </div>
<div style="height:46px;width:320px;">
<object id="MediaPlayer" height=46 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> 
<param name="Showcontrols" value="True"><param name="autoStart" value="False"><embed type="application/x-mplayer2" src="Bad Company - Bad Company - 160 kbps.mp3"></embed>
</object></div>
<div>some text after</div>

Open in new window

wmp-firefox.jpg
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:lepirtle
ID: 22624485
yessirnosir,
Thanks for the detail and screenshot.

Here is even more confusing information. I changed my code, per your instruction to add the div tags and, as I had written, the results were still the same, that is, I could not get FireFox or Safari to shrink the height of the media player. So this morning I returned my code to the way it was (without your div tag suggestions) and I mentioned the problem I am having to my wife and she brought up my page on her computer (another WIN XP machine also using FF 3.0.3) just to take a look, and on her machine the media player displays just the way I want it, that is hiding the "video display" portion of the player PLUS, GET THIS: the audio autostarts. Keep in mind that this is after I had removed your div tags so that the page is using the original code that I had written - not with your div tag suggestions - AND the "AutoStart" parameter is "False" (I have never made changes to that parameter). So now I am completely puzzled as to why/how the browser's handling the media player object is overriding the code that you and I have written.
0
 
LVL 14

Accepted Solution

by:
yessirnosir earned 500 total points
ID: 22625451
Success... (I hope!)... noticed that the "height" parameter shows up twice, and right now the second instance says "290".  Change to "50" and that seems to work.  

Have attached updated code below.  I actually changed the 50 to 45, which seemed to me to be a closer fit to the final size.  

Also, you can get rid of the javascript references in the header, and the </noscript> tag near the bottom, because both of those are orphans if you are not using the Javascript method to display the player.  And you really shouldn't wrap an object with a <p> tag -- better to use a <div>.  Code below.  Crossing my fingers that this looks the same on your machine as it does on mine!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>It's A Beautiful Day-White Bird</title>
 
</head>
 
<body bgcolor="#FFFF99" style="font-family:Arial, Helvetica, sans-serif">
<p align="center"><img src="whitebird.jpg" width="600" height="600" alt="It's A Beautiful Day" /></p>
<p align="center">Click the player button below to hear the White Bird track</p>
<div align="center">
 
<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="320" height="45" id="mediaplayer1" title="Windows Media Player">
  <param name="FileName" value="whitebird.mp3" />
  <param name="AutoStart" value="False" />
  <param name="ShowControls" value="True" />
  <param name="ShowStatusBar" value="True" />
  <param name="ShowDisplay" value="False" />
  <param name="AutoRewind" value="True" />
  <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
  src="whitebird.mp3" width="320" height="45" autostart="False" filename="whitebird.mp3" showcontrols="True" showstatusbar="True" showdisplay="True" autorewind="True"></embed>
</object>
 
</div>
</body>
</html>

Open in new window

0
 
LVL 14

Expert Comment

by:yessirnosir
ID: 22625495
re:  50 vs. 45, this may be browser dependent, because I just checked IE, and the 45 seems to chop off a bit of the player, while in Firefox the player has a different look and 45 is just fine.  May be better to go back to 50 because Firefox seems to adjust down to 45 a split second after displaying the full 50.
0
 

Author Comment

by:lepirtle
ID: 22625687
yessirnosir,
Thanks for pointing out my errors. I cleaned up my code as you suggested and your crossed fingers worked <g>: the player now looks the way that I want. The weird thing is that my wife's browser (same as mine: Windows XP and FF 3.0.3) still autoplays the audio but that is not a big problem, just a curiosity.

My hearty "Thanks" for all the help you have given me. I really appreciate it. Good Job!!

Lee
0
 
LVL 14

Expert Comment

by:yessirnosir
ID: 22625931
glad it worked!
I just googled that Firefox autostart problem and found a suggestion to use 1/0 instead of True/False.  So I changed the "False" to "0" in the test code, and it seems to work.
 
0
 

Author Comment

by:lepirtle
ID: 22626247
Hi yessirnosir,
You are very thorough.

I posted that change to the autostart parameters in my page and now both my FF AND my wife's FF respected it. So once again, thank you very, very much!
0
 
LVL 14

Expert Comment

by:yessirnosir
ID: 22626464
you're welcome...  I was just enjoying mellowing out to "White Bird" while I tried to figure it out!
0
 

Author Comment

by:lepirtle
ID: 22626800
yessirnosir,
I was talking to someone a couple of nights ago, who inquired about some of my favorite songs and I mentioned "White Bird". Since she was 20 years younger, she was unfamiliar with the song so I created that page for her to enjoy the pleasures of "good music". <g> Glad that it has a "mellowing" effect for you too.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

622 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