@php /** * Single-video slide renderer for the product gallery. * * Inputs: * $video array { url, provider: 'video'|'youtube'|'vimeo'|'iframe', thumbnail?: string } * $product \Botble\Ecommerce\Models\Product (used for poster/alt fallback) * * Mirrors plugins/ecommerce/resources/views/themes/includes/product-gallery-video.blade.php * but scoped to ONE video at a time so it slots into a swiper-slide. */ use Illuminate\Support\Facades\File; if (empty($video) || empty($video['url'] ?? null)) { return; } $provider = $video['provider'] ?? 'iframe'; // Theme supports first-party providers only. TikTok/Twitter require external // widget scripts hosted on third-party CDNs (rejected by Envato review). if (in_array($provider, ['tiktok', 'twitter'], true)) { return; } $url = $video['url']; $poster = $video['thumbnail'] ?? null; @endphp
@switch($provider) @case('video') @php $ext = File::extension($url) ?: 'mp4'; if ($ext === 'mov') { $ext = 'mp4'; } $videoId = 'video-' . md5($url); @endphp {{-- 3:4 aspect wrapper matches portrait image slides (576x768). The poster shows behind a circular .bb-button-trigger-play-video overlay; click triggers playback (handled in product-gallery.js) and the .bb-product-video-playing class hides the overlay. --}}
@break @case('youtube') @case('vimeo')
@break @default
@endswitch