繁体   English   中英

如何在SD卡中播放从服务器下载的视频

[英]how to play video downloaded from server in SD-card

我有从服务器下载的文件并将其保存在DOWNLOAD文件夹中

我如何从Android的默认播放器中播放代码?

用肌动蛋白代码? 喜欢这个代码

Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "tarsnak.3gp")), "application/vnd.android.package-archive");
            startActivity(intent);

您正在设置'类型'错误。 使用以下代码。

Intent i = new Intent(Intent.ACTION_VIEW);                      
i.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "tarsnak.3gp")),"video/*");
startActivity(i); 

暂无
暂无

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

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