Make RTMP videos work in stream mode (fixes #104)
This commit is contained in:
parent
d2ad962f6f
commit
fb3834296a
4 changed files with 68 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue