Fasse die Bearbeitung in Dialoge und übernimm eine Filmstelle als Titelbild.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
9195cdcd15
commit
c47c3b9b32
9 files changed
+1052
-228
No files matched your search
@@ -10,8 +10,11 @@
|
||||
use App\Domain\Catalog\ContentVersionStatus;
|
||||
use App\Domain\Catalog\StructureNode;
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use App\Domain\Media\ThumbnailDeriver;
|
||||
use App\Filament\Support\EditorialCatalog;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\View\View;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
@@ -146,6 +149,23 @@ private function render(
|
||||
]);
|
||||
}
|
||||
|
||||
public function frame(ContentElementVersion $version, Request $request): Response
|
||||
{
|
||||
$this->authorizeStaff();
|
||||
$version->loadMissing('element');
|
||||
abort_unless($version->element?->output_class === 'film', 404);
|
||||
$seconds = $request->query('sekunde');
|
||||
abort_unless(is_numeric($seconds), 404);
|
||||
|
||||
$bytes = app(ThumbnailDeriver::class)->jpegAtVersion($version, (float) $seconds);
|
||||
abort_unless(is_string($bytes), 404);
|
||||
|
||||
return response($bytes, 200, [
|
||||
'Content-Type' => 'image/jpeg',
|
||||
'Cache-Control' => 'private, no-store',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user