/** * Stops the OpenTok archive, if it is being recorded. * <p> * Archives automatically stop recording after 90 minutes or when all clients have * disconnected from the session being archived. * * @throws Exception\ArchiveException The archive is not being recorded. */ public function stop() { if ($this->isDeleted) { // TODO: throw an logic error about not being able to stop an archive thats deleted } $archiveData = $this->client->stopArchive($this->data['id']); try { Validators::validateArchiveData($archiveData); } catch (InvalidArgumentException $e) { throw new ArchiveUnexpectedValueException('The archive JSON returned after stopping was not valid', null, $e); } $this->data = $archiveData; return $this; }