Android Question [Solved] Open videos with my app?

Sasuke Sama

Active Member
Licensed User
Hi
Im using this code to open video files with my app from other apps like file managers or browsers
it works fine on android < 6
on android 6 and above my app dosent show with the open with dialoge
Hers the mainfist filter


B4X:
AddActivityText(Main,
        <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="rtsp" />
        </intent-filter>
        <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:mimeType="video/*" />
        </intent-filter>
                <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="https" />
            <data android:mimeType="video/*" />
        </intent-filter>
                <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="ftp" />
            <data android:mimeType="video/*" />
        </intent-filter>
                        <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="file" />
            <data android:mimeType="video/*" />
        </intent-filter>

        )
I know how to catch the video url so i only need to know how to make my app shows
Thank you
 

Sasuke Sama

Active Member
Licensed User
Please, describe exactly what trick helped
first put this code in the mainfest
B4X:
AddActivityText(Main,
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
    
            <data android:scheme="rtsp" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
        
            <data android:scheme="http" />
            <data android:mimeType="video/*" />
        </intent-filter>
                <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />

            <data android:scheme="https" />
            <data android:mimeType="video/*" />
        </intent-filter>
                <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />

            <data android:scheme="ftp" />
            <data android:mimeType="video/*" />
        </intent-filter>
                        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />

            <data android:scheme="file" />
            <data android:mimeType="video/*" />
        </intent-filter>

        )
now other apps should be able to see yours as a video plyer
in order to catch the video url sent from other apps use this code the yur main moudle
B4X:
    Dim In As Intent = Activity.GetStartingIntent
    Dim Parametri As String = In.GetData
the Parametri is where the url will be
 
Top