Life cycle events used correctly to prevent crashes by releasing the
media player and setting isPlaying to 0 so that when the app restarts
variables are not in null states or playing states.