mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 00:05:29 +00:00
Update livestream config
This commit is contained in:
parent
5206f21f59
commit
00770c6002
3 changed files with 28 additions and 6 deletions
|
@ -217,4 +217,20 @@ class LiveStreamController extends Controller
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
public function getConfig(Request $request)
|
||||
{
|
||||
abort_if(!config('livestreaming.enabled'), 400);
|
||||
abort_if(!$request->user(), 403);
|
||||
|
||||
$res = [
|
||||
'enabled' => config('livestreaming.enabled'),
|
||||
'broadcast' => [
|
||||
'sources' => config('livestreaming.broadcast.sources'),
|
||||
'limits' => config('livestreaming.broadcast.limits')
|
||||
],
|
||||
];
|
||||
|
||||
return response()->json($res, 200, [], JSON_UNESCAPED_SLASHES);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,14 +10,19 @@ return [
|
|||
],
|
||||
|
||||
'broadcast' => [
|
||||
'max_duration' => env('HLS_LIVE_BROADCAST_MAX_DURATION', 60),
|
||||
'max_active' => env('HLS_LIVE_BROADCAST_MAX_ACTIVE', 10),
|
||||
'max_duration' => (int) env('HLS_LIVE_BROADCAST_MAX_DURATION', 60),
|
||||
'max_active' => (int) env('HLS_LIVE_BROADCAST_MAX_ACTIVE', 10),
|
||||
|
||||
'limits' => [
|
||||
'enabled' => env('HLS_LIVE_BROADCAST_LIMITS', true),
|
||||
'min_follower_count' => env('HLS_LIVE_BROADCAST_LIMITS_MIN_FOLLOWERS', 100),
|
||||
'min_account_age' => env('HLS_LIVE_BROADCAST_LIMITS_MIN_ACCOUNT_AGE', 14),
|
||||
'admins_only' => env('HLS_LIVE_BROADCAST_LIMITS_ADMINS_ONLY', true)
|
||||
'enabled' => (bool) env('HLS_LIVE_BROADCAST_LIMITS', true),
|
||||
'min_follower_count' => (int) env('HLS_LIVE_BROADCAST_LIMITS_MIN_FOLLOWERS', 100),
|
||||
'min_account_age' => (int) env('HLS_LIVE_BROADCAST_LIMITS_MIN_ACCOUNT_AGE', 14),
|
||||
'admins_only' => (bool) env('HLS_LIVE_BROADCAST_LIMITS_ADMINS_ONLY', true)
|
||||
],
|
||||
|
||||
'sources' => [
|
||||
'app' => (bool) env('HLS_LIVE_BROADCAST_SOURCE_APP', false),
|
||||
'web' => (bool) env('HLS_LIVE_BROADCAST_SOURCE_WEB', false)
|
||||
]
|
||||
],
|
||||
|
||||
|
|
|
@ -105,5 +105,6 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
|
|||
Route::get('chat/latest', 'LiveStreamController@getLatestChat')->middleware($middleware);
|
||||
Route::post('chat/message', 'LiveStreamController@addChatComment')->middleware($middleware);
|
||||
Route::post('chat/delete', 'LiveStreamController@deleteChatComment')->middleware($middleware);
|
||||
Route::get('config', 'LiveStreamController@getConfig')->middleware($middleware);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue