[]小游戏环境下 声音的缓存机制导致更换声音文件失败
在wxmini中关于声音的管理
__proto.load = function (url) {
url = URL.formatURL(url);
this.url = url;
this.readyUrl = url;
if (MiniSound._audioCache[this.readyUrl]) {
this.event(/*laya.events.Event.COMPLETE*/"complete");
return;
}
console.log(url);
if (MiniAdpter.autoCacheFile && MiniFileMgr.getFileInfo(url)) {
console.log('from cacheFile');
this.onDownLoadCallBack(url, 0);
} else {
if (!MiniAdpter.autoCacheFile) {
this.onDownLoadCallBack(url, 0);
} else {
console.log('dow file');
MiniFileMgr.downOtherFiles(url, Handler.create(this, this.onDownLoadCallBack, [url]), url);
}
}
}
MiniFileMgr.getFileInfo = function (fileUrl) {
var fileNativePath = fileUrl.split("?")[0];
var fileObj = MiniFileMgr.filesListObj[fileNativePath];
if (fileObj == null)
return null;
else
return fileObj;
return null;
}
getFileInfo 忽略?之后的版本号,导致版号失效
__proto.load = function (url) {
url = URL.formatURL(url);
this.url = url;
this.readyUrl = url;
if (MiniSound._audioCache[this.readyUrl]) {
this.event(/*laya.events.Event.COMPLETE*/"complete");
return;
}
console.log(url);
if (MiniAdpter.autoCacheFile && MiniFileMgr.getFileInfo(url)) {
console.log('from cacheFile');
this.onDownLoadCallBack(url, 0);
} else {
if (!MiniAdpter.autoCacheFile) {
this.onDownLoadCallBack(url, 0);
} else {
console.log('dow file');
MiniFileMgr.downOtherFiles(url, Handler.create(this, this.onDownLoadCallBack, [url]), url);
}
}
}
MiniFileMgr.getFileInfo = function (fileUrl) {
var fileNativePath = fileUrl.split("?")[0];
var fileObj = MiniFileMgr.filesListObj[fileNativePath];
if (fileObj == null)
return null;
else
return fileObj;
return null;
}
getFileInfo 忽略?之后的版本号,导致版号失效
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Laya_XSN
赞同来自: