Downloading files, calculating video size.

This commit is contained in:
Krzysztof Płaczek
2022-11-17 11:38:20 +01:00
parent 2c62880282
commit 55c104629f
9 changed files with 77 additions and 23 deletions

View File

@@ -1,13 +1,16 @@
<x-layout>
<h1>
{{ $chapter->course->name }}
<br>
<small class="text-muted">{{ $chapter->title }}</small>
</h1>
<div>
<div class="mx-auto" style="width: 500px;">
<video class="mx-auto" width="500" controls>
<source src="/{{ $chapter->video_path }}" type="video/mp4"/>
</video>
@if($chapter->is_video_file)
<video class="mx-auto" width="500" controls>
<source src="/{{ $chapter->video_path }}" type="video/mp4"/>
</video>
@endif
</div>
</div>
</x-layout>

View File

@@ -15,13 +15,16 @@
@foreach($course->chapters()->get() as $chapter)
<tr>
<td><a href="{{ route('course.chapter', ['chapter' => $chapter->id]) }}">{{ $chapter->title }}</a></td>
<td>{{ $chapter->sync_offline?'Yes':'No' }}</td>
<td>{{ $chapter->duration }}</td>
<td>{{ $chapter->sync_offline?'Yes':'no' }}</td>
<td>{{ $chapter->is_video_file?'Yes':'-' }}</td>
</tr>
@endforeach
<tr>
<td></td>
<td>Total: {{ $course->course_duration }}</td>
</tr>
<tr>
<td></td>
<td>Total: {{ $course->course_duration }}</td>
<td></td>
<td>Size: {{ $course->total_size_human }}</td>
</tr>
</table>
</x-layout>