class Videos extends Resource (View source)

The "videos" collection of methods.

Typical usage is:

 $youtubeService = new Google\Service\YouTube(...);
 $videos = $youtubeService->videos;

Methods

delete(string $id, array $optParams = [])

Deletes a resource. (videos.delete)

getRating(string|array $id, array $optParams = [])

Retrieves the ratings that the authorized user gave to a list of specified videos. (videos.getRating)

insert(string|array $part, Video $postBody, array $optParams = [])

Inserts a new resource into this collection. (videos.insert)

listVideos(string|array $part, array $optParams = [])

Retrieves a list of resources, possibly filtered. (videos.listVideos)

rate(string $id, string $rating, array $optParams = [])

Adds a like or dislike rating to a video or removes a rating from a video.

reportAbuse(VideoAbuseReport $postBody, array $optParams = [])

Report abuse for a video. (videos.reportAbuse)

update(string|array $part, Video $postBody, array $optParams = [])

Updates an existing resource. (videos.update)

Details

delete(string $id, array $optParams = [])

Deletes a resource. (videos.delete)

Parameters

string $id
array $optParams

Optional parameters.

Exceptions

Exception

VideoGetRatingResponse getRating(string|array $id, array $optParams = [])

Retrieves the ratings that the authorized user gave to a list of specified videos. (videos.getRating)

Parameters

string|array $id
array $optParams

Optional parameters.

Return Value

VideoGetRatingResponse

Exceptions

Exception

Video insert(string|array $part, Video $postBody, array $optParams = [])

Inserts a new resource into this collection. (videos.insert)

Parameters

string|array $part

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. Note that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.

Video $postBody
array $optParams

Optional parameters.

Return Value

Video

Exceptions

Exception

VideoListResponse listVideos(string|array $part, array $optParams = [])

Retrieves a list of resources, possibly filtered. (videos.listVideos)

Parameters

string|array $part

The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.

array $optParams

Optional parameters.

Return Value

VideoListResponse

Exceptions

Exception

rate(string $id, string $rating, array $optParams = [])

Adds a like or dislike rating to a video or removes a rating from a video.

(videos.rate)

Parameters

string $id
string $rating
array $optParams

Optional parameters.

Exceptions

Exception

reportAbuse(VideoAbuseReport $postBody, array $optParams = [])

Report abuse for a video. (videos.reportAbuse)

Parameters

VideoAbuseReport $postBody
array $optParams

Optional parameters.

Exceptions

Exception

Video update(string|array $part, Video $postBody, array $optParams = [])

Updates an existing resource. (videos.update)

Parameters

string|array $part

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. 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. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting. In addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.

Video $postBody
array $optParams

Optional parameters.

Return Value

Video

Exceptions

Exception