mirror of
https://github.com/koel/koel
synced 2024-12-19 09:03:07 +00:00
24 lines
564 B
PHP
24 lines
564 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Factories\StreamerFactory;
|
|
use App\Http\Requests\SongPlayRequest;
|
|
use App\Models\Song;
|
|
|
|
class PlayController extends Controller
|
|
{
|
|
public function __invoke(
|
|
StreamerFactory $streamerFactory,
|
|
SongPlayRequest $request,
|
|
Song $song,
|
|
?bool $transcode = null,
|
|
?int $bitRate = null
|
|
) {
|
|
$this->authorize('access', $song);
|
|
|
|
return $streamerFactory
|
|
->createStreamer($song, $transcode, $bitRate, (float) $request->time)
|
|
->stream();
|
|
}
|
|
}
|