Added code to pause playing when headphones are unplugged.