[LayaAir 2.0]背景音乐文件太大 播放延迟
Laya 背景音乐太大 预加载 Laya.loader.load 音乐 Laya.SoundManager.playMusic 播放 会出现延迟效果
Laya.loader.load(['remote/music/' + this.soundUrl + '.mp3'], new Laya.Handler(this, () => {
this.store.isDemo = true;
Laya.Scene.open("scene/Home.scene")
}), new Laya.Handler(this, (value: number) => {
this._page = this.page
this.mask_value = value
EventMgr.eventManager.event(EventMgr.EVENT_LIST)
}), Laya.Loader.SOUND, 0, true, null, false)
})
public static playBackGroundMusic(url: string, start: number) {
if (soundMsg.isPlayingBgMusic) {
let path = "remote/music/" + url + '.mp3';
Laya.SoundManager.playMusic(path, 1, new Laya.Handler(this, () => { }), start)
}
}
Laya.loader.load(['remote/music/' + this.soundUrl + '.mp3'], new Laya.Handler(this, () => {
this.store.isDemo = true;
Laya.Scene.open("scene/Home.scene")
}), new Laya.Handler(this, (value: number) => {
this._page = this.page
this.mask_value = value
EventMgr.eventManager.event(EventMgr.EVENT_LIST)
}), Laya.Loader.SOUND, 0, true, null, false)
})
public static playBackGroundMusic(url: string, start: number) {
if (soundMsg.isPlayingBgMusic) {
let path = "remote/music/" + url + '.mp3';
Laya.SoundManager.playMusic(path, 1, new Laya.Handler(this, () => { }), start)
}
}
要回复问题请先登录
2 个回复
小杨จุ๊บ
赞同来自:
小杨จุ๊บ
赞同来自: