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 comment
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 comment
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 comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.