You can add the if into an else if and merge it with the one above, and add a final else that simply does the onPlay();