Youtube link should be opened in youtube app from PHP website

Viewed 827

I am developing a PHP website. I want to insert YouTube link should be opened in YouTube application after clicked . If i click on the link , it opened in mobile browser not in mobile YouTube application and one bad thing is that users do not want to login again on browser that's why they close browser.

Suppose I have a channel link

and a Youtube video link https://www.youtube.com/watch?v=Htfw2s2oCvw - if I click from mobile device , open in mobile browser . How can I do in PHP website that Youtube links open in application (Youtube Android app )

Any PHP or HTML reference for that ?

2 Answers

Try this one

<a href="intent://Htfw2s2oCvw/#Intent;scheme=vnd.youtube;package=com.google.android.youtube;S.browser_fallback_url=market://details?id=com.google.android.youtube;end;">youtube or market</a>

The part you should edit is "intent://channel/channel-id"

So to redirect your youtube channel use this one

<a href="intent://channel/UCJJw4WZ9iMT8AOX-OCjOyQw/#Intent;scheme=vnd.youtube;package=com.google.android.youtube;S.browser_fallback_url=market://details?id=com.google.android.youtube;end;">youtube channel </a>
Related