Skip to content

Commit 116e62f

Browse files
Setting locked lag only if there are locked audio tags
1 parent eec19e1 commit 116e62f

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

src/sound/html5/HTML5AudioSoundManager.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,30 @@ var HTML5AudioSoundManager = new Class({
154154
*/
155155
unlock: function ()
156156
{
157-
this.locked = 'ontouchstart' in window;
157+
this.locked = false;
158+
159+
var _this = this;
160+
161+
this.game.cache.audio.entries.each(function (key, tags)
162+
{
163+
for (var i = 0; i < tags.length; i++)
164+
{
165+
if (tags[i].dataset.locked === 'true')
166+
{
167+
_this.locked = true;
168+
169+
return false;
170+
}
171+
}
172+
173+
return true;
174+
});
158175

159176
if(!this.locked)
160177
{
161178
return;
162179
}
163180

164-
var _this = this;
165-
166181
var moved = false;
167182

168183
var detectMove = function ()

0 commit comments

Comments
 (0)