Seems like in iOS11, the document has no webkitHidden variable or something. This causes games in iPhones with iOS11 to keep playing sounds after the document is hidden and/or focus is shifted. This was working fine in iOS10.