{{ __('filament-media-action::media-action.loading') }}
@if ($mediaType === 'youtube') @php $youtubeId = ''; // Parse the URL to get components $parsedUrl = parse_url($media); if (isset($parsedUrl['host'])) { // Check if it's a youtu.be short URL if (strpos($parsedUrl['host'], 'youtu.be') !== false) { // Get the path and extract the video ID $youtubeId = ltrim($parsedUrl['path'], '/'); } // Check if it's a regular youtube.com URL elseif (strpos($parsedUrl['host'], 'youtube.com') !== false) { // Extract the query parameters and get the 'v' parameter parse_str($parsedUrl['query'], $queryParams); $youtubeId = $queryParams['v'] ?? ''; } } @endphp @if ($youtubeId) @else

Invalid YouTube URL.

@endif @elseif ($mediaType === 'audio') @elseif ($mediaType === 'video') @elseif ($mediaType === 'image') Media Image @elseif ($mediaType === 'pdf') @else

Unsupported media type.

@endif