Add event support and add the new play() function to the API