简体   繁体   中英

I want my application's user to play every video with MyVideoPLayer

I had developed a video player which is working fine. Now i want from user to play every song with it. I mean whenever user clicks a video file, it should play with my video player or how can I add my video player to the alert dialog which appears when a video file is clicked?

Add the following intent-filters to your video player activity:

    <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" />
        <data android:mimeType="video/*" />
        <data android:mimeType="application/sdp" />
    </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>

This will add your app to the list of apps that can play Videos and RTSP streams from the internet (remove the first filter if you don't want to support streaming).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM