[]苹果手机来回关闭背景音乐以后会出现报错[已解决]

背景音乐无论是否一开始自动播放,在中间来回开关以后,出现这个报错,并且后续都不能再播放
音乐的切换我是通过点击事件触发的
Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
 
链接http://m.danlu.net/u/kezhiyu/game/4898/
我不是用官方编辑器写的。
已邀请:

kezhiyu

赞同来自:

真的是巨坑。。
Laya.SoundManager.autoReleaseSound 默认是true
会自动释放资源。那一次获取的时候就不再 loadedMap里面
特此标注。

kezhiyu

赞同来自:

设置Laya.SoundManager.autoReleaseSound = false 解决问题
关闭该贴

要回复问题请先

商务合作
商务合作