1
0
Fork 0

Update LiveStreamController

This commit is contained in:
Daniel Supernault 2022-06-26 20:54:35 -06:00
parent 433eace75e
commit 19908f6ffb
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 4 additions and 2 deletions

View File

@ -353,6 +353,7 @@ class LiveStreamController extends Controller
public function clientBroadcastPublish(Request $request)
{
abort_if(!config('livestreaming.enabled'), 400);
abort_if($request->ip() != '127.0.0.1', 400);
$key = $request->input('name');
$name = $request->input('name');
@ -368,16 +369,17 @@ class LiveStreamController extends Controller
if($token) {
$stream = LiveStream::whereStreamKey($key)->firstOrFail();
StreamStart::dispatch($stream->profile_id);
return redirect($stream->getStreamRtmpUrl(), 301);
} else {
$stream = LiveStream::whereStreamId($key)->firstOrFail();
StreamStart::dispatch($stream->profile_id);
}
StreamStart::dispatch($stream->profile_id);
if($request->filled('name') && $token == false) {
$stream->live_at = now();
$stream->save();
return [];
} else {
abort(400);