refactor: New PlaylistArchiveVideo class

Cleaner way to handle PlaylistArchiveStream info about videos
This commit is contained in:
Pierre Rudloff 2019-04-21 00:56:12 +02:00
parent f9bf3b8d47
commit ddc27a8a2c
2 changed files with 84 additions and 35 deletions

View file

@ -0,0 +1,49 @@
<?php
/**
* PlaylistArchiveVideo class.
*/
namespace Alltube;
use Barracuda\ArchiveStream\TarArchive;
use GuzzleHttp\Client;
use Psr\Http\Message\StreamInterface;
use RuntimeException;
use stdClass;
/**
* Video streamed to a PlaylistArchiveStream.
*/
class PlaylistArchiveVideo
{
/**
* Video page URL.
*
* @var string
*/
public $url;
/**
* Has the video been streaded entirely ?
*
* @var bool
*/
public $complete = false;
/**
* popen stream containing the video.
*
* @var resource
*/
public $stream;
/**
* PlaylistArchiveVideo constructor.
*
* @param string $url Video page URL
*/
public function __construct($url)
{
$this->url = $url;
}
}