Added better error handling to the MediaPlayer class.