jasonc Posted October 27, 2010 Share Posted October 27, 2010 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> Quote Link to comment Share on other sites More sharing options...
mjc302 Posted October 30, 2010 Share Posted October 30, 2010 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> Quote Link to comment Share on other sites More sharing options...
haku Posted October 30, 2010 Share Posted October 30, 2010 Personally, I use SWFObject to embed flash. It's cross-browser compatible and validates. Quote Link to comment Share on other sites More sharing options...
jasonc Posted October 30, 2010 Author Share Posted October 30, 2010 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.