mirror of
https://github.com/koel/koel
synced 2024-11-14 16:37:28 +00:00
23 lines
847 B
PHP
23 lines
847 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Services\Streamer\Adapters\LocalStreamerAdapter;
|
|
use App\Services\Streamer\Adapters\PhpStreamerAdapter;
|
|
use App\Services\Streamer\Adapters\XAccelRedirectStreamerAdapter;
|
|
use App\Services\Streamer\Adapters\XSendFileStreamerAdapter;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class StreamerServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->app->bind(LocalStreamerAdapter::class, function (): LocalStreamerAdapter {
|
|
return match (config('koel.streaming.method')) {
|
|
'x-sendfile' => $this->app->make(XSendFileStreamerAdapter::class),
|
|
'x-accel-redirect' => $this->app->make(XAccelRedirectStreamerAdapter::class),
|
|
default => $this->app->make(PhpStreamerAdapter::class),
|
|
};
|
|
});
|
|
}
|
|
}
|