\VideoPress_Video

VideoPress video object retrieved from VideoPress servers and parsed.

Summary

Methods
Properties
Constants
__construct()
calculate_expiration()
hostname()
$version
$expires
$guid
$blog_id
$post_id
$maxwidth
$calculated_width
$calculated_height
$title
$text_direction
$language
$duration
$age_rating
$restricted_embed
$poster_frame_uri
$videos
$players
$skin
$captions
manifest_version
No protected methods found
No protected properties found
N/A
get_data()
No private properties found
N/A

Constants

manifest_version

manifest_version

Manifest version returned by remote service.

Properties

$version

$version

$expires

$expires : int

Expiration of the video expressed in Unix time

Type

int

$guid

$guid : string

VideoPress unique identifier

Type

string

$blog_id

$blog_id : int

WordPress.com blog identifier

Type

int

$post_id

$post_id : int

Remote blog attachment identifier

Type

int

$maxwidth

$maxwidth : int

Maximum desired width.

Type

int

$calculated_width

$calculated_width : int

Video width calculated based on original video dimensions and the requested maxwidth

Type

int

$calculated_height

$calculated_height : int

Video height calculated based on original video dimensions and the requested maxwidth

Type

int

$title

$title : string

Video title

Type

string

$text_direction

$text_direction : string

Directionality of title text. ltr or rtl

Type

string

$language

$language : string

Text and audio language as ISO 639-2 language code

Type

string

$duration

$duration : int

Video duration in whole seconds

Type

int

$age_rating

$age_rating : int

Recommended minimum age of the viewer.

Type

int

$restricted_embed

$restricted_embed : bool

Video author has restricted video embedding or sharing

Type

bool

$poster_frame_uri

$poster_frame_uri : string

Poster frame image URI for the given video guid and calculated dimensions.

Type

string

$videos

$videos : \stdClass

Video files associated with the given guid for the calculated dimensions.

Type

\stdClass

$players

$players : \stdClass

Video player information

Type

\stdClass

$skin

$skin : array

Video player skinning preferences including background color and watermark

Type

array

$captions

$captions : array

Closed captions if available for the given video. Associative array of ISO 639-2 language code and a WebVTT URI

Type

array

Methods

__construct()

__construct( $guid,  $maxwidth)

Setup the object.

Request video information from VideoPress servers and process the response.

Parameters

$guid
$maxwidth

calculate_expiration()

calculate_expiration( $expires_header) : int|bool

Convert an Expires HTTP header value into Unix time for use in WP Cache

Parameters

$expires_header

Returns

int|bool —

Unix time or false

hostname()

hostname(string $url) : bool|string

Extract the site's host domain for statistics and comparison against an allowed site list in the case of restricted embeds.

Parameters

string $url

absolute URL

Returns

bool|string —

host component of the URL, or false if none found

get_data()

get_data() : \stdClass|\WP_Error

Request data from WordPress.com for the given guid, maxwidth, and calculated blog hostname.

Returns

\stdClass|\WP_Error —

parsed JSON response or WP_Error if request unsuccessful