Mobile Safari and YouTube links/embedded

Discussion in 'iPod touch' started by Zeromus, Oct 2, 2007.

  1. Zeromus macrumors member

    Zeromus

    Joined:
    Sep 5, 2005
    #1
    Quick question to all you iPod touch users (and iPhone users I presume).

    When you browse to a site that has YouTube links, how does Mobile Safari handle it? If you click on a link, does it launch the YouTube app? Does it just ignore them? How does it handle embedded YouTube clips?

    For example, could someone test this page:
    http://www.joystiq.com/2007/10/01/sin-and-punishment-and-smb-lost-levels-on-virtual-console/
    (just a random site with an embedded YouTube link)

    I'd be very interested to hear how the page renders. Extra points and a cookie for a screenshot. If it simply ignores it, are the bookmarklets round to launch the YouTube app?

    Thanks.
     
  2. phillipsm macrumors newbie

    Joined:
    Jun 2, 2007
    Location:
    Queensland, Australia
    #2
    Page looks great, all except the youtube part. It comes up as a lego block with a question mark (missing plug-in obviously). You can't click on it for YouTube or anything :(

    O Well, this thing still is the bes gadget I've owned :rolleyes:
     
  3. Zeromus thread starter macrumors member

    Zeromus

    Joined:
    Sep 5, 2005
    #3
    Hmmm, cool, thanks. I *swear* I read somewhere that it'll detect links to YouTube and open them in YouTube app.

    Could you tell me if when viewing this page with Mobile Safari, do any of the following links launch YouTube app?

    http://www.youtube.com/watch?v=hmxanWXvAgA
    http://www.youtube.com/v/hmxanWXvAgA

    If it is possible for Mobile Safari to launch YouTube.app, my aim is to write a bookmarklet that'll create links to launch embedded videos, the same way the "Open links in new window" bookmarklet works (from http://www.lifeclever.com/17-powerful-bookmarklets-for-your-iphone/ , try it, looks like it would work well)

    So, if anyone could give the above 2 links a go on a touch I'd be grateful. It would be handy for the many site I visit that love to post YouTube links.

    Cheers :)
     
  4. gloss macrumors 601

    gloss

    Joined:
    May 9, 2006
    Location:
    around/about
    #4
    It works with links fine, just not embedded video.
     
  5. Zeromus thread starter macrumors member

    Zeromus

    Joined:
    Sep 5, 2005
  6. clevin macrumors G3

    clevin

    Joined:
    Aug 6, 2006
    #6
  7. RumMunkey macrumors 6502a

    RumMunkey

    Joined:
    Nov 3, 2006
    Location:
    Canada
    #7
    I'm on my PowerBook right now, so I can't test, but earlier this week there was a thread here that linked to past Apple Ads on You Tube.

    I opened a few, and they opened in the full-screen you tube app on my touch, NOT via the You Tube html page.

    Maybe it's a hit & miss thing depending on how it's encoded?
     
  8. virus1 macrumors 65816

    virus1

    Joined:
    Jun 24, 2004
    Location:
    LOST
    #8
  9. gloss macrumors 601

    gloss

    Joined:
    May 9, 2006
    Location:
    around/about
    #9
    The entire YouTube library's not in h.264 yet.
     
  10. PowerFullMac macrumors 601

    PowerFullMac

    Joined:
    Oct 16, 2006
    #10
    Yeah, could be that or perhaps there is certain code you put in to the webpage to tell the iPod Touch to open it in the YouTube app?
     
  11. Zeromus thread starter macrumors member

    Zeromus

    Joined:
    Sep 5, 2005
    #11
    Thanks for all your replies. I whipped up this bookmarklet that should (hopefully) solve the problem.

    I can't seem to post it properly as a link, so you'll have to make it a bookmark yourself.

    Code:
    javascript:(function(){var%20object=document.getElementsByTagName('object');for(var%20i=0,j=object.length;i%3Cj;i++){var%20embed=object[i].getElementsByTagName('embed');for(var%20k=0,l=embed.length;k%3Cl;k++){searchString=embed[k].getAttribute('src').search("youtube.com");if(searchString){var%20na=document.createElement('a');na.setAttribute('href',embed[k].getAttribute('src'));var%20txt=document.createTextNode('[Launch%20in%20YouTube.app]');na.appendChild(txt);var%20li=document.createElement('li');li.appendChild(na);object[i].appendChild(li);}}}})();
    Try it on the page I posted above (http://www.joystiq.com/2007/10/01/sin-and-punishment-and-smb-lost-levels-on-virtual-console/) and also on a page with lots of YouTube videos, such as http://guitarherosoundtracks.com/

    What it will do is insert under each embedded video a [Launch in YouTube.app] link, which should launch the YouTube.app.

    This will only work if the video has been converted for use on iPhone/iPod on YouTube's end, but either way will allow you access embedded YouTube videos.

    I hope somebody can try this out and see if it works :)
     

Share This Page