public function exportState($pause = true) { if ($pause) { $state = $this->getState(); if ($state === self::STATE_PLAYING) { $this->pause(); } } $export = new ControllerState($this); if ($pause) { $export->state = $state; } return $export; }