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

@ -196,6 +196,23 @@ class VideoDownloadTest extends \PHPUnit_Framework_TestCase
];
}
/**
* Provides RTMP URLs for tests.
*
* @return array[]
*/
public function rtmpUrlProvider()
{
return [
[
'http://www.rtl2.de/sendung/grip-das-motormagazin/folge/folge-203-0', 'bestaudio/best',
'GRIP sucht den Sommerkönig-folge-203-0',
'f4v',
'edgefcs.net',
],
];
}
/**
* Provides incorrect URLs for tests.
*
@ -373,6 +390,23 @@ class VideoDownloadTest extends \PHPUnit_Framework_TestCase
$this->assertFalse(feof($stream));
}
/**
* Test getRtmpStream function.
*
* @param string $url URL
* @param string $format Format
*
* @return void
* @dataProvider rtmpUrlProvider
*/
public function testGetRtmpStream($url, $format)
{
$video = $this->download->getJSON($url, $format);
$stream = $this->download->getRtmpStream($video);
$this->assertInternalType('resource', $stream);
$this->assertFalse(feof($stream));
}
/**
* Test getM3uStream function without avconv.
*