Skip to content

Class: Video

Saqib Razzaq edited this page Mar 17, 2019 · 1 revision

Video class extends Videos class and is basically a wrapper to make it easier to interact with a single video. All methods except fetch() return data from already fetched array.

fetch

Fetches initial video data for video and makes other methods available

Returns

An array consisting of all available fields for video

Examples
$video = new Video(122); // 122 is ID
$video->fetch(); // now all other methods are ready to be used

title

Get video title

Examples
$video->title();

uploaderName

Get video uploader name

Examples
$video->uploaderName();

duration

Get video duration seconds

Examples
$video->duration();

prettyDuration

Get video duration in human readable format

Returns

Video duration in 00:00:00 format

Examples
$video->prettyDuration(); // 72 seconds == 01:12

filename

Get video filename

Examples
$video->filename();

date

Get video upload date

Examples
$video->date();

directory

Get video directory in Y/m/d format

Examples
$video->directory();

comments

Get total comments count

Examples
$video->comments();

scope

Get video scope

Examples
$video->scope();

isPublic

Check if video is public

Returns

Boolean

Examples
$video->isPublic();

isPrivate

Get if video is private

Returns

Boolean

Examples
$video->isPrivate();