Changeset View
Changeset View
Standalone View
Standalone View
src/app/OpenVidu/Room.php
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | public function getSessionConnections(): array | ||||
->whereRaw("(role & " . self::ROLE_SCREEN . ") = 0") | ->whereRaw("(role & " . self::ROLE_SCREEN . ") = 0") | ||||
->get() | ->get() | ||||
->keyBy('id') | ->keyBy('id') | ||||
->map(function ($item) { | ->map(function ($item) { | ||||
// Warning: Make sure to not return all metadata here as it might contain sensitive data. | // Warning: Make sure to not return all metadata here as it might contain sensitive data. | ||||
return [ | return [ | ||||
'role' => $item->role, | 'role' => $item->role, | ||||
'hand' => $item->metadata['hand'] ?? 0, | 'hand' => $item->metadata['hand'] ?? 0, | ||||
'language' => $item->metadata['language'] ?? null, | |||||
]; | ]; | ||||
}) | }) | ||||
// Sort by order in the queue, so UI can re-build the existing queue in order | // Sort by order in the queue, so UI can re-build the existing queue in order | ||||
->sort(function ($a, $b) { | ->sort(function ($a, $b) { | ||||
return $a['hand'] <=> $b['hand']; | return $a['hand'] <=> $b['hand']; | ||||
}) | }) | ||||
->all(); | ->all(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 214 Lines • Show Last 20 Lines |