/** * 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 } $archiveJson = $this->client->stopArchive($this->json['id']); try { Validators::validateArchiveJson($archiveJson); } catch (InvalidArgumentException $e) { throw new ArchiveUnexpectedValueException('The archive JSON returned after stopping was not valid', null, $e); } $this->json = $archiveJson; return $this; }