Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/OpenViduController.php
Show First 20 Lines • Show All 303 Lines • ▼ Show 20 Lines | public function joinRoom($id) | ||||
return $this->errorResponse(422, $error, $response + ['code' => 327]); | return $this->errorResponse(422, $error, $response + ['code' => 327]); | ||||
} | } | ||||
} | } | ||||
// Initialize connection tokens | // Initialize connection tokens | ||||
if ($init) { | if ($init) { | ||||
// Choose the connection role | // Choose the connection role | ||||
$canPublish = empty($config['nomedia']) && !empty(request()->input('canPublish')); | $canPublish = !empty(request()->input('canPublish')) && (empty($config['nomedia']) || $isOwner); | ||||
$role = $canPublish ? Room::ROLE_PUBLISHER : Room::ROLE_SUBSCRIBER; | $role = $canPublish ? Room::ROLE_PUBLISHER : Room::ROLE_SUBSCRIBER; | ||||
if ($isOwner) { | if ($isOwner) { | ||||
$role |= Room::ROLE_MODERATOR; | $role |= Room::ROLE_MODERATOR; | ||||
$role |= Room::ROLE_OWNER; | $role |= Room::ROLE_OWNER; | ||||
} | } | ||||
// Create session token for the current user/connection | // Create session token for the current user/connection | ||||
$response = $room->getSessionToken($role); | $response = $room->getSessionToken($role); | ||||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |