The variable "canPlayFired" is undefined because it's declared as "canplayFired". When everything is ok the "canPlayFired" variable will be created (globally!) when the "canplay" event fires and the problem is not noticed. But if "canplay" hasn't been fired before "play", an exception will be thrown when asserting the value of "canPlayFired".
The variable "canPlayFired" is undefined because it's declared as "canplayFired". When everything is ok the "canPlayFired" variable will be created (globally!) when the "canplay" event fires and the problem is not noticed. But if "canplay" hasn't been fired before "play", an exception will be thrown when asserting the value of "canPlayFired".