refactor: New PlaylistArchiveVideo class
Cleaner way to handle PlaylistArchiveStream info about videos
This commit is contained in:
parent
f9bf3b8d47
commit
ddc27a8a2c
2 changed files with 84 additions and 35 deletions
49
classes/PlaylistArchiveVideo.php
Normal file
49
classes/PlaylistArchiveVideo.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue