2024-02-24 07:28:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services\Streamer\Adapters;
|
|
|
|
|
|
|
|
use App\Models\Song;
|
|
|
|
use App\Services\SongStorages\DropboxStorage;
|
|
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
use Illuminate\Routing\Redirector;
|
|
|
|
|
|
|
|
class DropboxStreamerAdapter implements StreamerAdapter
|
|
|
|
{
|
2024-04-18 14:36:28 +00:00
|
|
|
public function __construct(private readonly DropboxStorage $storage)
|
2024-02-24 07:28:49 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function stream(Song $song, array $config = []): Redirector|RedirectResponse
|
|
|
|
{
|
|
|
|
return redirect($this->storage->getSongPresignedUrl($song));
|
|
|
|
}
|
|
|
|
}
|