Android:使用默认播放器播放.AVI视频文件



可能的重复:
播放视频的Android意图?

如何使用默认播放器播放.AVI视频文件。

Intent intent = new Intent(MediaStore.INTENT_ACTION_MUSIC_PLAYER);
File file = new File(arrGetVideoList.get(position));
intent.setDataAndType(Uri.fromFile(file), " video/*");
startActivity(intent);

ArgenGetVideolist是一个ArrayList包含视频路径。

任何人都可以帮助我。

这对我有用。

Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse(Environment.getExternalStorageDirectory()
    .getPath()
    + "/Test.avi");
intent.setDataAndType(data, "video/avi");
startActivity(intent);

您无法使用Android上的默认播放器播放.avi文件。

您可以看一下http://developer.android.com/guide/appendix/media-formats.html,以查看Android上支持哪些格式

如果您确实需要播放与Android的支持者相比的其他格式,则应查看FFMPEG。

这是关于android上的Javacv/ffmpeg的一些有用链接:

http://code.google.com/p/javacv/source/browse/src/main/java/java/com/googlecode/javacv/http://stackoverflow.com/questions/13770376/playing-a-video-with-javacv-and-ffmpeg

希望我可以帮助:)

最新更新