4

I want to make intent-filter which can detect urls like this one:

http://192.168.0.xx/playlist/_definst_/iphone.smil/list.m3u8?token=XXXXXXX

I tried this so far, but no luck.

    <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:host="*"
            android:pathPattern=".*\\*.m3u8.*"
            android:scheme="http" />
    </intent-filter>

What am I missing?
Need your help.
This worked for me. Hope it helps other too.

 <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\.m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\.m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\..*\\..m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\..*\\..*\\.m3u8" />
Lazy Ninja
  • 21,131
  • 9
  • 77
  • 99

1 Answers1

6

Try with this,

<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" />
    <data android:host="*" />
    <data android:mimeType="*/*" />
    <data android:pathPattern="*.*\\.m3u8" />
</intent-filter>

Or, with this

<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" />
    <data android:host="*" />
    <data android:pathPattern=".*\\.m3u8" />
</intent-filter>

This worked:

     <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\.m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\.m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\..*\\..m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\..*\\..*\\.m3u8" />
Lazy Ninja
  • 21,131
  • 9
  • 77
  • 99
Pratik Sharma
  • 12,825
  • 5
  • 24
  • 36