Implemented saving of playback state.