Handling the case when there is no video yet, locally or online.

This commit is contained in:
Krzysztof Płaczek
2023-04-08 09:52:44 +02:00
parent a15c6a1a44
commit cfc84a1d4d
3 changed files with 7 additions and 5 deletions

View File

@@ -65,10 +65,10 @@ class HtmlParser
return $chapters;
}
public function getVideoSource(Response $respose): string
public function getVideoSource(Response $respose): ?string
{
$document = new Document($respose->getBody()->getContents());
return $document->first('video source')->getAttribute('src');
return $document->first('video source')?->getAttribute('src');
}
}