Skip to content

Commit 5ceff70

Browse files
committed
Add new API parameters introduced in BigBlueButton 2.4.
1 parent 5e0bafa commit 5ceff70

File tree

10 files changed

+328
-63
lines changed

10 files changed

+328
-63
lines changed

src/Core/GuestPolicy.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
4+
*
5+
* Copyright (c) 2016-2021 BigBlueButton Inc. and by respective authors (see below).
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under the
8+
* terms of the GNU Lesser General Public License as published by the Free Software
9+
* Foundation; either version 3.0 of the License, or (at your option) any later
10+
* version.
11+
*
12+
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License along
17+
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
namespace BigBlueButton\Core;
20+
21+
class GuestPolicy
22+
{
23+
public const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
24+
public const ALWAYS_DENY = 'ALWAYS_DENY';
25+
public const ASK_MODERATOR = 'ASK_MODERATOR';
26+
}

src/Core/MeetingLayout.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
4+
*
5+
* Copyright (c) 2016-2021 BigBlueButton Inc. and by respective authors (see below).
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under the
8+
* terms of the GNU Lesser General Public License as published by the Free Software
9+
* Foundation; either version 3.0 of the License, or (at your option) any later
10+
* version.
11+
*
12+
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License along
17+
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
namespace BigBlueButton\Core;
20+
21+
class MeetingLayout
22+
{
23+
public const CUSTOM_LAYOUT = 'CUSTOM_LAYOUT';
24+
public const SMART_LAYOUT = 'SMART_LAYOUT';
25+
public const PRESENTATION_FOCUS = 'PRESENTATION_FOCUS';
26+
public const VIDEO_FOCUS = 'VIDEO_FOCUS';
27+
}

src/Parameters/CreateMeetingParameters.php

Lines changed: 152 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@
1616
* You should have received a copy of the GNU Lesser General Public License along
1717
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
1818
*/
19+
1920
namespace BigBlueButton\Parameters;
2021

2122
/**
2223
* Class CreateMeetingParameters.
2324
*/
2425
class CreateMeetingParameters extends MetaParameters
2526
{
26-
const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
27-
const ALWAYS_DENY = 'ALWAYS_DENY';
28-
const ASK_MODERATOR = 'ASK_MODERATOR';
2927

3028
/**
3129
* @var string
@@ -172,6 +170,11 @@ class CreateMeetingParameters extends MetaParameters
172170
*/
173171
private $allowModsToUnmuteUsers;
174172

173+
/**
174+
* @var bool
175+
*/
176+
private $allowModsToEjectCameras;
177+
175178
/**
176179
* @var array
177180
*/
@@ -200,7 +203,7 @@ class CreateMeetingParameters extends MetaParameters
200203
/**
201204
* @var string
202205
*/
203-
private $guestPolicy = self::ALWAYS_ACCEPT;
206+
private $guestPolicy;
204207

205208
/**
206209
* @var string
@@ -237,6 +240,31 @@ class CreateMeetingParameters extends MetaParameters
237240
*/
238241
private $meetingKeepEvents;
239242

243+
/**
244+
* @var boolean
245+
*/
246+
private $breakoutRoomsEnabled;
247+
248+
/**
249+
* @var boolean
250+
*/
251+
private $breakoutRoomsRecord;
252+
253+
/**
254+
* @var boolean
255+
*/
256+
private $breakoutRoomsPrivateChatEnabled;
257+
258+
/**
259+
* @var string
260+
*/
261+
private $meetingEndedURL;
262+
263+
/**
264+
* @var string
265+
*/
266+
private $meetingLayout;
267+
240268
/**
241269
* CreateMeetingParameters constructor.
242270
*
@@ -948,6 +976,25 @@ public function setAllowModsToUnmuteUsers($allowModsToUnmuteUsers)
948976
return $this;
949977
}
950978

979+
/**
980+
* @return bool
981+
*/
982+
public function isAllowModsToEjectCameras(): bool
983+
{
984+
return $this->allowModsToEjectCameras;
985+
}
986+
987+
/**
988+
* @param bool $allowModsToEjectCameras
989+
* @return CreateMeetingParameters
990+
*/
991+
public function setAllowModsToEjectCameras(bool $allowModsToEjectCameras): self
992+
{
993+
$this->allowModsToEjectCameras = $allowModsToEjectCameras;
994+
995+
return $this;
996+
}
997+
951998
/**
952999
* @param $endCallbackUrl
9531000
* @return CreateMeetingParameters
@@ -1065,6 +1112,101 @@ public function setGuestPolicy($guestPolicy)
10651112
return $this;
10661113
}
10671114

1115+
/**
1116+
* @return bool
1117+
*/
1118+
public function isBreakoutRoomsEnabled(): bool
1119+
{
1120+
return $this->breakoutRoomsEnabled;
1121+
}
1122+
1123+
/**
1124+
* @param bool $breakoutRoomsEnabled
1125+
* @return CreateMeetingParameters
1126+
*/
1127+
public function setBreakoutRoomsEnabled(bool $breakoutRoomsEnabled): self
1128+
{
1129+
$this->breakoutRoomsEnabled = $breakoutRoomsEnabled;
1130+
1131+
return $this;
1132+
}
1133+
1134+
/**
1135+
* @return bool
1136+
*/
1137+
public function isBreakoutRoomsRecord(): bool
1138+
{
1139+
return $this->breakoutRoomsRecord;
1140+
}
1141+
1142+
/**
1143+
* @param bool $breakoutRoomsRecord
1144+
* @return CreateMeetingParameters
1145+
*/
1146+
public function setBreakoutRoomsRecord(bool $breakoutRoomsRecord): self
1147+
{
1148+
$this->breakoutRoomsRecord = $breakoutRoomsRecord;
1149+
1150+
return $this;
1151+
}
1152+
1153+
/**
1154+
* @return bool
1155+
*/
1156+
public function isBreakoutRoomsPrivateChatEnabled(): bool
1157+
{
1158+
return $this->breakoutRoomsPrivateChatEnabled;
1159+
}
1160+
1161+
/**
1162+
* @param bool $breakoutRoomsPrivateChatEnabled
1163+
* @return CreateMeetingParameters
1164+
*/
1165+
public function setBreakoutRoomsPrivateChatEnabled(bool $breakoutRoomsPrivateChatEnabled): self
1166+
{
1167+
$this->breakoutRoomsPrivateChatEnabled = $breakoutRoomsPrivateChatEnabled;
1168+
1169+
return $this;
1170+
}
1171+
1172+
/**
1173+
* @return string
1174+
*/
1175+
public function getMeetingEndedURL(): string
1176+
{
1177+
return $this->meetingEndedURL;
1178+
}
1179+
1180+
/**
1181+
* @param string $meetingEndedURL
1182+
* @return CreateMeetingParameters
1183+
*/
1184+
public function setMeetingEndedURL(string $meetingEndedURL): self
1185+
{
1186+
$this->meetingEndedURL = $meetingEndedURL;
1187+
1188+
return $this;
1189+
}
1190+
1191+
/**
1192+
* @return string
1193+
*/
1194+
public function getMeetingLayout(): string
1195+
{
1196+
return $this->meetingLayout;
1197+
}
1198+
1199+
/**
1200+
* @param string $meetingLayout
1201+
* @return CreateMeetingParameters
1202+
*/
1203+
public function setMeetingLayout(string $meetingLayout): self
1204+
{
1205+
$this->meetingLayout = $meetingLayout;
1206+
1207+
return $this;
1208+
}
1209+
10681210
/**
10691211
* @return array
10701212
*/
@@ -1158,13 +1300,19 @@ public function getHTTPQuery()
11581300
'lockSettingsLockOnJoin' => $this->isLockSettingsLockOnJoin() ? 'true' : 'false',
11591301
'lockSettingsLockOnJoinConfigurable' => $this->isLockSettingsLockOnJoinConfigurable() ? 'true' : 'false',
11601302
'allowModsToUnmuteUsers' => $this->isAllowModsToUnmuteUsers() ? 'true' : 'false',
1303+
'allowModsToEjectCameras' => $this->isAllowModsToEjectCameras() ? 'true' : 'false',
11611304
'bannerText' => trim($this->bannerText),
11621305
'bannerColor' => trim($this->bannerColor),
11631306
'learningDashboardEnabled' => $this->isLearningDashboardEnabled() ? 'true' : 'false',
11641307
'learningDashboardCleanupDelayInMinutes' => $this->learningDashboardCleanupDelayInMinutes,
11651308
'endWhenNoModeratorDelayInMinutes' => $this->endWhenNoModeratorDelayInMinutes,
1309+
'meetingEndedURL' => $this->meetingEndedURL,
1310+
'breakoutRoomsEnabled' => $this->isBreakoutRoomsEnabled() ? 'true' : 'false',
1311+
'breakoutRoomsRecord' => $this->isBreakoutRoomsRecord() ? 'true' : 'false',
1312+
'breakoutRoomsPrivateChatEnabled(' => $this->isBreakoutRoomsPrivateChatEnabled() ? 'true' : 'false',
11661313
'endWhenNoModerator' => $this->isEndWhenNoModerator() ? 'true' : 'false',
11671314
'meetingKeepEvents' => $this->isMeetingKeepEvents() ? 'true' : 'false',
1315+
'meetingLayout' => $this->getMeetingLayout() ,
11681316
];
11691317

11701318
// Add breakout rooms parameters only if the meeting is a breakout room

src/Responses/ApiVersionResponse.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License along
1717
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
1818
*/
19+
1920
namespace BigBlueButton\Responses;
2021

2122
/**
@@ -31,4 +32,20 @@ public function getVersion()
3132
{
3233
return $this->rawXml->version->__toString();
3334
}
35+
36+
/**
37+
* @return string
38+
*/
39+
public function getApiVersion()
40+
{
41+
return $this->rawXml->apiVersion->__toString();
42+
}
43+
44+
/**
45+
* @return string
46+
*/
47+
public function getBbbVersion()
48+
{
49+
return $this->rawXml->bbbVersion->__toString();
50+
}
3451
}

tests/BigBlueButtonTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testCreateMeetingUrl()
8080
if (is_bool($value)) {
8181
$value = $value ? 'true' : 'false';
8282
}
83-
$this->assertContains('=' . urlencode($value), $url);
83+
$this->assertStringContainsString('=' . urlencode($value), $url);
8484
}
8585
}
8686

@@ -172,7 +172,7 @@ public function testCreateJoinMeetingUrl()
172172
if (is_bool($value)) {
173173
$value = $value ? 'true' : 'false';
174174
}
175-
$this->assertContains('=' . urlencode($value), $url);
175+
$this->assertStringContainsString('=' . urlencode($value), $url);
176176
}
177177
}
178178

@@ -209,7 +209,7 @@ public function testCreateEndMeetingUrl()
209209
if (is_bool($value)) {
210210
$value = $value ? 'true' : 'false';
211211
}
212-
$this->assertContains('=' . urlencode($value), $url);
212+
$this->assertStringContainsString('=' . urlencode($value), $url);
213213
}
214214
}
215215

@@ -246,7 +246,7 @@ public function testIsMeetingRunning()
246246
public function testGetMeetingsUrl()
247247
{
248248
$url = $this->bbb->getMeetingsUrl();
249-
$this->assertContains(ApiMethod::GET_MEETINGS, $url);
249+
$this->assertStringContainsString(ApiMethod::GET_MEETINGS, $url);
250250
}
251251

252252
public function testGetMeetings()
@@ -262,8 +262,8 @@ public function testGetMeetingInfoUrl()
262262
$meeting = $this->createRealMeeting($this->bbb);
263263

264264
$url = $this->bbb->getMeetingInfoUrl(new GetMeetingInfoParameters($meeting->getMeetingId(), $meeting->getModeratorPassword()));
265-
$this->assertContains('=' . urlencode($meeting->getMeetingId()), $url);
266-
$this->assertContains('=' . urlencode($meeting->getModeratorPassword()), $url);
265+
$this->assertStringContainsString('=' . urlencode($meeting->getMeetingId()), $url);
266+
$this->assertStringContainsString('=' . urlencode($meeting->getModeratorPassword()), $url);
267267
}
268268

269269
public function testGetMeetingInfo()
@@ -278,7 +278,7 @@ public function testGetMeetingInfo()
278278
public function testGetRecordingsUrl()
279279
{
280280
$url = $this->bbb->getRecordingsUrl(new GetRecordingsParameters());
281-
$this->assertContains(ApiMethod::GET_RECORDINGS, $url);
281+
$this->assertStringContainsString(ApiMethod::GET_RECORDINGS, $url);
282282
}
283283

284284
public function testGetRecordings()
@@ -291,7 +291,7 @@ public function testGetRecordings()
291291
public function testPublishRecordingsUrl()
292292
{
293293
$url = $this->bbb->getPublishRecordingsUrl(new PublishRecordingsParameters($this->faker->sha1, true));
294-
$this->assertContains(ApiMethod::PUBLISH_RECORDINGS, $url);
294+
$this->assertStringContainsString(ApiMethod::PUBLISH_RECORDINGS, $url);
295295
}
296296

297297
public function testPublishRecordings()
@@ -304,7 +304,7 @@ public function testPublishRecordings()
304304
public function testDeleteRecordingsUrl()
305305
{
306306
$url = $this->bbb->getDeleteRecordingsUrl(new DeleteRecordingsParameters($this->faker->sha1));
307-
$this->assertContains(ApiMethod::DELETE_RECORDINGS, $url);
307+
$this->assertStringContainsString(ApiMethod::DELETE_RECORDINGS, $url);
308308
}
309309

310310
public function testDeleteRecordings()
@@ -322,7 +322,7 @@ public function testUpdateRecordingsUrl()
322322
if (is_bool($value)) {
323323
$value = $value ? 'true' : 'false';
324324
}
325-
$this->assertContains('=' . urlencode($value), $url);
325+
$this->assertStringContainsString('=' . urlencode($value), $url);
326326
}
327327
}
328328

0 commit comments

Comments
 (0)