mirror of
https://github.com/koel/koel
synced 2024-12-21 01:53:11 +00:00
21 lines
513 B
PHP
21 lines
513 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Services\Streamer\Adapters;
|
||
|
|
||
|
use App\Models\Song;
|
||
|
use App\Services\SongStorages\S3CompatibleStorage;
|
||
|
use Illuminate\Http\RedirectResponse;
|
||
|
use Illuminate\Routing\Redirector;
|
||
|
|
||
|
class S3CompatibleStreamerAdapter implements StreamerAdapter
|
||
|
{
|
||
|
public function __construct(private S3CompatibleStorage $storage)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public function stream(Song $song, array $config = []): Redirector|RedirectResponse
|
||
|
{
|
||
|
return redirect($this->storage->getSongPresignedUrl($song));
|
||
|
}
|
||
|
}
|