YouTubePHP Documentation

LiveStreamsApi extends AbstractApi
in package

FinalYes

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.

The video streams that live broadcasts are fed from.

Reach it as $youtube->liveStreams. Every method takes the parameters Google documents, by the same names: use named arguments for the optional ones.

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

Table of Contents

Properties

$youtube  : YouTube

Methods

__construct()  : mixed
delete()  : PromiseInterface<string|int, null>
Deletes an existing stream for the authenticated user.
insert()  : PromiseInterface<string|int, LiveStream>
Inserts a new stream for the authenticated user.
list()  : PromiseInterface<string|int, LiveStreamListResponse>
Retrieve the list of streams associated with the given channel. --
update()  : PromiseInterface<string|int, LiveStream>
Updates an existing stream for the authenticated user.
call()  : PromiseInterface<string|int, mixed>
streamed()  : PromiseInterface<string|int, ResponseStream>
Opens a server-streamed call and reads its body as it arrives.

Properties

Methods

delete()

Deletes an existing stream for the authenticated user.

public delete(string $id[, string|null $onBehalfOfContentOwner = null ][, string|null $onBehalfOfContentOwnerChannel = null ]) : PromiseInterface<string|int, null>

Costs 50 units of quota.

Parameters
$id : string
$onBehalfOfContentOwner : string|null = null

Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

$onBehalfOfContentOwnerChannel : string|null = null

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.

Tags
link
https://developers.google.com/youtube/v3/live/docs/liveStreams/delete
since
1.0.0
Return values
PromiseInterface<string|int, null>

insert()

Inserts a new stream for the authenticated user.

public insert(array<int, string>|string $part, LiveStream|array<string, mixed> $body[, string|null $onBehalfOfContentOwner = null ][, string|null $onBehalfOfContentOwnerChannel = null ]) : PromiseInterface<string|int, LiveStream>

Costs 50 units of quota.

Parameters
$part : array<int, string>|string

The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, cdn, content_details, and status.

$body : LiveStream|array<string, mixed>

The LiveStream to send.

$onBehalfOfContentOwner : string|null = null

Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

$onBehalfOfContentOwnerChannel : string|null = null

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.

Tags
link
https://developers.google.com/youtube/v3/live/docs/liveStreams/insert
since
1.0.0
Return values
PromiseInterface<string|int, LiveStream>

list()

Retrieve the list of streams associated with the given channel. --

public list(array<int, string>|string $part[, array<int, string>|string|null $id = null ][, int|null $maxResults = null ][, bool|null $mine = null ][, string|null $onBehalfOfContentOwner = null ][, string|null $onBehalfOfContentOwnerChannel = null ][, string|null $pageToken = null ]) : PromiseInterface<string|int, LiveStreamListResponse>

Costs 1 unit of quota.

Parameters
$part : array<int, string>|string

The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status.

$id : array<int, string>|string|null = null

Return LiveStreams with the given ids from Stubby or Apiary.

$maxResults : int|null = null

The maxResults parameter specifies the maximum number of items that should be returned in the result set. From 0 to 50. YouTube assumes 5 when it is left out.

$mine : bool|null = null
$onBehalfOfContentOwner : string|null = null

Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

$onBehalfOfContentOwnerChannel : string|null = null

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.

$pageToken : string|null = null

The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.

Tags
link
https://developers.google.com/youtube/v3/live/docs/liveStreams/list
since
1.0.0
Return values
PromiseInterface<string|int, LiveStreamListResponse>

update()

Updates an existing stream for the authenticated user.

public update(array<int, string>|string $part, LiveStream|array<string, mixed> $body[, string|null $onBehalfOfContentOwner = null ][, string|null $onBehalfOfContentOwnerChannel = null ]) : PromiseInterface<string|int, LiveStream>

Costs 50 units of quota.

Parameters
$part : array<int, string>|string

The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, cdn, and status. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed.

$body : LiveStream|array<string, mixed>

The LiveStream to send.

$onBehalfOfContentOwner : string|null = null

Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

$onBehalfOfContentOwnerChannel : string|null = null

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.

Tags
link
https://developers.google.com/youtube/v3/live/docs/liveStreams/update
since
1.0.0
Return values
PromiseInterface<string|int, LiveStream>

call()

protected call(string $endpoint, string $method, string $path[, array<string, mixed> $query = [] ][, array<string, mixed>|JsonSerializable|null $body = null ][, string|null $returns = null ][, ?Media $media = null ][, ?string $uploadPath = null ][, bool $download = false ]) : PromiseInterface<string|int, mixed>
Parameters
$endpoint : string

The API method, e.g. liveChatMessages.list.

$method : string
$path : string
$query : array<string, mixed> = []
$body : array<string, mixed>|JsonSerializable|null = null
$returns : string|null = null

The type token the result hydrates as; null leaves it raw.

$media : ?Media = null
$uploadPath : ?string = null
$download : bool = false
Return values
PromiseInterface<string|int, mixed>

streamed()

Opens a server-streamed call and reads its body as it arrives.

protected streamed(string $endpoint, string $path, array<string, mixed> $query, string $returns) : PromiseInterface<string|int, ResponseStream>
Parameters
$endpoint : string
$path : string
$query : array<string, mixed>
$returns : string

The type token each element hydrates as.

Return values
PromiseInterface<string|int, ResponseStream>
On this page

Search results