Android应用程序和视频流 [英] Android application and video streaming
本文介绍了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();
}
}
- 如果你想创建自己的媒体播放器。的这是一个很好的例子
与源$ C $ C。
- 这是一个发展的GUID的MediaPlayer 。它还将支持
流。 - If you want to create your own media player. Here is a good example
with source code.
- Here is a development Guid for MediaPlayer. It will also support streaming.
这篇关于Android应用程序和视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文