如果出现以上错误(pc测试.exe,其它平台打包出后报错也差不多,修改这个脚本里对应的平台方法),检查打包目录xxxx_data/Plugins是否与下图目录一样
解决办法:打开UMPPostBuilds.cs脚本修改 public static void BuildWindowsPlayer64(string path, UMPSettings settings)这个方法
public static void BuildWindowsPlayer64(string path, UMPSettings settings)
{
string buildPath = Path.GetDirectoryName(path);
string dataPath = buildPath + "/" + Path.GetFileNameWithoutExtension(path) + "_Data";
if (!string.IsNullOrEmpty(buildPath))
{
if (!settings.UseExternalLibs)
{
CopyPlugins(settings.AssetPath + "/Plugins/Win/x86_64/plugins/", dataPath + "/Plugins/plugins/");
string[] files = Directory.GetFiles(dataPath + "/Plugins/x86_64/");
foreach (string str in files)
{
string file = Path.GetFileName(str);
Debug.LogError(file);
File.Copy(str, dataPath + "/Plugins/" + file);
}
Directory.Delete(dataPath + "/Plugins/x86_64/", true);
}
else
{
if (File.Exists(dataPath + "/Plugins/" + UMPSettings.LIB_VLC_NAME + ".dll"))
File.Delete(dataPath + "/Plugins/" + UMPSettings.LIB_VLC_NAME + ".dll");
if (File.Exists(dataPath + "/Plugins/" + UMPSettings.LIB_VLC_CORE_NAME + ".dll"))
File.Delete(dataPath + "/Plugins/" + UMPSettings.LIB_VLC_CORE_NAME + ".dll");
}
}
Debug.Log("Standalone Windows (x86_x64) build is completed: " + path);
}
应该就可以了,我用的是ump2.0.2(已改为2.0.3),unity版本2019.3
打包路径不要有中文
目前2.0.3也没有问题,我是用win7打包出来放在win10播放是没有问题的,而w10打包放在win7播放就会出现上述文件路径出错
还有一点如果不想卡死或者闪退的最好使用2.0.3版本,其他版本多次播放或者切换视频地址会出现闪退的问题
如果不考虑在win7上不放监控或者视屏,可以考虑使用AVPro Video这个插件
!!!如果没有修改它的配置文件以及路径设置,目录UniversalMediaPlayer一定要放在Asset目录下