forked from mirror/pixelfed
Update LiveStreamController
This commit is contained in:
parent
433eace75e
commit
19908f6ffb
1 changed files with 4 additions and 2 deletions
|
@ -353,6 +353,7 @@ class LiveStreamController extends Controller
|
||||||
public function clientBroadcastPublish(Request $request)
|
public function clientBroadcastPublish(Request $request)
|
||||||
{
|
{
|
||||||
abort_if(!config('livestreaming.enabled'), 400);
|
abort_if(!config('livestreaming.enabled'), 400);
|
||||||
|
abort_if($request->ip() != '127.0.0.1', 400);
|
||||||
$key = $request->input('name');
|
$key = $request->input('name');
|
||||||
$name = $request->input('name');
|
$name = $request->input('name');
|
||||||
|
|
||||||
|
@ -368,16 +369,17 @@ class LiveStreamController extends Controller
|
||||||
|
|
||||||
if($token) {
|
if($token) {
|
||||||
$stream = LiveStream::whereStreamKey($key)->firstOrFail();
|
$stream = LiveStream::whereStreamKey($key)->firstOrFail();
|
||||||
StreamStart::dispatch($stream->profile_id);
|
|
||||||
return redirect($stream->getStreamRtmpUrl(), 301);
|
return redirect($stream->getStreamRtmpUrl(), 301);
|
||||||
} else {
|
} else {
|
||||||
$stream = LiveStream::whereStreamId($key)->firstOrFail();
|
$stream = LiveStream::whereStreamId($key)->firstOrFail();
|
||||||
StreamStart::dispatch($stream->profile_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StreamStart::dispatch($stream->profile_id);
|
||||||
|
|
||||||
if($request->filled('name') && $token == false) {
|
if($request->filled('name') && $token == false) {
|
||||||
$stream->live_at = now();
|
$stream->live_at = now();
|
||||||
$stream->save();
|
$stream->save();
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
} else {
|
} else {
|
||||||
abort(400);
|
abort(400);
|
||||||
|
|
Loading…
Reference in a new issue