Created
February 15, 2019 07:32
-
-
Save teocci/7e226f5b8ac085ae0ebe4de5306d1ffc to your computer and use it in GitHub Desktop.
AndroidManifest.xml intent filter for YouTube videos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest> | |
<application> | |
<activity android:name="com.example.MainActivity"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data android:scheme="http" android:host="www.youtube.com" android:pathPrefix="/watch" /> | |
<data android:scheme="https" android:host="www.youtube.com" android:pathPrefix="/watch" /> | |
<data android:scheme="http" android:host="youtube.com" android:pathPrefix="/watch" /> | |
<data android:scheme="https" android:host="youtube.com" android:pathPrefix="/watch" /> | |
</intent-filter> | |
<!-- separate intent-filter to avoid host/pathPrefix "bleeding" --> | |
<!-- https://stackoverflow.com/questions/31002909/android-deeplink-pathprefix-attribute-is-being-ignored --> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data android:scheme="http" android:host="youtu.be" /> | |
<data android:scheme="https" android:host="youtu.be" /> | |
</intent-filter> | |
</activity> | |
</application> | |
</manifest> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment