[LayaAirIDE 2.0]部分IOS机型在加载mp3音频文件时出错,资源加载异常
重现地址: http://192.168.1.193:8901/bin/index.html
在Laya 2.1.0 IDE中, 游戏初始化的时候加载了图片和音频资源,加载方式如下:
var resArray: Array<any> = [
{ url: "res/atlas/Images.atlas", type: Laya.Loader.ATLAS },
{ url: "Images/BG_Gray.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindow.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindowIn.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindowOut.png", type: Laya.Loader.IMAGE },
{ url: "res/Music/MouseClick.mp3", type: Laya.Loader.SOUND },
{ url: "res/Music/GameHall.mp3", type: Laya.Loader.SOUND },
{ url: "res/Music/Shoot.mp3", type: Laya.Loader.SOUND },
{ url: "res/Music/BeAttack.mp3", type: Laya.Loader.SOUND }
];
Laya.loader.load(resArray, Laya.Handler.create(this, () => { this.OnLoaded() }), null, Laya.Loader.ATLAS);
}在IOS部分机型,如苹果8上,会出现资源加载出错,截图如附件一所示。
Load(): void {
var resArray: Array<any> = [
{ url: "res/atlas/Images.atlas", type: Laya.Loader.ATLAS },
{ url: "Images/BG_Gray.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindow.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindowIn.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindowOut.png", type: Laya.Loader.IMAGE },
// { url: "res/Music/MouseClick.mp3", type: Laya.Loader.SOUND },
// { url: "res/Music/GameHall.mp3", type: Laya.Loader.SOUND },
// { url: "res/Music/Shoot.mp3", type: Laya.Loader.SOUND },
// { url: "res/Music/BeAttack.mp3", type: Laya.Loader.SOUND }
];
Laya.loader.load(resArray, Laya.Handler.create(this, () => { this.OnLoaded() }), null, Laya.Loader.ATLAS);
}
当我将音频资源注释掉之后,可以正常加载和显示。
重现demo见附件二 附件二上传不上来:https://pan.baidu.com/s/1xNcT-LaM_b0vykl_Or5O9A 见连接地址
在Laya 2.1.0 IDE中, 游戏初始化的时候加载了图片和音频资源,加载方式如下:
var resArray: Array<any> = [
{ url: "res/atlas/Images.atlas", type: Laya.Loader.ATLAS },
{ url: "Images/BG_Gray.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindow.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindowIn.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindowOut.png", type: Laya.Loader.IMAGE },
{ url: "res/Music/MouseClick.mp3", type: Laya.Loader.SOUND },
{ url: "res/Music/GameHall.mp3", type: Laya.Loader.SOUND },
{ url: "res/Music/Shoot.mp3", type: Laya.Loader.SOUND },
{ url: "res/Music/BeAttack.mp3", type: Laya.Loader.SOUND }
];
Laya.loader.load(resArray, Laya.Handler.create(this, () => { this.OnLoaded() }), null, Laya.Loader.ATLAS);
}在IOS部分机型,如苹果8上,会出现资源加载出错,截图如附件一所示。
Load(): void {
var resArray: Array<any> = [
{ url: "res/atlas/Images.atlas", type: Laya.Loader.ATLAS },
{ url: "Images/BG_Gray.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindow.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindowIn.png", type: Laya.Loader.IMAGE },
{ url: "Images/BG_PopWindowOut.png", type: Laya.Loader.IMAGE },
// { url: "res/Music/MouseClick.mp3", type: Laya.Loader.SOUND },
// { url: "res/Music/GameHall.mp3", type: Laya.Loader.SOUND },
// { url: "res/Music/Shoot.mp3", type: Laya.Loader.SOUND },
// { url: "res/Music/BeAttack.mp3", type: Laya.Loader.SOUND }
];
Laya.loader.load(resArray, Laya.Handler.create(this, () => { this.OnLoaded() }), null, Laya.Loader.ATLAS);
}
当我将音频资源注释掉之后,可以正常加载和显示。
重现demo见附件二 附件二上传不上来:https://pan.baidu.com/s/1xNcT-LaM_b0vykl_Or5O9A 见连接地址
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复