Implementation of playOnce function.