Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to invoke YouTube Application from My WebApp

I am coding a web application (a mobile website) which will be accessed by various smartphones, like Androids, iPhones and BlackBerry.

One of my page is going to have a link to a youtube video. I am not sure how to put a link to it in such a way that the device browser opens the device's youtube application and plays the video.

Can you guys provide any help specific to Android, iPhone and BlackBerry!?

Thanks in advance! :)

like image 469
Aman Alam Avatar asked Mar 16 '11 06:03

Aman Alam


2 Answers

I researched a lot and found that there's such a solution for Android phones.

If I write the youtube URL as vnd.youtube:<video_id> inside my html, then Android will parse this link's click as YouTube related action and will invoke youtube application. the best part is, after the video ends or the user cancels the playback, the control returns to the webpage, which is awesome.

I was trying to find something similar for iPhone too, but later realised that iPhone doesn't have multi-tasking ability, and if I could even find something similar, iPhone will always first close the webpage, and will then open the youtube app to play the video. This way, the youtube application takes over and control is never returned to my webpage, which is according to me a bad UX, but iPhone users see it as a normal thing.

I can't embed a video inside my webpage since there are no requirements like this, else I would have done what @Zaky has suggested, still, I am looking into the links provided by him to find something useful.

I still have to see how BlackBerry devices and the new iOS4 responds to youtube events and links.

Will post updates.

UPDATE : To do the same for iPhone (iOS), use the URL: youtube:<video_id> and it will parse it as the youtube application URL

like image 52
Aman Alam Avatar answered Oct 17 '22 21:10

Aman Alam


Specifically to iPhone i used this one recently, check the second one about the UIWebView, should work similarly from the browser: http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html

And this one seems to be more general: http://www.labnol.org/internet/embed-youtube-videos-in-html5-flash/14092/

like image 1
Zaky German Avatar answered Oct 17 '22 23:10

Zaky German