Skip to content

Commit

Permalink
added update recordings funcationality
Browse files Browse the repository at this point in the history
  • Loading branch information
joisarjignesh committed Oct 10, 2021
1 parent 9816b16 commit 6a26b72
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions src/Bbb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions src/Services/InitRecordings.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use BigBlueButton\Parameters\DeleteRecordingsParameters;
use BigBlueButton\Parameters\GetRecordingsParameters;
use BigBlueButton\Parameters\PublishRecordingsParameters;
use BigBlueButton\Parameters\UpdateRecordingsParameters;

trait InitRecordings
{
Expand Down Expand Up @@ -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')));
}
}

0 comments on commit 6a26b72

Please sign in to comment.