@extends($layout) @section('styles') @endsection @section('content')
{{-- --}} @if (isset($folders) && $folders->count() > 0)
{{--
Recent Folders
--}}
@if ($folders->count() > 0)
@foreach ($folders as $folder) @endforeach @role('admin') @endrole
@endif {{-- Show all --}}
@if (!($folders->count() > 0 || $videos->count() > 0))

No sub folders found.

@endif @if (!($folders->count() > 0 || $videos->count() > 0))

No sub folders found.

@endif
@else {{--

No sub folders or files found.

--}} @endif
@if (strpos(request()->url(), '/home/search') === false)
@endif @php $videosOnly = $videos->filter(function ($video) { return $video->file_type == 1; }); $documentsOnly = $videos->filter(function ($video) { return $video->file_type == 2; }); @endphp
@if ($videosOnly->isNotEmpty())
{{-- @include('partials.videos', ['video' => $videos]) --}} @if ($videos->count() > 0) @foreach ($videos as $video) @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 @if ($video->file_type == 1) @endif @endforeach @else

No files found.

@endif
@endif
@endsection @section('script') @endsection