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" /> 

1 Answer 1

7

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" /> 
Sign up to request clarification or add additional context in comments.

4 Comments

if I removed the dot between iphone and smil( iphone.smil) it works. I think the dot has something to do with it.
look at this : [stackoverflow.com/a/12153391/556975] . It shows how to handle such scenarios.
There's an extra dot on the second to last case, ..m3u8
8 years old but what should "This worked" mean? That the other above did not?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.