【问题标题】:I want my application's user to play every video with MyVideoPLayer我希望我的应用程序的用户使用 MyVideoPLayer 播放每个视频
【发布时间】:2012-12-13 12:22:55
【问题描述】:

我开发了一个运行良好的视频播放器。现在我希望用户用它播放每首歌。我的意思是每当用户单击视频文件时,它都应该使用my video player 播放,或者如何将 我的视频播放器 添加到单击视频文件时出现的警报对话框中?

【问题讨论】:

    标签: java android file-permissions


    【解决方案1】:

    将以下意图过滤器添加到您的视频播放器活动中:

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

    这会将您的应用添加到可以从互联网播放视频和 RTSP 流的应用列表中(如果您不想支持流式传输,请删除第一个过滤器)。

    【讨论】:

    • 谢谢拉加夫。它可以工作,但还有一个问题....我使用路径在我的视频播放器中播放特定视频文件...当我们单击可以通过 nullpointerexceptoin 播放视频的应用程序列表时...我们如何可以通过点击获取路径来播放文件?????????
    猜你喜欢
    • 1970-01-01
    • 2016-08-29
    • 2012-11-05
    • 1970-01-01
    • 2011-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多