Jack McKalling Posted October 3, 2005 Share Posted October 3, 2005 Which one :)Html allowes both, Xhtml only <object>.New browsers use onle <object> in Xhtml, the nested <embed> would not regocnised. In Html old browsers, just the opposite :)I am confused Link to comment Share on other sites More sharing options...
F-Man Posted October 6, 2005 Share Posted October 6, 2005 It's quite simple; use object, and embed as well if you want veeeery old browsers to work and don't mind making your document invalid. Link to comment Share on other sites More sharing options...
WiCkEdStYlZ` Posted October 11, 2005 Share Posted October 11, 2005 ... or if you want... use a javascript, where if it's IE it will use the embed tag, if other browser use the object tag. If u wana give this a go, take it easy if it plays up as I'm new to javascript, but do this on a test page if ya want:place this javascript where you want the object to appear: <script type="text/javascript"> <!-- if (is_ie3up) { var object=('<embed src=\"movie.wmv\"></embed>') } else { var object=('') } //--> </script> now place your object html underneath or above that javascript... change the src= in the javascript, and add any attributes i.e. width, height e.t.c. but remember if you put a " in javascript it has to be backslashed \" and the same goes for / forward slases \/dont blame me if it doesnt work... and IF it doesn't, put them both into the document.just trying to keep valid markup here and practise newly found javascript skills. Link to comment Share on other sites More sharing options...
amorphic8 Posted February 2, 2006 Share Posted February 2, 2006 You would want the opposite, right? Only IE Windows uses the object with classid and codebase parameters. All other browsers use the non-standard <embed>.Using <object> to play movies on any Mac browser doesn't work, unless you give up using all possible control. In other words, plain vanilla QuickTime will play using the <object> properly, but if you want to include the VR controller for a QT VR file, for example, there's no valid way to do it.There is an article here on this site that discusses this matter, but has many inaccuracies. For example, this page http://www.w3schools.com/media/media_quicktime.aspwhen discussing the <embed> element, says it is used in browsers that don't understand <object>. That is simply not true. It is used by browsers that don't need the ActiveX component of the <object> code as it is displayed in the example.And the browser that does display the media, IE for Windows, doesn't properly implement the <object> element in the first place!! The codebase and classid attributes are for ActiveX (used ONLY in IE Windows).What browsers don't need the ActiveX control? Any browser that ISN'T IE Windows...(yes, that means even IE Mac doesn't need this code and will properly use <embed>).The problem is that the <embed> tag isn't valid XHTML; in fact, the w3c never officially recognized <embed>, yet it is RECOMMENDED by Apple for QuickTime, is included in the auto-generated HTML pages to contain Flash, and other media plug-ins recommend it with a series of attributes to use to get at the plug-in's unique capabilities. It is also prescribed for use (nested in the <object>) for QuickTime, RealPlayer, and WindowsMediaPlayer in Steve Mack's "Streaming Media Bible," for QuickTime in "QuickTime for the Web," 3rd Ed., and countless others.While one can argue that the books I just mentioned are both over 2 years old, there still isn't a better solution for ensuring that most browsers in use can render the content properly.Why the w3c has never offcially recognized <embed> has never revealed itself to me, therefore, I consider my pages, and those developed by the team working under me, as valid, just as long as the media performs as intended on the major browsers that we support. This site recommends using <object> only (http://www.w3schools.com/media/media_object.asp), and none of the examples work in any browser I tested that wasn't IE for Windows, except 'Picture as Object." When given the choice, I would rather fail the Valid XHTML Strict test than lose the browsing population using Macs and IE browsers other than the 'least standards compliant champion:' IE Windows.These examples all failed using: Firefox 1.5 (Mac/WinXP), Safari 2.0.3 (Mac only) and IE 5.2 (Mac).I think a much better evaluation of the situation can be found here: http://realdev1.realise.com/rossa/rendertest/quicktime.htmlIf anyone has better information, I would be happy to know about it.-------------------------------------------------------------------------- ... or if you want... use a javascript, where if it's IE it will use the embed tag, if other browser use the object tag. If u wana give this a go, take it easy if it plays up as I'm new to javascript, but do this on a test page if ya want:place this javascript where you want the object to appear:<script type="text/javascript"> <!-- if (is_ie3up)  { var object=('<embed src=\"movie.wmv\"></embed>') } else { var object=('') } //--> </script> now place your object html underneath or above that javascript... change the src= in the javascript, and add any attributes i.e. width, height e.t.c. but remember if you put a " in javascript it has to be backslashed \" and the same goes for / forward slases \/dont blame me if it doesnt work... and IF it doesn't, put them both into the document.just trying to keep valid markup here and practise newly found javascript skills. <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
amorphic8 Posted February 2, 2006 Share Posted February 2, 2006 "veeeery old browsers" has nothing to do with it. Firefox 1.5 (Mac/Win), Safari 2.0.3 (Mac), IE Mac 5.2, all modern browsers, none work with <object> only; all work fine when using <embed> (or the nested <object>...<embed></embed></object>)Of course, the 'GOTCHA" is code that doesn't validate XHTML strict, but it's better than catering only to IE Windows!! It's quite simple; use object, and embed as well if you want veeeery old browsers to work and don't mind making your document invalid.<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
Jack McKalling Posted February 2, 2006 Author Share Posted February 2, 2006 Thank you all, does anyone know if W3C has changed the validness of any of these two elements?Or if there is a difference between Strict and Transitional with either object or embed? Link to comment Share on other sites More sharing options...
aspnetguy Posted February 2, 2006 Share Posted February 2, 2006 Here is an article about getting flash movies to work with only the <object>http://www.alistapart.com/articles/flashsatay/and this is one to get Quicktime movies to work with only <object>http://realdev1.realise.com/rossa/rendertest/quicktime.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now