homepage Welcome to WebmasterWorld Guest from 54.226.191.80
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
XHTML/Audio
Cannot validate cross browser xhtml code
shug




msg:577582
 2:12 pm on May 18, 2005 (gmt 0)

Hello All,

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

 

John_Keates




msg:577583
 2:42 pm on May 18, 2005 (gmt 0)

This isn't the answer but, STOP using active-x or ms/ie only things!

It is not supported by the most browsers and the browsers that support it only run on windows.
Think of the other side.

John

BlobFisk




msg:577584
 3:34 pm on May 18, 2005 (gmt 0)

Welcome to WebmasterWorld, shug!

What error is the validator throwing? My guess is that it is the embed tag, which would throw an error like "element "EMBED" undefined"....

HTH

shug




msg:577585
 3:58 pm on May 18, 2005 (gmt 0)

Well there are unfortunately 10 errors:

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

encyclo




msg:577586
 4:01 pm on May 18, 2005 (gmt 0)

The problem is certainly with the
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]

BlobFisk




msg:577587
 4:02 pm on May 18, 2005 (gmt 0)

Yep, the validator is complaining about the non-standard
embedd tag. Unfortunately you need this tag for Mozilla browsers!
Robin_reala




msg:577588
 4:48 pm on May 18, 2005 (gmt 0)

You only need embed for NN4. Unfortunately you're using ActiveX with the object element which obviously Mozilla won't read. If you set up the object element correctly (i.e. no ActiveX) then it should play in everything that understands object and has a helper application installed, but I have no direct expereience in this.

shug




msg:577589
 7:33 pm on May 18, 2005 (gmt 0)

Firstly, Thank you all for taking the time to reply.

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved