In addition to what cancerinform says, the direct cause of the error is that your playvideo function takes no arguments. But you are using it as an event listener, so it will be passed 1 argument, the event.