@foreach ($folders as $folder)
@endforeach
@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++) {
$thumbnailPath =
"{$baseFilename}" .
($video->no_of_thumbnails > 1 ? "-{$i}" : '') .
'.jpg';
//if (Storage::disk('s3_thumbnails')->exists($thumbnailPath)) {
$thumbnailUrls[] = Storage::disk('s3_thumbnails')->url($thumbnailPath);
//}
}
$defaultThumbnailUrl = asset('assets/img/video-thumbnail-placeholder.png');
$thumbnailToShow =
count($thumbnailUrls) > 0 ? $thumbnailUrls[0] : $defaultThumbnailUrl;
$hasValidThumbnail = count($thumbnailUrls) > 0;
@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 == 3)
@php
$date = \Carbon\Carbon::parse($video->capture_datetime);
$timeAgoText = $date->format('F j, Y');
$thumbnailPath = $video->url;
$thumbnailUrl = Storage::disk('s3_thumbnails')->url($thumbnailPath);
$extensions = ['jpg', 'jpeg', 'png' /* , 'JPG', 'PNG', 'JPEG' */];
$thumbnailUrlJpg = null;
$thumbnailExtension = pathinfo($thumbnailPath, PATHINFO_EXTENSION);
$thumbnailPathWithExt =
pathinfo($thumbnailPath, PATHINFO_DIRNAME) .
'/' .
pathinfo($thumbnailPath, PATHINFO_FILENAME) .
'.' .
$thumbnailExtension;
$thumbnailUrlJpg = Storage::disk('s3_thumbnails')->url($thumbnailPathWithExt);
$imageUrl = $video->signedUrl;
@endphp
@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
@if (!($folders->count() > 0 || $videos->count() > 0))
No sub folders or files found.
@endif
@if (!($folders->count() > 0 || $videos->count() > 0))
No sub folders or files found.