Skip to content

Commit 291a588

Browse files
committed
- Add text track API.
- Delete Travis config. - Code updates.
2 parents 3ec5342 + 6aff919 commit 291a588

19 files changed

+897
-96
lines changed

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/BigBlueButton.php

Lines changed: 76 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
use BigBlueButton\Parameters\EndMeetingParameters;
2828
use BigBlueButton\Parameters\GetMeetingInfoParameters;
2929
use BigBlueButton\Parameters\GetRecordingsParameters;
30+
use BigBlueButton\Parameters\GetRecordingTextTracksParameters;
3031
use BigBlueButton\Parameters\HooksCreateParameters;
3132
use BigBlueButton\Parameters\HooksDestroyParameters;
3233
use BigBlueButton\Parameters\InsertDocumentParameters;
3334
use BigBlueButton\Parameters\IsMeetingRunningParameters;
3435
use BigBlueButton\Parameters\JoinMeetingParameters;
3536
use BigBlueButton\Parameters\PublishRecordingsParameters;
37+
use BigBlueButton\Parameters\PutRecordingTextTrackParameters;
3638
use BigBlueButton\Parameters\UpdateRecordingsParameters;
3739
use BigBlueButton\Responses\ApiVersionResponse;
3840
use BigBlueButton\Responses\CreateMeetingResponse;
@@ -41,12 +43,15 @@
4143
use BigBlueButton\Responses\GetMeetingInfoResponse;
4244
use BigBlueButton\Responses\GetMeetingsResponse;
4345
use BigBlueButton\Responses\GetRecordingsResponse;
46+
use BigBlueButton\Responses\GetRecordingTextTracksResponseResponse;
4447
use BigBlueButton\Responses\HooksCreateResponse;
4548
use BigBlueButton\Responses\HooksDestroyResponse;
4649
use BigBlueButton\Responses\HooksListResponse;
50+
use BigBlueButton\Responses\InsertDocumentResponse;
4751
use BigBlueButton\Responses\IsMeetingRunningResponse;
4852
use BigBlueButton\Responses\JoinMeetingResponse;
4953
use BigBlueButton\Responses\PublishRecordingsResponse;
54+
use BigBlueButton\Responses\PutRecordingTextTrackResponse;
5055
use BigBlueButton\Responses\UpdateRecordingsResponse;
5156
use BigBlueButton\Util\UrlBuilder;
5257

@@ -183,7 +188,7 @@ public function getInsertDocumentUrl($createMeetingParams)
183188
}
184189

185190
/**
186-
* @param InsertDocumentParameters $insertDocumentParams
191+
* @param $insertDocumentParams InsertDocumentParameters
187192
*
188193
* @return InsertDocumentResponse
189194
*
@@ -260,8 +265,6 @@ public function getMeetingInfoUrl($meetingParams)
260265
/**
261266
* @param $meetingParams GetMeetingInfoParameters
262267
*
263-
* @return GetMeetingInfoResponse
264-
*
265268
* @throws \RuntimeException
266269
*/
267270
public function getMeetingInfo($meetingParams)
@@ -291,8 +294,6 @@ public function getRecordingsUrl($recordingsParams)
291294
/**
292295
* @param mixed $recordingParams
293296
*
294-
* @return GetRecordingsResponse
295-
*
296297
* @throws \RuntimeException
297298
*/
298299
public function getRecordings($recordingParams)
@@ -315,8 +316,6 @@ public function getPublishRecordingsUrl($recordingParams)
315316
/**
316317
* @param $recordingParams PublishRecordingsParameters
317318
*
318-
* @return PublishRecordingsResponse
319-
*
320319
* @throws \RuntimeException
321320
*/
322321
public function publishRecordings($recordingParams)
@@ -363,8 +362,6 @@ public function getUpdateRecordingsUrl($recordingParams)
363362
/**
364363
* @param $recordingParams UpdateRecordingsParameters
365364
*
366-
* @return UpdateRecordingsResponse
367-
*
368365
* @throws \RuntimeException
369366
*/
370367
public function updateRecordings($recordingParams)
@@ -374,6 +371,50 @@ public function updateRecordings($recordingParams)
374371
return new UpdateRecordingsResponse($xml);
375372
}
376373

374+
/**
375+
* @param $getRecordingTextTracksParameters GetRecordingTextTracksParameters
376+
*
377+
* @return string
378+
*/
379+
public function getRecordingTextTracksUrl($getRecordingTextTracksParameters)
380+
{
381+
return $this->urlBuilder->buildUrl(ApiMethod::GET_RECORDING_TEXT_TRACKS, $getRecordingTextTracksParameters->getHTTPQuery());
382+
}
383+
384+
/**
385+
* @param $getRecordingTextTracksParams GetRecordingTextTracksParameters
386+
*
387+
* @return GetRecordingTextTracksResponseResponse
388+
*/
389+
public function getRecordingTextTracks($getRecordingTextTracksParams)
390+
{
391+
$json = $this->processJsonResponse($this->getRecordingTextTracksUrl($getRecordingTextTracksParams));
392+
393+
return new GetRecordingTextTracksResponseResponse($json);
394+
}
395+
396+
/**
397+
* @param $putRecordingTextTrackParams PutRecordingTextTrackParameters
398+
*
399+
* @return string
400+
*/
401+
public function getPutRecordingTextTrackUrl(PutRecordingTextTrackParameters $putRecordingTextTrackParams)
402+
{
403+
return $this->urlBuilder->buildUrl(ApiMethod::PUT_RECORDING_TEXT_TRACK, $putRecordingTextTrackParams->getHTTPQuery());
404+
}
405+
406+
/**
407+
* @param $putRecordingTextTrackParams PutRecordingTextTrackParameters
408+
*
409+
* @return PutRecordingTextTrackResponse
410+
*/
411+
public function putRecordingTextTrack($putRecordingTextTrackParams)
412+
{
413+
$json = $this->processJsonResponse($this->getPutRecordingTextTrackUrl($putRecordingTextTrackParams));
414+
415+
return new PutRecordingTextTrackResponse($json);
416+
}
417+
377418
// ____________________ WEB HOOKS METHODS ___________________
378419

379420
/**
@@ -494,17 +535,17 @@ public function buildUrl($method = '', $params = '', $append = true)
494535
// ____________________ INTERNAL CLASS METHODS ___________________
495536

496537
/**
497-
* A private utility method used by other public methods to process XML responses.
538+
* A private utility method used by other public methods to request HTTP responses.
498539
*
499540
* @param string $url
500541
* @param string $payload
501542
* @param string $contentType
502543
*
503-
* @return \SimpleXMLElement
544+
* @return string
504545
*
505546
* @throws \RuntimeException
506547
*/
507-
private function processXmlResponse($url, $payload = '', $contentType = 'application/xml')
548+
private function sendRequest($url, $payload = '', $contentType = 'application/xml')
508549
{
509550
if (extension_loaded('curl')) {
510551
$ch = curl_init();
@@ -554,9 +595,31 @@ private function processXmlResponse($url, $payload = '', $contentType = 'applica
554595
$this->setJSessionId($output_array['JSESSIONID']);
555596
}
556597

557-
return new \SimpleXMLElement($data);
598+
return $data;
558599
}
559600

560601
throw new \RuntimeException('Post XML data set but curl PHP module is not installed or not enabled.');
561602
}
603+
604+
/**
605+
* A private utility method used by other public methods to process XML responses.
606+
*
607+
* @param string $url
608+
* @param string $payload
609+
* @param string $contentType
610+
*
611+
* @return \SimpleXMLElement
612+
*/
613+
private function processXmlResponse($url, $payload = '', $contentType = 'application/xml')
614+
{
615+
return new \SimpleXMLElement($this->sendRequest($url, $payload, $contentType));
616+
}
617+
618+
/**
619+
* A private utility method used by other public methods to process json responses.
620+
*/
621+
private function processJsonResponse(string $url, string $payload = '', string $contentType = 'application/json')
622+
{
623+
return $this->sendRequest($url, $payload, $contentType);
624+
}
562625
}

src/Core/ApiMethod.php

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,24 @@
2020

2121
namespace BigBlueButton\Core;
2222

23-
abstract class ApiMethod
23+
final class ApiMethod
2424
{
25-
public const CREATE = 'create';
26-
public const JOIN = 'join';
27-
public const INSERT_DOCUMENT = 'insertDocument';
28-
public const ENTER = 'enter';
29-
public const END = 'end';
30-
public const IS_MEETING_RUNNING = 'isMeetingRunning';
31-
public const GET_MEETING_INFO = 'getMeetingInfo';
32-
public const GET_MEETINGS = 'getMeetings';
33-
public const SIGN_OUT = 'signOut';
34-
public const GET_RECORDINGS = 'getRecordings';
35-
public const PUBLISH_RECORDINGS = 'publishRecordings';
36-
public const DELETE_RECORDINGS = 'deleteRecordings';
37-
public const UPDATE_RECORDINGS = 'updateRecordings';
38-
public const HOOKS_CREATE = 'hooks/create';
39-
public const HOOKS_LIST = 'hooks/list';
40-
public const HOOKS_DESTROY = 'hooks/destroy';
25+
public const CREATE = 'create';
26+
public const JOIN = 'join';
27+
public const INSERT_DOCUMENT = 'insertDocument';
28+
public const ENTER = 'enter';
29+
public const END = 'end';
30+
public const IS_MEETING_RUNNING = 'isMeetingRunning';
31+
public const GET_MEETING_INFO = 'getMeetingInfo';
32+
public const GET_MEETINGS = 'getMeetings';
33+
public const SIGN_OUT = 'signOut';
34+
public const GET_RECORDINGS = 'getRecordings';
35+
public const PUBLISH_RECORDINGS = 'publishRecordings';
36+
public const DELETE_RECORDINGS = 'deleteRecordings';
37+
public const UPDATE_RECORDINGS = 'updateRecordings';
38+
public const GET_RECORDING_TEXT_TRACKS = 'getRecordingTextTracks';
39+
public const PUT_RECORDING_TEXT_TRACK = 'putRecordingTextTrack';
40+
public const HOOKS_CREATE = 'hooks/create';
41+
public const HOOKS_LIST = 'hooks/list';
42+
public const HOOKS_DESTROY = 'hooks/destroy';
4143
}

src/Core/Track.php

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
/*
4+
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
5+
*
6+
* Copyright (c) 2016-2023 BigBlueButton Inc. and by respective authors (see below).
7+
*
8+
* This program is free software; you can redistribute it and/or modify it under the
9+
* terms of the GNU Lesser General Public License as published by the Free Software
10+
* Foundation; either version 3.0 of the License, or (at your option) any later
11+
* version.
12+
*
13+
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
14+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public License along
18+
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
namespace BigBlueButton\Core;
22+
23+
/**
24+
* Class Track.
25+
*/
26+
class Track
27+
{
28+
/**
29+
* @var string
30+
*/
31+
private $href;
32+
33+
/**
34+
* @var string
35+
*/
36+
private $kind;
37+
38+
/**
39+
* @var string
40+
*/
41+
private $label;
42+
43+
/**
44+
* @var string
45+
*/
46+
private $lang;
47+
48+
/**
49+
* @var string
50+
*/
51+
private $source;
52+
53+
public function __construct($track)
54+
{
55+
$this->href = $track->href;
56+
$this->kind = $track->kind;
57+
$this->label = $track->label;
58+
$this->lang = $track->lang;
59+
$this->source = $track->source;
60+
}
61+
62+
public function getHref()
63+
{
64+
return $this->href;
65+
}
66+
67+
public function getKind()
68+
{
69+
return $this->kind;
70+
}
71+
72+
public function getLabel()
73+
{
74+
return $this->label;
75+
}
76+
77+
public function getLang()
78+
{
79+
return $this->lang;
80+
}
81+
82+
public function getSource()
83+
{
84+
return $this->source;
85+
}
86+
}

src/Enum/GuestPolicy.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222

2323
use MabeEnum\Enum;
2424

25+
// @ref : https://github.com/bigbluebutton/bigbluebutton/blob/5189abb225247290d1954e10827853d5fc022b66/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/GuestPolicy.java
2526
class GuestPolicy extends Enum
2627
{
27-
public const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
28-
public const ALWAYS_DENY = 'ALWAYS_DENY';
29-
public const ASK_MODERATOR = 'ASK_MODERATOR';
28+
public const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
29+
public const ALWAYS_DENY = 'ALWAYS_DENY';
30+
public const ASK_MODERATOR = 'ASK_MODERATOR';
31+
public const ALWAYS_ACCEPT_AUTH = 'ALWAYS_ACCEPT_AUTH';
3032
}

0 commit comments

Comments
 (0)