|
@@ -209,7 +209,7 @@ discard block |
|
|
block discarded – undo |
|
209
|
209
|
switch ($response->getStatusCode()) { |
|
210
|
210
|
case 204: |
|
211
|
211
|
$connectionClosed = null; |
|
212
|
|
- $this->activeConnections = array_filter($this->activeConnections, function (Connection $connection) use ($connectionId) { |
|
|
212
|
+ $this->activeConnections = array_filter($this->activeConnections, function(Connection $connection) use ($connectionId) { |
|
213
|
213
|
if ($connection->getConnectionId() !== $connectionId) { |
|
214
|
214
|
return true; |
|
215
|
215
|
} else { |
|
@@ -221,7 +221,7 @@ discard block |
|
|
block discarded – undo |
|
221
|
221
|
if ($connectionClosed != null) { |
|
222
|
222
|
foreach ($connectionClosed->getPublishers() as $publisher) { |
|
223
|
223
|
foreach ($this->activeConnections as $con) { |
|
224
|
|
- $con->subscribers = array_filter($con->subscribers, function ($subscriber) use ($publisher) { |
|
|
224
|
+ $con->subscribers = array_filter($con->subscribers, function($subscriber) use ($publisher) { |
|
225
|
225
|
if (is_array($subscriber) && array_key_exists('streamId', $subscriber)) { |
|
226
|
226
|
// Subscriber with advanced webRtc configuration properties |
|
227
|
227
|
return $subscriber['streamId'] !== $publisher->streamId; |
|
@@ -281,12 +281,12 @@ discard block |
|
|
block discarded – undo |
|
281
|
281
|
switch ($response->getStatusCode()) { |
|
282
|
282
|
case 204: |
|
283
|
283
|
foreach ($this->activeConnections as $connection) { |
|
284
|
|
- $connection->publishers = array_filter($connection->publishers, function (array $publisher) use ($streamId) { |
|
|
284
|
+ $connection->publishers = array_filter($connection->publishers, function(array $publisher) use ($streamId) { |
|
285
|
285
|
return $streamId !== $publisher->getStreamId(); |
|
286
|
286
|
}); |
|
287
|
287
|
|
|
288
|
288
|
if ($connection->subscribers && count($connection->subscribers) > 0) { |
|
289
|
|
- $connection->subscribers = array_filter($connection->subscribers, function (array $subscriber) use ($streamId) { |
|
|
289
|
+ $connection->subscribers = array_filter($connection->subscribers, function(array $subscriber) use ($streamId) { |
|
290
|
290
|
if (array_key_exists('streamId', $subscriber)) { |
|
291
|
291
|
// Subscriber with advanced webRtc configuration properties |
|
292
|
292
|
return $subscriber['streamId'] !== $streamId; |
|
@@ -432,7 +432,7 @@ discard block |
|
|
block discarded – undo |
|
432
|
432
|
$JSONSession = json_decode($json); |
|
433
|
433
|
$this->sessionId = $JSONSession->sessionId; |
|
434
|
434
|
$this->createdAt = isset($JSONSession->createdAt) ? $JSONSession->createdAt : null; |
|
435
|
|
- $this->recording = isset($JSONSession->recording) ? $this->recording : null;; |
|
|
435
|
+ $this->recording = isset($JSONSession->recording) ? $this->recording : null; ; |
|
436
|
436
|
|
|
437
|
437
|
if (isset($JSONSession->properties)) { |
|
438
|
438
|
$this->properties = new SessionProperties($JSONSession->properties->mediaMode, $JSONSession->properties->recordingMode, $JSONSession->properties->defaultOutputMode, isset($JSONSession->properties->defaultRecordingLayout) ? $JSONSession->properties->defaultRecordingLayout : null, |
|
@@ -456,7 +456,7 @@ discard block |
|
|
block discarded – undo |
|
456
|
456
|
} |
|
457
|
457
|
$this->activeConnections[] = new Connection($content->connectionId, $content->createdAt, $content->role, $content->token, $content->location, $content->platform, $content->serverData, $content->clientData, $publishers, $subscribers); |
|
458
|
458
|
} |
|
459
|
|
- usort($this->activeConnections[], function ($a, $b) { |
|
|
459
|
+ usort($this->activeConnections[], function($a, $b) { |
|
460
|
460
|
if ($a->createdAt > $b->createdAt) { |
|
461
|
461
|
return 1; |
|
462
|
462
|
} |