Add loop and play-pause functionality