It's not the code. I've tested it on the following browsers and got different results:
On Firefox it plays just fine, every time.
On IE (11) it also plays fine, every time.
On Chrome, half of the time it plays fine (literally, if I refresh the page, every second time it doesn't work)
On Node-webkit it never works.
I simplified the code, just leaving 1 box, and still it doesn't work as it should. This is probably a bug either on C2's behalf, or Chrome (and on the chrome based node-webkit).