alltube/classes/Stream/ConvertedPlaylistArchiveStream.php

37 lines
847 B
PHP
Raw Normal View History

<?php
2019-10-03 19:41:54 +00:00
/**
* ConvertedPlaylistArchiveStream class.
*/
namespace Alltube\Stream;
use Alltube\Library\Exception\AlltubeLibraryException;
use Alltube\Library\Video;
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
* @throws AlltubeLibraryException
*/
protected function startVideoStream(Video $video)
{
$this->curVideoStream = new Stream($this->downloader->getAudioStream($video));
$this->init_file_stream_transfer(
$video->getFileNameWithExtension('mp3'),
// The ZIP format does not care about the file size.
0
);
}
}