diff --git a/src/BigBlueButton.php b/src/BigBlueButton.php
index 5a1f7f89..1c9d18a9 100644
--- a/src/BigBlueButton.php
+++ b/src/BigBlueButton.php
@@ -397,7 +397,7 @@ public function setJSessionId($jSessionId)
$this->jSessionId = $jSessionId;
}
- /**
+ /**
* @param array $curlopts
*/
public function setCurlOpts($curlopts)
@@ -429,7 +429,7 @@ private function processXmlResponse($url, $payload = '', $contentType = 'applica
$cookiefile = tmpfile();
$cookiefilepath = stream_get_meta_data($cookiefile)['uri'];
- foreach ($this->curlopts as $opt => $value){
+ foreach ($this->curlopts as $opt => $value) {
curl_setopt($ch, $opt, $value);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
@@ -487,12 +487,12 @@ public function setTimeOut($TimeOutInSeconds)
/**
* Public accessor for buildUrl
- * @param string $method
- * @param string $params
- * @param bool $append
- * @return string
+ * @param string $method
+ * @param string $params
+ * @param bool $append
+ * @return string
*/
- public function buildUrl($method = '', $params = '', $append = TRUE)
+ public function buildUrl($method = '', $params = '', $append = true)
{
return $this->urlBuilder->buildUrl($method, $params, $append);
}
diff --git a/src/Core/Format.php b/src/Core/Format.php
new file mode 100644
index 00000000..7b18ec8c
--- /dev/null
+++ b/src/Core/Format.php
@@ -0,0 +1,105 @@
+.
+ */
+
+namespace BigBlueButton\Core;
+
+class Format
+{
+ /**
+ * @var \SimpleXMLElement
+ */
+ protected $rawXml;
+
+ private $type;
+ private $url;
+ private $processingTime;
+ private $length;
+ private $size;
+ private $images;
+
+ /**
+ * Record constructor.
+ * @param $xml \SimpleXMLElement
+ */
+ public function __construct($xml)
+ {
+ $this->rawXml = $xml;
+ $this->type = $xml->type->__toString();
+ $this->url = $xml->url->__toString();
+ $this->processingTime = (int) $xml->processingTime->__toString();
+ $this->length = (int) $xml->length->__toString();
+ $this->size = (int) $xml->size->__toString();
+ }
+
+ /**
+ * @return Image[]
+ */
+ public function getImages()
+ {
+ if ($this->images === null) {
+ $this->images = [];
+ foreach ($this->rawXml->preview->images->image as $imageXml) {
+ $this->images[] = new Image($imageXml);
+ }
+ }
+
+ return $this->images;
+ }
+
+ /**
+ * @return string
+ */
+ public function getType(): string
+ {
+ return $this->type;
+ }
+
+ /**
+ * @return string
+ */
+ public function getUrl(): string
+ {
+ return $this->url;
+ }
+
+ /**
+ * @return int
+ */
+ public function getProcessingTime(): int
+ {
+ return $this->processingTime;
+ }
+
+ /**
+ * @return int
+ */
+ public function getLength(): int
+ {
+ return $this->length;
+ }
+
+ /**
+ * @return int
+ */
+ public function getSize(): int
+ {
+ return $this->size;
+ }
+}
diff --git a/src/Core/Image.php b/src/Core/Image.php
new file mode 100644
index 00000000..f7344bb9
--- /dev/null
+++ b/src/Core/Image.php
@@ -0,0 +1,76 @@
+.
+ */
+
+namespace BigBlueButton\Core;
+
+/**
+ * Class Record
+ * @package BigBlueButton\Core
+ */
+class Image
+{
+ private $alt;
+ private $height;
+ private $width;
+ private $url;
+
+ /**
+ * Record constructor.
+ * @param $xml \SimpleXMLElement
+ */
+ public function __construct($xml)
+ {
+ $this->alt = $xml['alt']->__toString();
+ $this->height = (int) $xml['height'];
+ $this->width = (int) $xml['width'];
+ $this->url = $xml->__toString();
+ }
+
+ /**
+ * @return string
+ */
+ public function getAlt(): string
+ {
+ return $this->alt;
+ }
+
+ /**
+ * @return int
+ */
+ public function getHeight(): int
+ {
+ return $this->height;
+ }
+
+ /**
+ * @return int
+ */
+ public function getWidth(): int
+ {
+ return $this->width;
+ }
+
+ /**
+ * @return string
+ */
+ public function getUrl(): string
+ {
+ return $this->url;
+ }
+}
diff --git a/src/Core/Record.php b/src/Core/Record.php
index 41d61fe4..d1c84787 100644
--- a/src/Core/Record.php
+++ b/src/Core/Record.php
@@ -16,6 +16,7 @@
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see .
*/
+
namespace BigBlueButton\Core;
/**
@@ -24,6 +25,12 @@
*/
class Record
{
+
+ /**
+ * @var \SimpleXMLElement
+ */
+ protected $rawXml;
+
private $recordId;
private $meetingId;
private $name;
@@ -31,10 +38,20 @@ class Record
private $state;
private $startTime;
private $endTime;
+ /**
+ * @deprecated deprecated since 2.1.2
+ */
private $playbackType;
+ /**
+ * @deprecated deprecated since 2.1.2
+ */
private $playbackUrl;
+ /**
+ * @deprecated deprecated since 2.1.2
+ */
private $playbackLength;
private $metas;
+ private $formats;
/**
* Record constructor.
@@ -42,6 +59,7 @@ class Record
*/
public function __construct($xml)
{
+ $this->rawXml = $xml;
$this->recordId = $xml->recordID->__toString();
$this->meetingId = $xml->meetingID->__toString();
$this->name = $xml->name->__toString();
@@ -116,6 +134,7 @@ public function getEndTime()
/**
* @return string
+ * @deprecated
*/
public function getPlaybackType()
{
@@ -124,6 +143,7 @@ public function getPlaybackType()
/**
* @return string
+ * @deprecated
*/
public function getPlaybackUrl()
{
@@ -132,6 +152,7 @@ public function getPlaybackUrl()
/**
* @return string
+ * @deprecated
*/
public function getPlaybackLength()
{
@@ -145,4 +166,19 @@ public function getMetas()
{
return $this->metas;
}
+
+ /**
+ * @return Format[]
+ */
+ public function getFormats()
+ {
+ if ($this->formats === null) {
+ $this->formats = [];
+ foreach ($this->rawXml->playback->format as $formatXml) {
+ $this->formats[] = new Format($formatXml);
+ }
+ }
+
+ return $this->formats;
+ }
}
diff --git a/tests/Responses/GetRecordingsResponseTest.php b/tests/Responses/GetRecordingsResponseTest.php
index 71967705..2140522b 100644
--- a/tests/Responses/GetRecordingsResponseTest.php
+++ b/tests/Responses/GetRecordingsResponseTest.php
@@ -16,6 +16,7 @@
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see .
*/
+
namespace BigBlueButton\Parameters;
use BigBlueButton\Responses\GetRecordingsResponse;
@@ -65,6 +66,35 @@ public function testRecordMetadataContent()
$this->assertEquals('moodle-mod_bigbluebuttonbn (2015080611)', $metas['bbb-origin-tag']);
}
+ public function testRecordingsPlaybackFormats()
+ {
+ $this->assertEquals('SUCCESS', $this->records->getReturnCode());
+
+ $this->assertCount(6, $this->records->getRecords());
+ $aRecord = $this->records->getRecords()[0];
+
+ // Test podcast format
+ $podcastFormat = $aRecord->getFormats()[0]; // without images preview
+ $this->assertEquals('podcast', $podcastFormat->getType());
+ $this->assertEquals('https://test-install.blindsidenetworks.com/podcast/f71d810b6e90a4a34ae02b8c7143e8733178578e-1462807897120/audio.ogg', $podcastFormat->getUrl());
+ $this->assertEquals('111', $podcastFormat->getProcessingTime());
+ $this->assertEquals('632', $podcastFormat->getLength());
+ $this->assertEquals('10500', $podcastFormat->getSize());
+
+ $presentationFormat = $aRecord->getFormats()[1]; // having images preview
+ $this->assertEquals('presentation', $presentationFormat->getType());
+ $this->assertEquals('http://test-install.blindsidenetworks.com/playback/presentation/0.9.0/playback.html?meetingId=f71d810b6e90a4a34ae02b8c7143e8733178578e-1462807897120', $presentationFormat->getUrl());
+ $this->assertEquals(2973, $presentationFormat->getProcessingTime());
+ $this->assertEquals(532, $presentationFormat->getLength());
+ $this->assertEquals(168019, $presentationFormat->getSize());
+
+ $image = $presentationFormat->getImages()[0];
+ $this->assertEquals('Welcome', $image->getAlt());
+ $this->assertEquals(136, $image->getHeight());
+ $this->assertEquals(176, $image->getWidth());
+ $this->assertEquals('https://test-install.blindsidenetworks.com/presentation/f71d810b6e90a4a34ae02b8c7143e8733178578e-1462807897120/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1632646357291/thumbnails/thumb-1.png', $image->getUrl());
+ }
+
public function testGetRecordingResponseTypes()
{
$this->assertEachGetterValueIsString($this->records, ['getReturnCode']);
diff --git a/tests/fixtures/get_recordings.xml b/tests/fixtures/get_recordings.xml
index 9a5c51a4..1a3c9bf1 100644
--- a/tests/fixtures/get_recordings.xml
+++ b/tests/fixtures/get_recordings.xml
@@ -21,10 +21,25 @@
+
+ podcast
+ https://test-install.blindsidenetworks.com/podcast/f71d810b6e90a4a34ae02b8c7143e8733178578e-1462807897120/audio.ogg
+ 111
+ 632
+ 10500
+
presentation
http://test-install.blindsidenetworks.com/playback/presentation/0.9.0/playback.html?meetingId=f71d810b6e90a4a34ae02b8c7143e8733178578e-1462807897120
- 44
+ 2973
+ 532
+ 168019
+
+
+ https://test-install.blindsidenetworks.com/presentation/f71d810b6e90a4a34ae02b8c7143e8733178578e-1462807897120/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1632646357291/thumbnails/thumb-1.png
+ https://test-install.blindsidenetworks.com/presentation/f71d810b6e90a4a34ae02b8c7143e8733178578e-1462807897120/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1632646357291/thumbnails/thumb-2.png
+
+
@@ -50,7 +65,7 @@
presentation
- http://test-install.blindsidenetworks.com/playback/presentation/0.9.0/playback.html?meetingId=f71d810b6e90a4a34ae02b8c7143e8733178578e-1463153001071
+ https://test-install.blindsidenetworks.com/playback/presentation/0.9.0/playback.html?meetingId=f71d810b6e90a4a34ae02b8c7143e8733178578e-1463153001071
126
@@ -71,7 +86,8 @@
-
+
+
@@ -125,7 +141,8 @@
-
+
+