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:
VIEW
intent with a vnd.youtube:VIDEO_ID
Uri, orIntent
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?
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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With