Android的 - 从扩展文件播放MP4视频文件 [英] Android - Playing mp4 video file from Expansion File

查看:257
本文介绍了Android的 - 从扩展文件播放MP4视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经遵循了测试一个扩展文件为我的应用程序的所有步骤。凡我现在坚持是如何发挥包含在扩展文件视频文件。

I have followed all the steps in testing an expansion file for my application. Where I am stuck now is how to play a video file contained in that expansion file.

我已经成功地能够从谷歌下载播放,我可以看到它,它应该是在当我通过我的文件管理器浏览文件夹中。

I have successfully been able to download it from Google Play and I can see it in the folder it is supposed to be in when I browse through my file manager.

我在试图找出如何播放该文件看了过去几天。此刻只有一个为,保持用于测试适当的大小。

I have looked for the past couple of days in trying to figure out how to play the file. At the moment there is only one for, to maintain appropriate size for testing.

我试图解析URI,并将其设置在videoview,但是,它总是显示该视频无法播放。

I have tried to parse the URI and set it in the videoview, however, it always shows that the video cannot be played.

我也试过这code迄今访问(如文档阅读,我已经与我的PARAMS取代PARAMS):

I have also tried this code so far to access it(As read in the docs and I have replaced the params with my params):

// Get a ZipResourceFile representing a merger of both the main and patch files
ZipResourceFile expansionFile = APKExpansionSupport.getAPKExpansionZipFile(appContext,
    mainVersion, patchVersion);

// Get an input stream for a known file inside the expansion file ZIPs
InputStream fileStream = expansionFile.getInputStream(pathToFileInsideZip);

但我不知道该怎么才能播放视频的输入流做的。

But I do not know what to do with the input stream in order to play the video.

任何帮助将是AP preciated。

Any help would be appreciated.

三江源。

推荐答案

使用提供商! (对我来说最好的解决方案)
我测试了它完美的作品。

Using a provider ! (best solution for me) I tested it works perfectly.

http://nullpointerexc.blogspot.fr/2014/05/android-read-media-file-from-obb-using.html

这篇关于Android的 - 从扩展文件播放MP4视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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