Add loop playback feature

I added a loop button in the playpanel and managed it in order to restart the playback at the end.