From 64f4c3325bbf5282f0928bfecb948b8121f84cc4 Mon Sep 17 00:00:00 2001 From: Samuel Weirich <4281791+SamuelWei@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:25:30 +0100 Subject: [PATCH 1/2] Add support for downloadable and removable attribute --- src/Parameters/CreateMeetingParameters.php | 40 ++++++++++++++-------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/Parameters/CreateMeetingParameters.php b/src/Parameters/CreateMeetingParameters.php index 8e00d7ae..6f656b3d 100644 --- a/src/Parameters/CreateMeetingParameters.php +++ b/src/Parameters/CreateMeetingParameters.php @@ -248,7 +248,7 @@ class CreateMeetingParameters extends MetaParameters protected ?string $clientSettingsOverride = null; /** - * @var array + * @var array> */ private array $presentations = []; @@ -351,13 +351,14 @@ public function setGuestPolicyAlwaysAccept(): self return $this; } - public function addPresentation(string $nameOrUrl, ?string $content = null, ?string $filename = null): self + public function addPresentation(string $nameOrUrl, ?string $content = null, ?string $filename = null, ?bool $downloadable = null, ?bool $removable = null): self { - if (!$filename) { - $this->presentations[$nameOrUrl] = !$content ?: base64_encode($content); - } else { - $this->presentations[$nameOrUrl] = $filename; - } + $this->presentations[$nameOrUrl] = [ + 'filename' => $filename, + 'content' => !$content ?: base64_encode($content), + 'downloadable' => $downloadable, + 'removable' => $removable, + ]; return $this; } @@ -423,18 +424,27 @@ public function addPresentationsModule(SimpleXMLElementExtended $xml): void $module = $xml->addChild('module'); $module->addAttribute('name', 'presentation'); - foreach ($this->presentations as $nameOrUrl => $content) { + foreach ($this->presentations as $nameOrUrl => $data) { + $document = $module->addChild('document'); + if (str_starts_with($nameOrUrl, 'http')) { - $presentation = $module->addChild('document'); - $presentation->addAttribute('url', $nameOrUrl); - if (\is_string($content)) { - $presentation->addAttribute('filename', $content); - } + $document->addAttribute('url', $nameOrUrl); } else { - $document = $module->addChild('document'); $document->addAttribute('name', $nameOrUrl); /* @phpstan-ignore-next-line */ - $document[0] = $content; + $document[0] = $data['content']; + } + + if (isset($data['filename'])) { + $document->addAttribute('filename', $data['filename']); + } + + if (\is_bool($data['downloadable'])) { + $document->addAttribute('downloadable', $data['downloadable'] ? 'true' : 'false'); + } + + if (\is_bool($data['removable'])) { + $document->addAttribute('removable', $data['removable'] ? 'true' : 'false'); } } } From 46c210896dad1ff65c019a5e720743ef01221e3f Mon Sep 17 00:00:00 2001 From: Samuel Weirich <4281791+SamuelWei@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:27:19 +0100 Subject: [PATCH 2/2] Add support for embedded slides --- src/Parameters/InsertDocumentParameters.php | 31 ++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/Parameters/InsertDocumentParameters.php b/src/Parameters/InsertDocumentParameters.php index 538266e6..710635e2 100644 --- a/src/Parameters/InsertDocumentParameters.php +++ b/src/Parameters/InsertDocumentParameters.php @@ -34,10 +34,11 @@ public function __construct(protected string $meetingID) { } - public function addPresentation(string $url, string $filename, ?bool $downloadable = null, ?bool $removable = null): self + public function addPresentation(string $nameOrUrl, ?string $content = null, ?string $filename = null, ?bool $downloadable = null, ?bool $removable = null): self { - $this->presentations[$url] = [ + $this->presentations[$nameOrUrl] = [ 'filename' => $filename, + 'content' => !$content ?: base64_encode($content), 'downloadable' => $downloadable, 'removable' => $removable, ]; @@ -61,17 +62,27 @@ public function getPresentationsAsXML(): string|false $module = $xml->addChild('module'); $module->addAttribute('name', 'presentation'); - foreach ($this->presentations as $url => $content) { - $presentation = $module->addChild('document'); - $presentation->addAttribute('url', $url); - $presentation->addAttribute('filename', $content['filename']); + foreach ($this->presentations as $nameOrUrl => $data) { + $document = $module->addChild('document'); - if (\is_bool($content['downloadable'])) { - $presentation->addAttribute('downloadable', $content['downloadable'] ? 'true' : 'false'); + if (str_starts_with($nameOrUrl, 'http')) { + $document->addAttribute('url', $nameOrUrl); + } else { + $document->addAttribute('name', $nameOrUrl); + /* @phpstan-ignore-next-line */ + $document[0] = $data['content']; } - if (\is_bool($content['removable'])) { - $presentation->addAttribute('removable', $content['removable'] ? 'true' : 'false'); + if (isset($data['filename'])) { + $document->addAttribute('filename', $data['filename']); + } + + if (\is_bool($data['downloadable'])) { + $document->addAttribute('downloadable', $data['downloadable'] ? 'true' : 'false'); + } + + if (\is_bool($data['removable'])) { + $document->addAttribute('removable', $data['removable'] ? 'true' : 'false'); } } $result = $xml->asXML();