alltube/classes/streams/ConvertedPlaylistArchiveStream.php

37 lines
768 B
PHP
Raw Normal View History

<?php
2019-10-03 19:41:54 +00:00
/**
* ConvertedPlaylistArchiveStream class.
*/
namespace Alltube\Stream;
use Alltube\Video;
2020-05-13 19:18:32 +00:00
use Exception;
use Slim\Http\Stream;
2019-04-21 22:05:53 +00:00
/**
* Class used to create a Zip archive from converted playlists entries.
*/
class ConvertedPlaylistArchiveStream extends PlaylistArchiveStream
{
/**
* Start streaming a new video.
*
* @param Video $video Video to stream
*
* @return void
2020-05-13 19:18:32 +00:00
* @throws Exception
*/
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
);
}
}