mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
23 lines
702 B
PHP
23 lines
702 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Services\Streamers\LocalStreamer;
|
|
use App\Services\Streamers\PhpStreamer;
|
|
use App\Services\Streamers\XAccelRedirectStreamer;
|
|
use App\Services\Streamers\XSendFileStreamer;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class StreamerServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->app->bind(LocalStreamer::class, static function (): LocalStreamer {
|
|
return match (config('koel.streaming.method')) {
|
|
'x-sendfile' => new XSendFileStreamer(),
|
|
'x-accel-redirect' => new XAccelRedirectStreamer(),
|
|
default => new PhpStreamer(),
|
|
};
|
|
});
|
|
}
|
|
}
|