PHP Class VideoPress_Video, jetpack

Since: 1.3
Show file Open project: automattic/jetpack

Public Properties

Property Type Description
$age_rating integer Recommended minimum age of the viewer.
$blog_id integer WordPress.com blog identifier
$calculated_height integer Video height calculated based on original video dimensions and the requested maxwidth
$calculated_width integer Video width calculated based on original video dimensions and the requested maxwidth
$captions array Closed captions if available for the given video. Associative array of ISO 639-2 language code and a WebVTT URI
$description string Video description
$duration integer Video duration in whole seconds
$expires integer Expiration of the video expressed in Unix time
$guid string VideoPress unique identifier
$language string Text and audio language as ISO 639-2 language code
$maxwidth integer Maximum desired width.
$players stdClass Video player information
$post_id integer Remote blog attachment identifier
$poster_frame_uri string Poster frame image URI for the given video guid and calculated dimensions.
$restricted_embed boolean Video author has restricted video embedding or sharing
$skin array Video player skinning preferences including background color and watermark
$text_direction string Directionality of title text. ltr or rtl
$title string Video title
$version
$videos stdClass Video files associated with the given guid for the calculated dimensions.

Public Methods

Method Description
__construct ( $guid, $maxwidth = 640 ) Setup the object.
calculate_expiration ( $expires_header ) : integer | boolean Convert an Expires HTTP header value into Unix time for use in WP Cache
hostname ( string $url ) : boolean | string Extract the site's host domain for statistics and comparison against an allowed site list in the case of restricted embeds.

Private Methods

Method Description
get_data ( ) : stdClass | WP_Error Request data from WordPress.com for the given guid, maxwidth, and calculated blog hostname.

Method Details

__construct() public method

Request video information from VideoPress servers and process the response.
Since: 1.3
public __construct ( $guid, $maxwidth = 640 )

calculate_expiration() public static method

Convert an Expires HTTP header value into Unix time for use in WP Cache
Since: 1.3
public static calculate_expiration ( $expires_header ) : integer | boolean
return integer | boolean Unix time or false

hostname() public static method

Extract the site's host domain for statistics and comparison against an allowed site list in the case of restricted embeds.
Since: 1.2
public static hostname ( string $url ) : boolean | string
$url string absolute URL
return boolean | string host component of the URL, or false if none found

Property Details

$age_rating public property

Recommended minimum age of the viewer.
Since: 1.3
public int $age_rating
return integer

$blog_id public property

WordPress.com blog identifier
Since: 1.5
public int $blog_id
return integer

$calculated_height public property

Video height calculated based on original video dimensions and the requested maxwidth
Since: 1.3
public int $calculated_height
return integer

$calculated_width public property

Video width calculated based on original video dimensions and the requested maxwidth
Since: 1.3
public int $calculated_width
return integer

$captions public property

Closed captions if available for the given video. Associative array of ISO 639-2 language code and a WebVTT URI
Since: 1.5
public array $captions
return array

$description public property

Video description
Since: 4.4
public string $description
return string

$duration public property

Video duration in whole seconds
Since: 1.3
public int $duration
return integer

$expires public property

Expiration of the video expressed in Unix time
Since: 1.3
public int $expires
return integer

$guid public property

VideoPress unique identifier
Since: 1.3
public string $guid
return string

$language public property

Text and audio language as ISO 639-2 language code
Since: 1.3
public string $language
return string

$maxwidth public property

Maximum desired width.
Since: 1.3
public int $maxwidth
return integer

$players public property

Video player information
Since: 1.3
public stdClass $players
return stdClass

$post_id public property

Remote blog attachment identifier
Since: 1.5
public int $post_id
return integer

$poster_frame_uri public property

Poster frame image URI for the given video guid and calculated dimensions.
Since: 1.3
public string $poster_frame_uri
return string

$restricted_embed public property

Video author has restricted video embedding or sharing
Since: 1.3
public bool $restricted_embed
return boolean

$skin public property

Video player skinning preferences including background color and watermark
Since: 1.5
public array $skin
return array

$text_direction public property

Directionality of title text. ltr or rtl
Since: 1.3
public string $text_direction
return string

$title public property

Video title
Since: 1.3
public string $title
return string

$version public property

public $version

$videos public property

Video files associated with the given guid for the calculated dimensions.
Since: 1.3
public stdClass $videos
return stdClass