locked
Which tag should I use instead of <embed> while inserting a Google Video in my web page considering that HTML 4.01 does not allow <embed> and <object> tag has its own limitations? RRS feed

  • Question

  • I have used the following code in EW4 though I did not write it myself: 

    <embed id="VideoPlayback" allowfullscreen="true" allowscriptaccess="always" src="http://video.google.com/googleplayer.swf?docid=7145554833784054171&amp;hl=en&amp;fs=true" style="width: 400px; height: 326px" type="application/x-shockwave-flash"></embed>

    EW4 Compatibility checker tells me that in XHTML 1.0 Transitional the tag <embed> is not permitted.

    I searched for "embed" in w3schools.com and it told me that "Differences Between HTML 4.01 and HTML5 -- The <embed> tag is new in HTML5".

    I searched with a few differently structured keywords and finally found a page that talks about HTML <object> Tag with following riders:

    • The <object> tag is used to include objects such as images, audio, videos, Java applets, ActiveX, PDF, and Flash.
    • The object element was intended to replace the img and applet elements. However, because of bugs and a lack of browser support this has not happened.
    • The object support in browsers depend on the object type. Unfortunately, the major browsers use different codes to load the same object type.

    I am still not clear as to which tag I should use instead of <embed>?


    Thanks, M. R.
    Saturday, January 29, 2011 8:27 PM

Answers

  • Cheryl did not mean that you only had to change embed to SWFObject.  She was describing an alternate method.

    Frankly, this is one case where I'd just worry about what works in the browsers, rather than worry if your video markup is compatible with your doctype. 

    (The embed tag has certainly been around for a while; it's not new in HTML 5.  Being standard, on the other hand....)

    With the original markup, does your video play in all the browsers you support?  I believe you'll find it does, and if so, you may just want to leave it be.

    • Marked as answer by MR_2009 Sunday, January 30, 2011 12:17 AM
    Saturday, January 29, 2011 11:55 PM

All replies

  • <object> and javascript if you want the widest possible compatibility - SWFObject is most commonly used method.
    MS MVP Expression Tutorials & Help http://by-expression.com & Expression Web forums
    Saturday, January 29, 2011 9:36 PM
  • Thanks, Cheryl:

    I replaced "embed" by "SWFObject" but ew4 compatibility error persisted.

    I visited w3schools.com and queried for "SWFObject" and "<SWFObject> Tag" respectively and in both instances I was led to page http://www.w3schools.com/media/media_object.asp

    I tried to figure out if it provides some clue to how I may need to rewrite the code so no incompatibility with HTML 4.01 / XHTML 1.0 shows up but didn't succeed.

    As the original code as mentioned in OP was provided by Google under "Embed Video" I didn't want to take further chance with that code without knowing exactly what change I need to make in the code.

    Therefore, I am still in dark as to how to resolve the incompatibility error message?


    Thanks, M. R.
    Saturday, January 29, 2011 10:25 PM
  • Cheryl did not mean that you only had to change embed to SWFObject.  She was describing an alternate method.

    Frankly, this is one case where I'd just worry about what works in the browsers, rather than worry if your video markup is compatible with your doctype. 

    (The embed tag has certainly been around for a while; it's not new in HTML 5.  Being standard, on the other hand....)

    With the original markup, does your video play in all the browsers you support?  I believe you'll find it does, and if so, you may just want to leave it be.

    • Marked as answer by MR_2009 Sunday, January 30, 2011 12:17 AM
    Saturday, January 29, 2011 11:55 PM
  • Thanks, Kathy! This does tell me all I needed to know at the moment.
    Thanks, M. R.
    Sunday, January 30, 2011 12:21 AM