Deploy Ladill Meet / deploy (push) Successful in 53s
Capture the meeting in the host browser, upload to Ladill storage on stop, and remove the LiveKit egress placeholder job. Co-authored-by: Cursor <cursoragent@cursor.com>
68 lines
2.5 KiB
PHP
68 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Meet;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Controllers\Meet\Concerns\ScopesToAccount;
|
|
use App\Models\Recording;
|
|
use App\Services\Meet\RecordingService;
|
|
use Illuminate\Http\RedirectResponse;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Illuminate\View\View;
|
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
|
|
|
class RecordingController extends Controller
|
|
{
|
|
use ScopesToAccount;
|
|
|
|
public function __construct(
|
|
protected RecordingService $recordings,
|
|
) {}
|
|
|
|
public function index(Request $request): View
|
|
{
|
|
$this->authorizeAbility($request, 'meetings.view');
|
|
$owner = $this->ownerRef($request);
|
|
$organization = $this->organization($request);
|
|
|
|
$recordings = Recording::owned($owner)
|
|
->whereHas('session.room', fn ($q) => $q->where('organization_id', $organization->id))
|
|
->with(['session.room'])
|
|
->orderByDesc('created_at')
|
|
->paginate(20);
|
|
|
|
return view('meet.recordings.index', compact('recordings'));
|
|
}
|
|
|
|
public function show(Request $request, Recording $recording): View
|
|
{
|
|
$this->authorizeAbility($request, 'meetings.view');
|
|
$this->authorizeOwner($request, $recording);
|
|
$recording->load(['session.room', 'session.participants']);
|
|
|
|
return view('meet.recordings.show', compact('recording'));
|
|
}
|
|
|
|
public function download(Request $request, Recording $recording): StreamedResponse
|
|
{
|
|
$this->authorizeAbility($request, 'meetings.view');
|
|
$this->authorizeOwner($request, $recording);
|
|
abort_unless($recording->isReady() && $recording->storage_path, 404);
|
|
abort_unless(app(\App\Services\Meet\MeetBillingService::class)->storageIsAccessible($recording), 402, 'Recording storage billing is overdue. Top up your Ladill wallet to download this recording.');
|
|
|
|
return Storage::disk(config('meet.recordings.disk', 'local'))
|
|
->download($recording->storage_path, $recording->session->room->title.'.'.pathinfo($recording->storage_path, PATHINFO_EXTENSION));
|
|
}
|
|
|
|
public function destroy(Request $request, Recording $recording): RedirectResponse
|
|
{
|
|
$this->authorizeAbility($request, 'meetings.manage');
|
|
$this->authorizeOwner($request, $recording);
|
|
|
|
$this->recordings->delete($recording, $this->ownerRef($request));
|
|
|
|
return redirect()->route('meet.recordings.index')->with('success', 'Recording deleted.');
|
|
}
|
|
}
|