@props([ 'projectType' => 'pool', 'heading' => '', 'class' => '', 'autoplay' => false, 'muted' => true, 'loop' => true, 'controls' => false, ]) @php use App\Support\ScraperDetector; // Determinar el tipo de proyecto y configurar assets $videoSrc = match ($projectType) { 'pavers' => asset('estimates/assets/videos/pavers.mp4'), 'pool' => asset('estimates/assets/videos/pools.mp4'), default => asset('estimates/assets/videos/pools.mp4'), }; $videoOptions = []; if ($autoplay) { $videoOptions[] = 'autoplay'; } if ($muted) { $videoOptions[] = 'muted'; } if ($loop) { $videoOptions[] = 'loop'; } if ($controls) { $videoOptions[] = 'controls'; } $videoOptions = implode(' ', $videoOptions); $posterSrc = match ($projectType) { 'pavers' => asset('images/others/estimate-paver.jpg'), 'pool' => asset('images/others/estimate-pool.jpg'), default => asset('images/others/estimate-pool.jpg'), }; $altText = match ($projectType) { 'pavers' => 'Custom Pavers Project', 'pool' => 'Pool Project', default => 'Project', }; // Verificar si es un bot/scraper $isBot = ScraperDetector::isBot(); @endphp @if ($isBot) {{-- Contenido estático para bots/scrapers --}}
{{ $altText }} @if ($heading)
{{ $heading }}
@endif
@else {{-- Contenido dinámico para usuarios reales --}}
{{-- Poster --}} {{ $altText }} {{-- Video Element --}} @if ($heading)
{{ $heading }}
@endif {{-- Progress Bar --}}
@endif