Forum Moderators: open
I have just joined the Forum. So I hope this question has not come up before. If so I Apologise.
My question:
I have just completed my first site in xhtml/css and all my pages validate with w3c except one. On this page I stream 1 audio file and use the object tag and the embed tag for cross browser use. I know the embed tag is deprecated now but how else can I make this cross browser and keep to xhtml. As a newbie I want to write correct code but also I want people with different browsers that IE to view it.
I would be grateful for your help. Here is my code:
<div id="mp1">
<object id="mediaplayer1" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701" standby="Loading Microsoft Windows® Media Player components..." type="application/x-oleobject" width="280" height="46">
<param name="fileName" value="http://www.sscityofcairo.co.uk/music.m3u" />
<param name="animationatStart" value="true" />
<param name="transparentatStart" value="true" />
<param name="autoStart" value="true" />
<param name="showControls" value="true" />
<param name="volume" value="-300" />
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/mediaplayer/" src="http://www.sscityofcairo.co.uk/music.m3u" name="MediaPlayer1" width="280" height="46" autostart="true" autoplay="true" volume="-300"></embed>
</object>
</div>
Thanks in advance
Hugh
Line 122, column 20: there is no attribute "type"
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.c
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.
Line 122, column 57: there is no attribute "pluginspage"
..."application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/mediap
Line 122, column 109: there is no attribute "src"
...rosoft.com/windows/mediaplayer/" src="http://www.sscityofcairo.co.uk/music.m3
Line 122, column 157: there is no attribute "name"
....sscityofcairo.co.uk/music.m3u" name="MediaPlayer1" width="280" height="46" a
Line 122, column 178: there is no attribute "width"
...music.m3u" name="MediaPlayer1" width="280" height="46" autostart="true" autop
Line 122, column 191: there is no attribute "height"
...me="MediaPlayer1" width="280" height="46" autostart="true" autoplay="true" vo
Line 122, column 206: there is no attribute "autostart"
...1" width="280" height="46" autostart="true" autoplay="true" volume="-300"></e
Line 122, column 222: there is no attribute "autoplay"
...eight="46" autostart="true" autoplay="true" volume="-300"></embed>
Line 122, column 236: there is no attribute "volume"
...ostart="true" autoplay="true" volume="-300"></embed>
Line 122, column 242: element "embed" undefined
...="true" autoplay="true" volume="-300"></embed>
hope that helps you to help me. Thanks for your time.
Hugh
embed which is not part of any recognised standard. However, you need to keep the embed to ensure full functionality (in IE only, obviously). You can attempt to fake validation by wrapping the control within IE conditional comments, but in this case I would simply leave it as it is: you will gain no benefit from messing with the markup and you don't want to trade functionality for validation.
I would second the opinion that using Active-X is not a good idea, as numbers of alternative browsers such as Firefox are increasing, and the Active-X won't work on alternative platforms (Linux, Mac) either.
<added>You posted at the same time: there are ten errors listed, but in fact there is only one: that
embed is not recognized (hence the attributes within it aren't either).</added> [edited by: encyclo at 4:02 pm (utc) on May 18, 2005]
As I have said already, I am very new to this and I am trying to do the right thing with regard to coding for all rather than just IE.
Regarding active-x. I take that onboard but can I ask you what you would put in its place? Are you suggesting that I make audio available to the others and leave MS IE out. I know lots of people prefer to work in other browsers and platforms but if you want to promote your site to the majority then I cannot leave out IE.
Basically I would like this audio to be available to all and also be xhtml compliant. Easier said than done me thinks.