@if (!str_contains(request()->path(), 'folders/search'))
@foreach ($videos as $video)
@if ($video->file_type == 1)
@php
$date = \Carbon\Carbon::parse($video->capture_datetime);
$timeAgoText = $date->format('F j, Y');
$baseFilename = str_replace('.mp4', '', $video->url);
$thumbnailUrls = [];
for ($i = 0; $i < $video->no_of_thumbnails; $i++) {
$thumbnailUrls[] = Storage::disk('s3_thumbnails')->url(
"{$baseFilename}" .
($video->no_of_thumbnails > 1 ? "-{$i}" : '') .
'.jpg',
);
}
@endphp
@endif
@if ($video->file_type == 3)
@php
$thumbnailPath = $video->url;
$thumbnailUrl = Storage::disk('s3_thumbnails')->url($thumbnailPath);
$imageUrl = $video->signedUrl;
$date = \Carbon\Carbon::parse($video->capture_datetime);
$timeAgoText = $date->format('F j, Y');
@endphp
@endif
@if ($video->file_type == 2)
@php
$date = \Carbon\Carbon::parse($video->capture_datetime);
$timeAgoText = $date->format('F j, Y');
$thumbnailPath = $video->url;
$thumbnailUrl = Storage::disk('s3_thumbnails')->url($thumbnailPath);
$imageUrl = $video->signedUrl;
$thumbnailPathJpg =
pathinfo($thumbnailPath, PATHINFO_DIRNAME) .
'/' .
pathinfo($thumbnailPath, PATHINFO_FILENAME) .
'.jpg';
$thumbnailUrlJpg = Storage::disk('s3_thumbnails')->url($thumbnailPathJpg);
$isDocxFile = Str::endsWith($video->url, '.docx');
@endphp
@if (!$isDocxFile)
@elseif ($isDocxFile)
@endif
@endif
@if ($video->file_type == 4)
@endif
{{-- @if ($video->file_type == 3)
@php
$thumbnailPath = $video->url;
$thumbnailUrl = Storage::disk('s3_thumbnails')->url($thumbnailPath);
$imageUrl = $video->signedUrl;
@endphp
@endif --}}
@endforeach
@endif