@extends('layouts.app') @section('title', $playlist->name . ' | ' . config('app.name')) @push('head') @php $plDesc = trim($playlist->description ?? ''); if ($plDesc === '') { $plDesc = $playlist->video_count . ' videos' . ($playlist->user ? ' • by ' . $playlist->user->name : ''); } $plShareUrl = route('playlists.showByToken', $playlist->share_token); // Use the dedicated OG endpoint so previews always get a 1200x630 JPG under the // size/format limits of WhatsApp/Telegram/Discord/etc. $plOgImage = route('playlists.ogImage', $playlist); @endphp @endpush @section('extra_styles') @endsection @section('content') @php $canEdit = $playlist->canEdit(Auth::user()); $firstVideo = $videos->first(); $firstUrl = $firstVideo ? route('videos.show', $firstVideo) . '?playlist=' . $playlist->share_token : null; $thumbBg = $playlist->thumbnail_url; @endphp
{{-- ══ Hero Header ══ --}}
{{-- Thumbnail --}}
{{ $playlist->name }}
{{ $videos->count() }}
{{-- Info --}}
Playlist

{{ $playlist->name }}

@if($playlist->user) {{ $playlist->user->name }} · @endif {{ $videos->count() }} {{ Str::plural('video', $videos->count()) }} @if($playlist->formatted_duration) · {{ $playlist->formatted_duration }} @endif @if($playlist->is_default) Watch Later @elseif($playlist->visibility === 'private') Private @elseif($playlist->visibility === 'unlisted') Unlisted @else Public @endif
@if($playlist->description)
{{ $playlist->description }}
@endif
@if($firstUrl) Play All @endif @if($canEdit) @endif
{{-- ══ Video List ══ --}} @if($videos->isEmpty())

No videos yet

Add videos to this playlist to start watching.

@else
{{ $playlist->name }} {{ $videos->count() }} {{ Str::plural('video', $videos->count()) }}
@foreach($videos as $i => $video)
@if($canEdit) @endif
{{ $i + 1 }}
{{ $video->title }} @if($video->duration) {{ $video->formatted_duration }} @endif
{{ $video->title }}
@if(optional($video->user)->name) {{ $video->user->name }} @endif @if($video->view_count) · {{ number_format($video->view_count) }} views @endif @if($video->type && $video->type !== 'generic') · {{ $video->type }} @endif
@if($canEdit)
@csrf @method('DELETE')
@endif
@endforeach
@endif
{{-- ══ Edit Playlist Modal ══ --}} @if($canEdit) @endif @endsection @section('scripts') @php $plVideosJson = $videos->map(fn($v) => [ 'id' => $v->id, 'showUrl' => route('videos.show', $v) . '?playlist=' . $playlist->share_token, ])->values()->all(); @endphp @endsection