Hamza
Hamza

Reputation: 2045

How to Send Intent To Youtube App with Search Query and then play first video

How to Send Intent To Youtube App with Search Query and then play first video From Search Result , In my app i need to send intent to youtube with search Query and then play First video Automatically once search Query is done , like google now is work with youtube

i send intent with Search Query it work fine, and Youtube show me search Results but now i want play First video from search Results Automatically

this is my code to send intent to youtube

  Intent intent = new Intent(Intent.ACTION_SEARCH);
            intent.setPackage("com.google.android.youtube");
            intent.putExtra("query", matches.get(0));
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);

Upvotes: 1

Views: 1339

Answers (1)

Andrii Omelchenko
Andrii Omelchenko

Reputation: 13343

It seems impossible by using Intent (without using YouTube api). Take a look at this answer.

Upvotes: 1

Related Questions