Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Zeromus

macrumors member
Original poster
Sep 5, 2005
54
0
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.
 

phillipsm

macrumors newbie
Jun 2, 2007
17
0
Queensland, Australia
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:
 

Zeromus

macrumors member
Original poster
Sep 5, 2005
54
0
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 :)
 

RumMunkey

macrumors 6502a
Nov 3, 2006
692
2
Canada
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?
 

Zeromus

macrumors member
Original poster
Sep 5, 2005
54
0
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 :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.