Displaying videos directly from link from symfony cast website without downloading.
This commit is contained in:
@@ -10,15 +10,17 @@ class ChapterController extends Controller
|
||||
public function __invoke(Course $course, int $chapter, SymfonyCastDlService $symfonyCastDlService)
|
||||
{
|
||||
$chapter = $course->chapters->firstWhere('order', $chapter);
|
||||
|
||||
$symfonyCastDlService->videoSize($chapter);
|
||||
if ($chapter->sync_offline) {
|
||||
$symfonyCastDlService->downloadFile($chapter);
|
||||
$videoUrl = $chapter->video_url;
|
||||
} else {
|
||||
$videoUrl = $symfonyCastDlService->getChapterInfo($chapter);
|
||||
}
|
||||
$chapters = $chapter->course->chapters;
|
||||
|
||||
$chapters = $chapter->course->chapters;
|
||||
$next = $chapters->where('order', '>', $chapter->order)->first();
|
||||
$prev = $chapters->where('order', '<', $chapter->order)->sortByDesc('order')->first();
|
||||
return view('chapter.index', compact('chapter', 'chapters', 'prev', 'next'));
|
||||
return view('chapter.index', compact('chapter', 'chapters', 'prev', 'next', 'videoUrl'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user