mirror of
https://github.com/koel/koel
synced 2024-11-24 05:03:05 +00:00
24 lines
631 B
PHP
24 lines
631 B
PHP
<?php
|
|
|
|
namespace App\Services\Streamers;
|
|
|
|
use App\Services\SongStorages\S3CompatibleStorage;
|
|
use Illuminate\Http\RedirectResponse;
|
|
use Illuminate\Routing\Redirector;
|
|
|
|
class S3CompatibleStreamer extends Streamer
|
|
{
|
|
public function __construct(private S3CompatibleStorage $storage)
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Stream the current song from the Object Storable server.
|
|
* Actually, we just redirect the request to the object's presigned URL.
|
|
*/
|
|
public function stream(): Redirector|RedirectResponse
|
|
{
|
|
return redirect($this->storage->getSongPresignedUrl($this->song));
|
|
}
|
|
}
|