YouTubePHP Documentation

Video extends Part
in package

This file is generated from spec/discovery.json (YouTube Data API v3, revision 20260924) by tools/generate.php. Do not edit it by hand - run `composer spec:build` instead.

A video resource represents a YouTube video.

Tags
link
https://developers.google.com/youtube/v3/docs/videos
since
1.0.0

Table of Contents

Properties

$ageGating  : VideoAgeGating|null
$brandPartner  : BrandPartner|null
$contentDetails  : VideoContentDetails|null
$etag  : string|null
$fileDetails  : VideoFileDetails|null
$id  : string|null
$kind  : string|null
$liveStreamingDetails  : VideoLiveStreamingDetails|null
$localizations  : array<string, VideoLocalization>|null
$monetizationDetails  : VideoMonetizationDetails|null
$paidProductPlacementDetails  : VideoPaidProductPlacementDetails|null
$player  : VideoPlayer|null
$processingDetails  : VideoProcessingDetails|null
$projectDetails  : VideoProjectDetails|null
$recordingDetails  : VideoRecordingDetails|null
$snippet  : VideoSnippet|null
$statistics  : VideoStatistics|null
$status  : VideoStatus|null
$suggestions  : VideoSuggestions|null
$topicDetails  : VideoTopicDetails|null
$casts  : array<string, string>
Attribute name => type token (`"LiveChatMessageSnippet"`, `"Array of Thumbnail"`, `"Map of VideoLocalization"`), used to hydrate nested objects into parts.
$dates  : array<int, string>
Attribute names holding RFC 3339 timestamps, read back as {@see CarbonImmutable}. They are stored and serialised as the strings YouTube sent.
$youtube  : ?YouTube

Methods

__construct()  : mixed
__debugInfo()  : array<string, mixed>
__get()  : mixed
__isset()  : bool
__set()  : void
__toString()  : string
__unset()  : void
attributeExists()  : bool
fill()  : void
getAttribute()  : mixed
getCasts()  : array<string, string>
getDates()  : array<int, string>
getRawAttribute()  : mixed
Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.
getRawAttributes()  : array<string, mixed>
getYouTube()  : YouTube
The client this part came from.
jsonSerialize()  : array<string, mixed>
The payload this part would be sent back to YouTube as: nested parts and collections flattened, timestamps as RFC 3339 strings.
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
setAttribute()  : void
factory()  : Factory
Builds another part from the same client - for nested objects.
setRawAttribute()  : void
Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.

Properties

$ageGating

public VideoAgeGating|null $ageGating

Age restriction details related to a video. This data can only be retrieved by the video owner.

$contentDetails

public VideoContentDetails|null $contentDetails

The contentDetails object contains information about the video content, including the length of the video and its aspect ratio.

$etag

public string|null $etag

Etag of this resource.

$fileDetails

public VideoFileDetails|null $fileDetails

The fileDetails object encapsulates information about the video file that was uploaded to YouTube, including the file's resolution, duration, audio and video codecs, stream bitrates, and more. This data can only be retrieved by the video owner.

$id

public string|null $id

The ID that YouTube uses to uniquely identify the video.

$kind

public string|null $kind

Identifies what kind of resource this is. Value: the fixed string "youtube#video".

$liveStreamingDetails

public VideoLiveStreamingDetails|null $liveStreamingDetails

The liveStreamingDetails object contains metadata about a live video broadcast. The object will only be present in a video resource if the video is an upcoming, live, or completed live broadcast.

$localizations

public array<string, VideoLocalization>|null $localizations

The localizations object contains localized versions of the basic details about the video, such as its title and description.

$monetizationDetails

public VideoMonetizationDetails|null $monetizationDetails

The monetizationDetails object encapsulates information about the monetization status of the video.

$player

public VideoPlayer|null $player

The player object contains information that you would use to play the video in an embedded player.

$processingDetails

public VideoProcessingDetails|null $processingDetails

The processingDetails object encapsulates information about YouTube's progress in processing the uploaded video file. The properties in the object identify the current processing status and an estimate of the time remaining until YouTube finishes processing the video. This part also indicates whether different types of data or content, such as file details or thumbnail images, are available for the video. The processingProgress object is designed to be polled so that the video uploaded can track the progress that YouTube has made in processing the uploaded video file. This data can only be retrieved by the video owner.

$projectDetails

public VideoProjectDetails|null $projectDetails

Deprecated. The projectDetails object contains information about the project specific video metadata. b/157517979: This part was never populated after it was added. However, it sees non-zero traffic because there is generated client code in the wild that refers to it [1]. We keep this field and do NOT remove it because otherwise V3 would return an error when this part gets requested [2]. [1] https://developers.google.com/resources/api-libraries/documentation/youtube/v3/csharp/latest/classGoogle_1_1Apis_1_1YouTube_1_1v3_1_1Data_1_1VideoProjectDetails.html [2] http://google3/video/youtube/src/python/servers/data_api/common.py?l=1565-1569&rcl=344141677

$recordingDetails

public VideoRecordingDetails|null $recordingDetails

The recordingDetails object encapsulates information about the location, date and address where the video was recorded.

$snippet

public VideoSnippet|null $snippet

The snippet object contains basic details about the video, such as its title, description, and category.

$statistics

public VideoStatistics|null $statistics

The statistics object contains statistics about the video.

$status

public VideoStatus|null $status

The status object contains information about the video's uploading, processing, and privacy statuses.

$suggestions

public VideoSuggestions|null $suggestions

The suggestions object encapsulates suggestions that identify opportunities to improve the video quality or the metadata for the uploaded video. This data can only be retrieved by the video owner.

$topicDetails

public VideoTopicDetails|null $topicDetails

The topicDetails object encapsulates information about Freebase topics associated with the video.

$casts

Attribute name => type token (`"LiveChatMessageSnippet"`, `"Array of Thumbnail"`, `"Map of VideoLocalization"`), used to hydrate nested objects into parts.

protected array<string, string> $casts = ['ageGating' => 'VideoAgeGating', 'brandPartner' => 'BrandPartner', 'contentDetails' => 'VideoContentDetails', 'fileDetails' => 'VideoFileDetails', 'liveStreamingDetails' => 'VideoLiveStreamingDetails', 'localizations' => 'Map of VideoLocalization', 'monetizationDetails' => 'VideoMonetizationDetails', 'paidProductPlacementDetails' => 'VideoPaidProductPlacementDetails', 'player' => 'VideoPlayer', 'processingDetails' => 'VideoProcessingDetails', 'projectDetails' => 'VideoProjectDetails', 'recordingDetails' => 'VideoRecordingDetails', 'snippet' => 'VideoSnippet', 'statistics' => 'VideoStatistics', 'status' => 'VideoStatus', 'suggestions' => 'VideoSuggestions', 'topicDetails' => 'VideoTopicDetails']

$dates

Attribute names holding RFC 3339 timestamps, read back as {@see CarbonImmutable}. They are stored and serialised as the strings YouTube sent.

protected array<int, string> $dates = []

Methods

__construct()

public __construct([YouTube|null $youtube = null ][, array<string, mixed>|object $attributes = [] ]) : mixed
Parameters
$youtube : YouTube|null = null

The client, for behaviour that calls the API.

$attributes : array<string, mixed>|object = []

__debugInfo()

public __debugInfo() : array<string, mixed>
Return values
array<string, mixed>

__get()

public __get(string $name) : mixed
Parameters
$name : string

__isset()

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__toString()

public __toString() : string
Return values
string

__unset()

public __unset(string $name) : void
Parameters
$name : string

attributeExists()

public attributeExists(string $key) : bool
Parameters
$key : string
Return values
bool

fill()

public fill(array<string, mixed> $attributes) : void
Parameters
$attributes : array<string, mixed>

getAttribute()

public getAttribute(string $key) : mixed
Parameters
$key : string

getCasts()

public getCasts() : array<string, string>
Return values
array<string, string>

getDates()

public getDates() : array<int, string>
Return values
array<int, string>

getRawAttribute()

Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.

public getRawAttribute(string $key) : mixed
Parameters
$key : string

getRawAttributes()

public getRawAttributes() : array<string, mixed>
Return values
array<string, mixed>

getYouTube()

The client this part came from.

public getYouTube() : YouTube
Tags
throws
LogicException

When the part was built without one.

Return values
YouTube

jsonSerialize()

The payload this part would be sent back to YouTube as: nested parts and collections flattened, timestamps as RFC 3339 strings.

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

setAttribute()

public setAttribute(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed

factory()

Builds another part from the same client - for nested objects.

protected factory() : Factory
Return values
Factory

setRawAttribute()

Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.

protected setRawAttribute(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
On this page

Search results