Added locks and MediaPlayer class