Reputation: 25163
I need a way for a user to choose a YouTube video.
Is there a way for a user to be in my application, push a button in my application, have them go into the YouTube application, have them choose a video in the YouTube application, then have them return to my application without the YouTube video starting, and returning with the UID of the YouTube video they chose?
I found this, but it only drops me into the YouTube application, I want to get out of the YouTube application before the video starts
Intent intent = new Intent(Intent.ACTION_SEARCH);
intent.setPackage("com.google.android.youtube");
intent.putExtra("query", "Android");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Advice on this would great.
Upvotes: 0
Views: 710
Reputation: 9794
I don't think that it possible but you can use youtube api for searching videos.
You can have a look at api documantation here:
https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters
For example, a request to the following URL searches for the second set of 10 recently uploaded videos matching the query term "football" but not matching the query term "soccer":
Upvotes: 1