Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use vnd.youtube:videoID?

While playing around with the emulator, I noticed that when trying to view a YouTube video the browser gives an error saying it can not load the page at vnd.youtube:ngc978y6rCU?some=parameters. I don't have an Android device, but by this I can suppose that launching a VIEW intent with the data URI set to vnd.youtube:VIDEO_ID would launch the default YouTube application and watch that video.

Now, my application has to be able to display YouTube videos. Right now I have a custom-made YouTube activity which does just that, but I'm thinking of:

  • Removing my custom activity and just launching a VIEW intent with a vnd.youtube:VIDEO_ID Uri, or
  • Testing whether that Intent is available and using it, or, if it's not available, using my custom activity.

Is this a good idea? Does this work at all (as I said I have no Android device, I'll just be borrowing one from a friend to test my final application)? Which way should I go?

like image 625
Felix Avatar asked Apr 20 '10 16:04

Felix


2 Answers

Test if an VIEW intent with data set to http://www.youtube.com/watch?v=xxx will work. It is possible for Android applications to hook like this. This would provide a better experience if the phone is somehow missing the Youtube app (and you don't want to rely in your custom player).

like image 66
alexanderblom Avatar answered Oct 20 '22 08:10

alexanderblom


It's up to you. You could use the Youtube Intent but since those details have never been released it could be changed and break your code.

like image 27
Robby Pond Avatar answered Oct 20 '22 08:10

Robby Pond