Make RTMP videos work in stream mode (fixes #104)

This commit is contained in:
Pierre Rudloff 2017-04-24 18:31:14 +02:00
parent d2ad962f6f
commit fb3834296a
4 changed files with 68 additions and 1 deletions

View file

@ -305,7 +305,13 @@ class FrontController
private function getStream($url, $format, $response, $request, $password = null)
{
$video = $this->download->getJSON($url, $format, $password);
if ($video->protocol == 'm3u8') {
if ($video->protocol == 'rtmp') {
$stream = $this->download->getRtmpStream($video);
$response = $response->withHeader('Content-Type', 'video/'.$video->ext);
if ($request->isGet()) {
$response = $response->withBody(new Stream($stream));
}
} elseif ($video->protocol == 'm3u8') {
$stream = $this->download->getM3uStream($video);
$response = $response->withHeader('Content-Type', 'video/'.$video->ext);
if ($request->isGet()) {