gpt4 book ai didi

android - 想从 android 中的 Assets 文件夹中播放 mp4 视频

转载 作者:行者123 更新时间:2023-11-29 02:16:19 25 4
gpt4 key购买 nike

我想播放 assets/raw 文件夹中的 mp4 视频。我可以从我的 SD 卡中成功播放 mp4 视频,但无法从 Assets 文件夹或原始文件夹中获取视频。

最佳答案

正如我所说 here ,如果数据被压缩,您的问题可能来自数据的大小:

Hi guys, If I remember well, I had the same kind of issue when loading stuff from the asset folder but with a database. It seems that the stuff in your asset folder can have 2 stats : compressed or not. If it is compressed, then you are allowed 1 Mo of memory to uncompress it, otherwise you will get this kind of exception. There are several bug reports about that because the documentation is not clear. So if you still want to to use your format, you have to either use an uncompressed version, or give an extension like .mp3 or .png to your file. I know it's a bit crazy but I load a database with a .mp3 extension and it works perfectly fine. This other solution is to package your application with a special option to tell it not to compress certain extension. But then you need to build your app manually and add "zip -0" option. The advantage of an uncompressed assest is that the phase of zip-align before publication of an application will align the data correctly so that when loaded in memory it can be directly mapped.

So, solutions :

  • change the extension of the file to .mp3 or .png and see if it works
  • build your app manually and use the zip-0 option

关于android - 想从 android 中的 Assets 文件夹中播放 mp4 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3536708/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com