SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Embedding YouTube in XHTML?

    I've been rewriting one of my pages and when I try to put a YouTube video in my page it doesn't display properly in IE, although it looks fine in FireFox. Anyone know what's up with that? The page I'm working on is here:

    http://dangerouslyfun.com/index2.html

  2. #2
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would suggest using this cross browser code in replace of what you currently have:
    HTML Code:
    <object type="application/x-shockwave-flash"
     data="http://www.youtube.com/v/knKDLhgeOwM" height="350"
     width="425"><param name="movie"
     value="http://www.youtube.com/v/knKDLhgeOwM" /></object>
    That should do it.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm...it still isn't working. This is what it looks like when I open it in IE:


  4. #4
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does this also stall for you (it is my suggested code and nothing else)? It shouldn't.

    The Flash player for Linux is not so hot and I run IE 6 under WINE. Nonetheless, the video still plays all the way through like a charm.

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, it does. That's weird. I always use Firefox so I guess I just haven't noticed it until now.

  6. #6
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by volare
    Actually, it does. That's weird. I always use Firefox so I guess I just haven't noticed it until now.
    It does or doesn't "work" for you in IE (my link)?

    BTW - your page (with the new code) works fine in IE 6 under WINE - played all the way through without a hiccup on Linux.

  7. #7
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It does not work.

  8. #8
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by volare
    It does not work.
    Well I am at a loss - you have some issue that is unique to your local machine.

    Instant message any friend with IE and it will work for them.

  9. #9
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess I'll have to work on fixing IE.

    May I ask, if the code you provided is superior, why doesn't YouTube provide it that way? (I'm not suggesting it isn't superior, I'm just curious what YouTube is up to.)

  10. #10
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by volare
    I guess I'll have to work on fixing IE.

    May I ask, if the code you provided is superior, why doesn't YouTube provide it that way? (I'm not suggesting it isn't superior, I'm just curious what YouTube is up to.)
    It superior because it works just as well an involves less redundant non-standard code (which you can plainly see by comparing them side by side and running the each code snippet through a validator). It doesn't really much matter - though I prefer to get more from less. You can embed Google video the same way (using the code I outlined earlier), though Google also suggests less desirable code on their site - Google is not known for their perfect code by any means.
    Last edited by brandaggio; Oct 20, 2006 at 21:42.

  11. #11
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by volare
    May I ask, if the code you provided is superior, why doesn't YouTube provide it that way? (I'm not suggesting it isn't superior, I'm just curious what YouTube is up to.)
    Because old habits die hard. And bad ones die harder. The worst ones need to die hard with a vengeance.

    Not only that, but it's a relatively new technique that most people just either haven't heard of, or don't care about. "But it works for me" tends to be the common excuse. Refusing to upgrade a browser or operating may "work" for some but it doesn't mean it's right either.


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
  •