Fix LiveKit egress preset call and attach completion webhook per job.
Deploy Ladill Meet / deploy (push) Successful in 45s
Deploy Ladill Meet / deploy (push) Successful in 45s
Pass null encoding preset to match the PHP SDK, and register the meet webhook on each egress start so LiveKit Cloud does not need a global webhook URL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,9 +8,9 @@ use App\Models\Session;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Livekit\EncodedFileOutput;
|
||||
use Livekit\EncodedFileType;
|
||||
use Livekit\EncodingOptionsPreset;
|
||||
use Livekit\EgressInfo;
|
||||
use Livekit\S3Upload;
|
||||
use Livekit\WebhookConfig;
|
||||
use RuntimeException;
|
||||
|
||||
class LiveKitEgressService
|
||||
@@ -41,14 +41,16 @@ class LiveKitEgressService
|
||||
$client = $this->client();
|
||||
$layout = $this->egressLayout($recording->layout);
|
||||
$output = $this->buildFileOutput($session, $recording);
|
||||
$preset = EncodingOptionsPreset::H264_720P_30;
|
||||
|
||||
return $client->startRoomCompositeEgress(
|
||||
$session->media_room_name,
|
||||
$layout,
|
||||
$output,
|
||||
$preset,
|
||||
null,
|
||||
$audioOnly,
|
||||
false,
|
||||
'',
|
||||
\Livekit\AudioMixing::DEFAULT_MIXING,
|
||||
$this->egressWebhooks(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -122,6 +124,19 @@ class LiveKitEgressService
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<WebhookConfig>
|
||||
*/
|
||||
protected function egressWebhooks(): array
|
||||
{
|
||||
$url = (string) config('meet.recordings.egress.webhook_url', '');
|
||||
if ($url === '') {
|
||||
$url = rtrim((string) config('app.url'), '/').'/api/livekit/webhook';
|
||||
}
|
||||
|
||||
return [new WebhookConfig(['url' => $url])];
|
||||
}
|
||||
|
||||
public function tryStart(Session $session, Recording $recording): ?array
|
||||
{
|
||||
if (! $this->isAvailable()) {
|
||||
|
||||
Reference in New Issue
Block a user