That logic for first play has always been kinda backwards, and I don't know why.

It starts as true, and is set to false once done.

I started to think of it as a "are we waiting for first play still", once first play is done, we can turn the flag off.

What we should really be doing is have a function variable for each state in onStateChange, and then we can change the function assigned to that variable. So in the case of firstPlay, it starts as one function, and one inside that function, sets the function variable to another.

Anyway, I'll reverse the logic to a more intuitive position.