SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Embed Tag - Should I...

    Hi, i am working on a site at the moment and i need to use the <embed> tag for YouTube videos, rather than <object> or <iframe> as both <object> or <iframe> are causing conflicts with other scripts when i view my site on an iphone or ipad.

    A - is the <embed> tag ok to you use

    B - which is newer <embed> or <object>

    Thanks in advance for your help...

  2. #2
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,389
    Mentioned
    218 Post(s)
    Tagged
    5 Thread(s)
    Does this answer your question?
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent, cool, thanks... so is <embed> a new tag that is in html 5

  4. #4
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,389
    Mentioned
    218 Post(s)
    Tagged
    5 Thread(s)
    As the reference says, it's an old, non-standard tag which has been around for some time. It has never been part of an official HTML specification, but looks set to be included in HTML5 - which has not yet been finalised.
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  5. #5
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks... that's where i got confused... said it never made the standard... yet it's been included in HTML5

  6. #6
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It only gets mentioned in 5 (descriptive rather than proscriptive) because they documented all sorts of propriety tags just because people were abusing them. Even they possibly recommend against using that element nowadays since MS now supports OBJECT, which provides fallback, a lot better that it used to do.

    It's basically because HTML5 took the weird decision if more than one browser vendor supported a previously completely imaginary tag then they'd consider introducing and creating one... Hence why you get such stupidity as NOEMBED and BLINK mentioned but not LAYER. >;-)

  7. #7
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, thanks... so which out of the 3 would you use if you were given the choice:

    - <embed>
    - <object>
    - <iframe>

  8. #8
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,389
    Mentioned
    218 Post(s)
    Tagged
    5 Thread(s)
    <object>
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  9. #9
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's the <object>ive of using <object> over <embed> (see what i done there... :-)

    As soon as i changed my videos to <embed> tag... i got a different toolbar at the top of the video, which seems a newer...

  10. #10
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,389
    Mentioned
    218 Post(s)
    Tagged
    5 Thread(s)
    If your question meant
    which out of the 3 would you use to insert a YouTube video
    then the answer is, I've never had a need to do that specifically, but I would go for <object> because that's the tag I would normally choose. <embed> is non-standard before HTML5, which I'm not using, so I would avoid it.

    That's just my preferred method. If <embed> is working better for you, then stick with it. As far as I know, it's well-supported, despite being non-standard.
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  11. #11
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oo7ml View Post
    Hi, i am working on a site at the moment and i need to use the <embed> tag for YouTube videos, rather than <object> or <iframe> as both <object> or <iframe> are causing conflicts with other scripts when i view my site on an iphone or ipad.
    What scripts? How does it conflict?

    <iframe> is the recommended Youtube embedding code, as I understand it, as it allows them to use either Flash or <video> without you changing your code (plus it's safer since you don't give Youtube permission to run scripts in your origin).
    Simon Pieters


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •