简体   繁体   English

如何播放mp4视频文件,android

[英]How to play mp4 video files, android

I tried the following code. 我尝试了以下代码。 But unable to play mp4 files using ACTION_VIEW. 但无法使用ACTION_VIEW播放mp4文件。 But I am able to play m4v files. 但是我可以播放m4v文件。 How to play mp4 files. 如何播放mp4文件。

            Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
            Uri data = Uri.parse(filePath);
            intent.setDataAndType(data, "video/*");
            startActivity(intent);

Thanks Sunil Kumar Sahoo 感谢Sunil Kumar Sahoo

I found the issue is with streaming of video file with certain file types. 我发现问题出在某些文件类型的视频文件流上。 http://developer.android.com/guide/appendix/media-formats.html http://developer.android.com/guide/appendix/media-formats.html

I found the alternate solution as to down fiel into sdcard and then play the file from SD-Card 我找到了另一种解决方案,例如将文件放入SD卡,然后从SD卡播放文件

Thanks Sunil Kumar Sahoo 感谢Sunil Kumar Sahoo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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