Stop playback and recording on View close