diff --git a/src/OpenTok/OpenTok.php b/src/OpenTok/OpenTok.php index b21ebc8..0fe0956 100644 --- a/src/OpenTok/OpenTok.php +++ b/src/OpenTok/OpenTok.php @@ -502,6 +502,14 @@ public function startArchive(string $sessionId, $options = []): Archive 'resolution' => null, 'streamMode' => StreamMode::AUTO, ); + if (isset($options['multiArchiveTag'])) { + $defaults['multiArchiveTag'] = $options['multiArchiveTag']; + Validators::validateArchiveMultiArchiveTag($defaults['multiArchiveTag']); + } + if (isset($options['layout'])) { + $defaults['layout'] = $options['layout']; + Validators::validateArchiveLayout($defaults['layout']); + } $options = array_merge($defaults, array_intersect_key($options, $defaults)); list($name, $hasVideo, $hasAudio, $outputMode, $resolution, $streamMode) = array_values($options); diff --git a/src/OpenTok/Util/Validators.php b/src/OpenTok/Util/Validators.php index 6607b45..0c104cf 100755 --- a/src/OpenTok/Util/Validators.php +++ b/src/OpenTok/Util/Validators.php @@ -204,6 +204,22 @@ public static function validateArchiveId($archiveId) ); } } + public static function validateArchiveMultiArchiveTag($multiArchiveTag) + { + if ($multiArchiveTag != null && !is_string($multiArchiveTag) /* TODO: length? */) { + throw new InvalidArgumentException( + 'The multiArchiveTag was not a string: ' . print_r($multiArchiveTag, true) + ); + } + } + public static function validateArchiveLayout($layout) + { + if ($layout != null && !is_array($layout)) { + throw new InvalidArgumentException( + 'The layout was not an array: ' . print_r($layout, true) + ); + } + } public static function validateArchiveData($archiveData) { if (!self::$archiveSchemaUri) {