I have a mobile website that links to a youtube video. On Android, clicking on this link brings up a dialog asking the user to "Complete action using" their browser or the Youtube app.
Is there a way to bypass this screen and just play the video in the Youtube app? (For example with a youtube:// URL.)
Thanks!
Go to "Settings > Apps > ⁝ > Default Apps > Set as Default > YouTube > Go to Supported URLs > In this app". Your phone may look different with options like "Opening Links" and "Open supported Links" instead. Tap those options to continue.
This behavior is because the YouTube app for Android is the default and specialized application for detection of YouTube links playing YouTube videos. Some users might not like this behavior of being forced to use the YouTube app for watching YouTube Videos and might want to use a web browser instead.
Try to use a JavaScript redirection like the following:
window.location = "vnd.youtube://the.youtube.video.url";
More comprehensively:
if( /Android/i.test(navigator.userAgent ) ) {
// If the user is using an Android device.
setTimeout(function () { window.location = "market://details?id=com.google.android.youtube"; }, 25);
window.location = "vnd.youtube://www.youtube.com/watch?v=yourVideoId";
}
If Youtube app is disabled, the timeout function will redirect you to the youtube app on the play store to let you enable the app. The second redirect will pop up and play the youtube video on Android Youtube app.
If you are already switched to the YouTube app within the timeout interval, the timeout function will not be called and you are not switched to the play store but stay in the YouTube app.
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