@extends('layouts.app') @section('title', $stream->title.' — Live') @section('extra_styles') @endsection @section('content')
@php $isEnded = $stream->status === \App\Models\LiveStream::STATUS_ENDED; $isLive = $stream->status === \App\Models\LiveStream::STATUS_LIVE; @endphp
LIVE
{{-- Ended stream: show "Stream ended" + duration right from the server; if a recording exists, surface a Watch Replay CTA. --}} @if ($isEnded)
Stream ended
@if ($stream->started_at && $stream->ended_at)
{{ $stream->ended_at->diffForHumans($stream->started_at, ['parts' => 2, 'syntax' => \Carbon\CarbonInterface::DIFF_ABSOLUTE]) }} · ended {{ $stream->ended_at->diffForHumans() }}
@endif @if ($stream->video_id) Watch replay @endif
@else
Connecting…
@endif

{{ $stream->title }}

{{-- Channel name is now a real link to the uploader's channel. --}} @if ($stream->user) {{ $stream->user->name }} @endif {{ $stream->current_viewers }} watching @if ($stream->started_at) started {{ $stream->started_at->diffForHumans() }} @endif
@if ($stream->description)
{{ $stream->description }}
@endif
@if ($isOwner) Broadcast controls @endif
{{-- Viewer actions row — mirrors the watch page's action bar on a smaller canvas. Share works for everyone; Subscribe is auth-gated with the Phase-7 ?intended= bounce; the owner never sees Subscribe. --}} @if ($stream->user && (! Auth::check() || Auth::id() !== $stream->user_id))
@auth @php $isSub = Auth::user()->isSubscribedTo($stream->user); @endphp @else @endauth
@endif {{-- ── Live chat panel ─────────────────────────────── --}} @if ($isLive)
Live chat
Say hi 👋
@csrf
@endif
@endsection @section('scripts') @unless($isEnded) @endunless @endsection