From fda83fc28c541e0785e6dd7c96a6124c0e393754 Mon Sep 17 00:00:00 2001 From: Brullworfel Date: Thu, 3 Jan 2019 15:30:24 +0200 Subject: [PATCH] add support for new create parameters Add support for: - bannerText; - bannerColor; - copyright; - logo; - muteOnStart; - webcamsOnlyForModerator; --- src/BigBlueButton/Client.php | 4 +- src/BigBlueButton/Member/Meeting.php | 190 ++++++++++++++++++++++++++- src/BigBlueButton/Server.php | 1 + 3 files changed, 187 insertions(+), 8 deletions(-) diff --git a/src/BigBlueButton/Client.php b/src/BigBlueButton/Client.php index c47624c..eb19a3d 100644 --- a/src/BigBlueButton/Client.php +++ b/src/BigBlueButton/Client.php @@ -161,7 +161,7 @@ private function xml2object($raw_response) // Fix data model. if (isset($array->attendees)) { $array->attendees = (array) $array->attendees; - if ($array->attendees[0] === "\n") { + if (!isset($array->attendees[0]) or $array->attendees[0] === "\n") { $array->attendees = []; } } @@ -169,7 +169,7 @@ private function xml2object($raw_response) // Fix data model. if (isset($array->metadata)) { $array->metadata = (array) $array->metadata; - if ($array->metadata[0] === "\n") { + if (!isset($array->metadata[0]) or $array->metadata[0] === "\n") { $array->metadata = []; } } diff --git a/src/BigBlueButton/Member/Meeting.php b/src/BigBlueButton/Member/Meeting.php index c4509c4..cd5bbc0 100644 --- a/src/BigBlueButton/Member/Meeting.php +++ b/src/BigBlueButton/Member/Meeting.php @@ -81,6 +81,28 @@ class Meeting * @var string */ protected $logoutURL; + + /** + * The Banner Text. + * + * @var string + */ + protected $bannerText; + + /** + * The Banner Color. + * + * @var string + */ + + protected $bannerColor; + + /** + * The logo. + * + * @var string + */ + protected $logo; /** * The meeting will record. @@ -129,13 +151,7 @@ class Meeting * * @var string */ - protected $logo; - /** - * Copyright statement for flash client. - * - * @var string - */ protected $copyright; /** @@ -362,6 +378,8 @@ public function __construct($attributes, Client $client) 'voiceBridge' => '', 'webVoice' => '', 'logoutURL' => '', + 'bannerText' => '', + 'bannerColor' => '', 'record' => false, 'duration' => 0, 'meta' => [], @@ -370,6 +388,8 @@ public function __construct($attributes, Client $client) 'allowStartStopRecording' => true, 'webcamsOnlyForModerator' => false, 'logo' => '', + 'bannerText' => '', + 'bannerColor' => '', 'copyright' => '', 'muteOnStart' => false, ]; @@ -642,6 +662,93 @@ public function setLogoutURL($logoutURL) $this->logoutURL = $logoutURL; return $this; } + /** + * Get the banner text. + * + * @return string + */ + public function getBannerText() + { + return $this->bannerText; + } + + /** + * Set the banner text. + * + * @param string $bannerText + * @return Meeting + */ + public function setBannerText($bannerText) + { + $this->bannerText = $bannerText; + return $this; + } + + /** + * Get the banner Color. + * + * @return string + */ + public function getBannerColor() + { + return $this->bannerColor; + } + + /** + * Set the banner Color. + * + * @param string $bannerColor + * @return Meeting + */ + public function setBannerColor($bannerColor) + { + $this->bannerColor = $bannerColor; + return $this; + } + + /** + * Get the copyright. + * + * @return string + */ + public function getCopyright() + { + return $this->copyright; + } + + /** + * Set the copyright. + * + * @param string $copyright + * @return Meeting + */ + public function setCopyright($copyright) + { + $this->copyright = $copyright; + return $this; + } + + /** + * Get the logo. + * + * @return string + */ + public function getLogo() + { + return $this->logo; + } + + /** + * Set the logo. + * + * @param string $logo + * @return Meeting + */ + public function setLogo($logo) + { + $this->logo = $logo; + return $this; + } /** * Does the meeting record? @@ -674,6 +781,39 @@ public function setRecord($record) $this->record = $record; return $this; } + + /** + * Does mute on start? + * + * @return boolean + */ + + public function getMuteOnStart() + { + return $this->doesMuteOnStart(); + } + + /** + * Alias for getMuteOnStart(). + * + * @return boolean + */ + public function doesMuteOnStart() + { + return $this->muteOnStart; + } + + /** + * Set the muteOnStart. + * + * @param boolean $muteOnStart + * @return Meeting + */ + public function setMuteOnStart($muteOnStart) + { + $this->muteOnStart = $muteOnStart; + return $this; + } /** * Get the duration. @@ -816,6 +956,38 @@ public function setAllowStartStopRecording($allowStartStopRecording) return $this; } + /** + * Alias for getWebcamsOnlyForModerator(). + * + * @return boolean + */ + public function doesWebcamsOnlyForModerator() + { + return $this->getWebcamsOnlyForModerator(); + } + + /** + * Does the meeting allow to start/stop recording? + * + * @return boolean + */ + public function getWebcamsOnlyForModerator() + { + return $this->webcamsOnlyForModerator; + } + + /** + * Set the allow start/stop recording indicator. + * + * @param boolean $webcamsOnlyForModerator + * @return Meeting + */ + public function setWebcamsOnlyForModerator($webcamsOnlyForModerator) + { + $this->webcamsOnlyForModerator = $webcamsOnlyForModerator; + return $this; + } + /** * Get the create time. * @@ -1026,11 +1198,17 @@ public function create() 'welcome' => $this->getWelcome(), 'dialNumber' => $this->getDialNumber(), 'logoutURL' => $this->getLogoutURL(), + 'bannerText' => $this->getBannerText(), + 'bannerColor' => $this->getBannerColor(), + 'copyright' => $this->getCopyright(), + 'logo' => $this->getLogo(), 'record' => $this->getRecord(), + 'muteOnStart' => $this->getMuteOnStart(), 'duration' => $this->getDuration(), 'moderatorOnlyMessage' => $this->getModeratorOnlyMessage(), 'autoStartRecording' => $this->getAutoStartRecording(), 'allowStartStopRecording' => $this->getAllowStartStopRecording(), + 'webcamsOnlyForModerator' => $this->getWebcamsOnlyForModerator(), ]); $this->meetingID = $response->meetingID; return $this->getInfo(); diff --git a/src/BigBlueButton/Server.php b/src/BigBlueButton/Server.php index 4a8b04e..1bd1ba8 100644 --- a/src/BigBlueButton/Server.php +++ b/src/BigBlueButton/Server.php @@ -139,6 +139,7 @@ public function getVersion() * recording. This means the meeting can start recording automatically * (autoStartRecording=true) with the user able to stop/start recording * from the client. + * - webcamsOnlyForModerator * * @return \sanduhrs\BigBlueButton\Member\Meeting * A meeting object.