2019-04-21 22:56:07 +02:00
|
|
|
<?php
|
2019-10-03 21:41:54 +02:00
|
|
|
|
2019-04-21 22:56:07 +02:00
|
|
|
/**
|
|
|
|
* ConvertedPlaylistArchiveStream class.
|
|
|
|
*/
|
|
|
|
|
2019-04-22 21:06:05 +02:00
|
|
|
namespace Alltube\Stream;
|
2019-04-21 22:56:07 +02:00
|
|
|
|
2019-04-22 21:06:05 +02:00
|
|
|
use Alltube\Video;
|
2019-04-21 22:56:07 +02:00
|
|
|
use Slim\Http\Stream;
|
|
|
|
|
2019-04-22 00:05:53 +02:00
|
|
|
/**
|
|
|
|
* Class used to create a Zip archive from converted playlists entries.
|
|
|
|
*/
|
2019-04-21 22:56:07 +02:00
|
|
|
class ConvertedPlaylistArchiveStream extends PlaylistArchiveStream
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Start streaming a new video.
|
|
|
|
*
|
|
|
|
* @param Video $video Video to stream
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function startVideoStream(Video $video)
|
|
|
|
{
|
|
|
|
$this->curVideoStream = new Stream($video->getAudioStream());
|
|
|
|
|
|
|
|
$this->init_file_stream_transfer(
|
|
|
|
$video->getFileNameWithExtension('mp3'),
|
|
|
|
// The ZIP format does not care about the file size.
|
|
|
|
0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|