Android应用程序和视频流 [英] Android application and video streaming

查看:133
本文介绍了Android应用程序和视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上的AVI视频,我想我的用户应用程序可以看到它在流媒体。我能怎么做?谢谢

I have on my website an avi video and I would like that my users application could see it in streaming. How can I do? Thanks

推荐答案

您也可以通过下面的方法流启动外部视频播放。它会显示可用的视频播放器的列表,可以选择自己选择的任何球员。

You can also launch external Video player through following method for streaming. It will display a list of Available video players, can select any player of his own choice.

private static void executeIntentForplayVideo(String localPath,
        LTDCommonData ltdCommonData, final Context activity) {

    final Intent intent = new Intent();
    intent.setAction(android.content.Intent.ACTION_VIEW);
    // Stream from remote path
    intent.setDataAndType(Uri.parse(finalPath), "video/*");
    //play from sd-card
    // intent.setDataAndType(Uri.fromFile(file), "video/*");
    try {
        List<ResolveInfo> intents = activity.getPackageManager()
        .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (intents != null && intents.size() > 0) {

            activity.startActivity(intent);

        } else {
            Toast toast = Toast.makeText(activity,"Please download a video player" , Toast.LENGTH_SHORT);
            toast.show();

        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆