From 6a26b72051514abc83782091f962778e7a644379 Mon Sep 17 00:00:00 2001 From: Jignesh Joisar Date: Sun, 10 Oct 2021 14:32:29 +0530 Subject: [PATCH] added update recordings funcationality --- README.md | 9 +++++++++ src/Bbb.php | 19 +++++++++++++++++++ src/Services/InitRecordings.php | 15 +++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/README.md b/README.md index fec6d470d7..f0e91fbfb2 100755 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Package that provides easily communicate between BigBlueButton server and larave * [Get recordings](#get-recordings) * [Publish recordings](#publish-recordings) * [Delete recordings](#delete-recordings) + * [Update recordings](#update-recordings) * [Config Xml](#config-xml) * [Get default config](#get-default-config-xml) * [Set config](#set-config-xml) @@ -274,6 +275,14 @@ Bigbluebutton::close([ 'recordID' => ['a3f1s','a4ff2'] //pass array if multiple delete recordings ]); ``` +#### Update recordings +- Update recordings [document](https://docs.bigbluebutton.org/dev/api.html#updaterecordings) +```php +\Bigbluebutton::updateRecordings([ + //'recordID' => 'a3f1s', + 'recordID' => ['a3f1s','a4ff2'] //pass array if multiple delete recordings +]); +``` ### Config xml ##### Get default config xml diff --git a/src/Bbb.php b/src/Bbb.php index 026d657682..8e585cb4e0 100755 --- a/src/Bbb.php +++ b/src/Bbb.php @@ -14,6 +14,7 @@ use BigBlueButton\Parameters\JoinMeetingParameters; use BigBlueButton\Parameters\PublishRecordingsParameters; use BigBlueButton\Parameters\SetConfigXMLParameters; +use BigBlueButton\Parameters\UpdateRecordingsParameters; use JoisarJignesh\Bigbluebutton\Bigbluebutton as BigBlueButtonServer; use JoisarJignesh\Bigbluebutton\Services\InitConfigXml; use JoisarJignesh\Bigbluebutton\Services\InitExtra; @@ -327,6 +328,24 @@ public function deleteRecordings($recording) return collect(XmlToArray($this->response->getRawXml())); } + /** + * @param $recording + * + * required fields + * recordingID + * @return \Illuminate\Support\Collection + */ + public function updateRecordings($recording) + { + if (! $recording instanceof UpdateRecordingsParameters) { + $recording = $this->initUpdateRecordings($recording); + } + + $this->response = $this->bbb->updateRecordings($recording); + + return collect(XmlToArray($this->response->getRawXml())); + } + /** * @param $configXml * @return \Illuminate\Support\Collection diff --git a/src/Services/InitRecordings.php b/src/Services/InitRecordings.php index 57bce1bae5..fb42ea65b2 100755 --- a/src/Services/InitRecordings.php +++ b/src/Services/InitRecordings.php @@ -5,6 +5,7 @@ use BigBlueButton\Parameters\DeleteRecordingsParameters; use BigBlueButton\Parameters\GetRecordingsParameters; use BigBlueButton\Parameters\PublishRecordingsParameters; +use BigBlueButton\Parameters\UpdateRecordingsParameters; trait InitRecordings { @@ -58,4 +59,18 @@ public function initDeleteRecordings($recording) return new DeleteRecordingsParameters(implode(',', (array) $request->get('recordID'))); } + + /** + * @param mixed $recording + * + * required fields + * recordID + * @return UpdateRecordingsParameters + */ + public function initUpdateRecordings($recording) + { + $request = Fluent($recording); + + return new UpdateRecordingsParameters(implode(',', (array) $request->get('recordID'))); + } }