How to open a Youtube video link directly from android app?

Kapil Rajput

I want to play a Youtube Video on a click of a Button but getting action dialog window that I don't want to show, I want youtube video link should open directly on Youtube app on Button click rather than showing this choose action window :

enter image description here

How is it possible ? Any Suggestion please

code :

 playVideo.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.youtube.com/watch?v=bzSTpdcs-EI")));
        }
    });
Ravi

you can set package name of youtube application

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.youtube.com/watch?v=bzSTpdcs-EI"));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage("com.google.android.youtube");
startActivity(intent)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

how to open app from file manager and play video directly?

How to open an app from a link in an email on Android?

Open Chromecast youtube video from android application

Xamarin Android - How to select a video app to open from a URI?

How can open link from other Apps in my App in Android

Can Movies & TV app on Windows open a video from a link?

How can I get the link to YouTube Channel from Video Page?

How to open youtube video with youtube-dl

How to open Chrome App from web link

How to open a link from a notification to my app?

Video Upload to youtube from app

How to open Android app from a link without asking user to select between browser or app the first time

Flutter : open video in YouTube App in iOS version

Android app not visible when share link from youtube

Trying to open chrome app with a URL link from another android app

how to open app directly from deeplink without user intervention

How to open PDF file directly from URL in app chooser

Playing video from youtube link without UIWebView

Retrieve video ID from YouTube link

Show one video in webview by link from YouTube

Retrieve Video Stream from Youtube Link

“href” value in HTML to open video in youtube app or market (Google Play) on Android

How to open the Google Play Store directly from my Android application?

How to open the Amazon AppStore directly from my Android application?

Android App link - Open a url from app in browser without triggering App Link

How to open Youtube app from another app after clicking a button with a query searched in youtube?

Open link with facebook app in android

Open the youtube app from flutter app on iOS

How to get video tags from youtube video?