YouTubePHP Documentation

VideoFileDetails 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.

Describes original video file properties, including technical details about audio and video streams, but also metadata information like content length, digitization time, or geotagging information.

Tags
since
1.0.0

Table of Contents

Constants

FILE_TYPE_ARCHIVE  : mixed = 'archive'
Archive file (e.g., a ZIP archive).
FILE_TYPE_AUDIO  : mixed = 'audio'
Audio only file (e.g., an MP3 file).
FILE_TYPE_DOCUMENT  : mixed = 'document'
Document or text file (e.g., MS Word document).
FILE_TYPE_IMAGE  : mixed = 'image'
Image file (e.g., a JPEG image).
FILE_TYPE_OTHER  : mixed = 'other'
Other non-video file type.
FILE_TYPE_PROJECT  : mixed = 'project'
Movie project file (e.g., Microsoft Windows Movie Maker project).
FILE_TYPE_VIDEO  : mixed = 'video'
Known video file (e.g., an MP4 file).

Properties

$audioStreams  : Collection<string|int, VideoFileDetailsAudioStream>|null
$bitrateBps  : string|null
$container  : string|null
$creationTime  : string|null
$durationMs  : string|null
$fileName  : string|null
$fileSize  : string|null
$fileType  : string|null
$videoStreams  : Collection<string|int, VideoFileDetailsVideoStream>|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()}.

Constants

FILE_TYPE_ARCHIVE

Archive file (e.g., a ZIP archive).

public mixed FILE_TYPE_ARCHIVE = 'archive'

FILE_TYPE_AUDIO

Audio only file (e.g., an MP3 file).

public mixed FILE_TYPE_AUDIO = 'audio'

FILE_TYPE_DOCUMENT

Document or text file (e.g., MS Word document).

public mixed FILE_TYPE_DOCUMENT = 'document'

FILE_TYPE_IMAGE

Image file (e.g., a JPEG image).

public mixed FILE_TYPE_IMAGE = 'image'

FILE_TYPE_OTHER

Other non-video file type.

public mixed FILE_TYPE_OTHER = 'other'

FILE_TYPE_PROJECT

Movie project file (e.g., Microsoft Windows Movie Maker project).

public mixed FILE_TYPE_PROJECT = 'project'

FILE_TYPE_VIDEO

Known video file (e.g., an MP4 file).

public mixed FILE_TYPE_VIDEO = 'video'

Properties

$audioStreams

public Collection<string|int, VideoFileDetailsAudioStream>|null $audioStreams

A list of audio streams contained in the uploaded video file. Each item in the list contains detailed metadata about an audio stream.

$bitrateBps

public string|null $bitrateBps

The uploaded video file's combined (video and audio) bitrate in bits per second. A 64-bit number, as a string.

$container

public string|null $container

The uploaded video file's container format.

$creationTime

public string|null $creationTime

The date and time when the uploaded video file was created. The value is specified in ISO 8601 format. Currently, the following ISO 8601 formats are supported: - Date only: YYYY-MM-DD

  • Naive time: YYYY-MM-DDTHH:MM:SS - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM

$durationMs

public string|null $durationMs

The length of the uploaded video in milliseconds. A 64-bit number, as a string.

$fileName

public string|null $fileName

The uploaded file's name. This field is present whether a video file or another type of file was uploaded.

$fileSize

public string|null $fileSize

The uploaded file's size in bytes. This field is present whether a video file or another type of file was uploaded. A 64-bit number, as a string.

$fileType

public string|null $fileType

The uploaded file's type as detected by YouTube's video processing engine. Currently, YouTube only processes video files, but this field is present whether a video file or another type of file was uploaded. One of the FILE_TYPE_* constants.

$videoStreams

public Collection<string|int, VideoFileDetailsVideoStream>|null $videoStreams

A list of video streams contained in the uploaded video file. Each item in the list contains detailed metadata about a video stream.

$casts

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

protected array<string, string> $casts = ['audioStreams' => 'Array of VideoFileDetailsAudioStream', 'videoStreams' => 'Array of VideoFileDetailsVideoStream']

$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