Jump to content

'OBJECT' player code does not validate. (attribute that does not exist)


jasonc

Recommended Posts

What is the correct method to code this so there are no errors ?

 

<OBJECT ID="MediaPlayer" WIDTH="300" HEIGHT="300" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="Video.wmv">
<PARAM name="autostart" VALUE="false">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="true">
<PARAM name="ShowDisplay" VALUE="ture">
<EMBED TYPE="application/x-mplayer2" SRC="Video.wmv" NAME="MediaPlayer" WIDTH="300" HEIGHT="300" ShowControls="1" ShowStatusBar="1" ShowDisplay="1" autostart="0"> </EMBED>
</OBJECT>

Link to post
Share on other sites

Theres a couple reasons why this doesnt validate.

 

1. If the Doctype is XHTML, the element and attributes must be lowercase. Also all tags need to be closed, meaning that the param tags need to be self-closed. This is standard xml.

2. Do a search on using the embed tag. The embed tag will never validate however there are many workarounds, some fairly straightforward, some not so much.

 

Try this, it should validate XHTML 1.0 Strict:

 

<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" 
  id="MediaPlayer" standby="Loading Windows Media Player components..." width="300" height="300">
  <PARAM NAME="url" value="Video.wmv" />
  <param name="src" value="Video.wmv" />
  <param name="showcontrols" value="true" />
  <param name="autostart" value="false" />
  <!--[if !IE]>-->
  <object type="video/x-ms-wmv" data="Video.wmv" width="300" height="300">
    <param name="src" value="Video.wmv" />
    <param name="autostart" value="false" />
    <param name="controller" value="true" />
  </object>
  <!--<![endif]-->
</object>

Link to post
Share on other sites

Thank you for this answer, did the trick in solving the validation problems.

 

cheers

 

 

Theres a couple reasons why this doesnt validate.

 

1. If the Doctype is XHTML, the element and attributes must be lowercase. Also all tags need to be closed, meaning that the param tags need to be self-closed. This is standard xml.

2. Do a search on using the embed tag. The embed tag will never validate however there are many workarounds, some fairly straightforward, some not so much.

 

Try this, it should validate XHTML 1.0 Strict:

 

<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" 
  id="MediaPlayer" standby="Loading Windows Media Player components..." width="300" height="300">
  <PARAM NAME="url" value="Video.wmv" />
  <param name="src" value="Video.wmv" />
  <param name="showcontrols" value="true" />
  <param name="autostart" value="false" />
  <!--[if !IE]>-->
  <object type="video/x-ms-wmv" data="Video.wmv" width="300" height="300">
    <param name="src" value="Video.wmv" />
    <param name="autostart" value="false" />
    <param name="controller" value="true" />
  </object>
  <!--<![endif]-->
</object>

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.