Displaying videos directly from link from symfony cast website without downloading.
This commit is contained in:
@@ -49,7 +49,6 @@ class HtmlParser
|
||||
foreach ($document->find('ul.chapter-list li') as $chapterItem) {
|
||||
if ($chapterItem->first('.col')) {
|
||||
$chapterId++;
|
||||
|
||||
$chapter = Chapter::firstOrNew(['course_id' => $courseId, 'order' => $chapterId]);
|
||||
$chapter->duration = $chapterItem->first('.length-styling')?->text();
|
||||
$chapter->order = $chapterId;
|
||||
@@ -63,8 +62,13 @@ class HtmlParser
|
||||
$chapters->add($chapter);
|
||||
}
|
||||
}
|
||||
|
||||
return $chapters;
|
||||
}
|
||||
|
||||
public function getVideoSource(Response $respose): string
|
||||
{
|
||||
$document = new Document($respose->getBody()->getContents());
|
||||
return $document->first('video source')->getAttribute('src');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user