Unity: 导出的视频文件在安卓上报错

10-17 16:35:38.537  8789  8883 W Unity   : AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-bafd6f5d8dd2a5652b198892e30ac187/CAB-bafd6f5d8dd2a5652b198892e30ac187.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.
10-17 16:35:38.537  8789  8883 W Unity   :
10-17 16:35:38.537  8789  8883 W Unity   : (Filename: ./PlatformDependent/AndroidPlayer/Modules/Video/Private/AndroidVideoMedia.cpp Line: 327)
10-17 16:35:38.537  8789  8883 W Unity   :
10-17 16:35:38.537  8789  8883 W Unity   : AndroidVideoMedia: Error opening extractor: -10004
10-17 16:35:38.537  8789  8883 W Unity   :
10-17 16:35:38.537  8789  8883 W Unity   : (Filename: ./PlatformDependent/AndroidPlayer/Modules/Video/Private/AndroidVideoMedia.cpp Line: 471)
10-17 16:35:38.537  8789  8883 W Unity   :

该错误的原因是android进行了一次压缩,可以在导出的安卓工程中将那些导出的视频文件添加到noCompress中:
image.png

也可以在PlayerSetting设置中模板:
image.png

编辑该mainTemplate.gradle文件:
image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容