Google_VideosServiceResource

The "videos" collection of methods.

Defined (1)

The class is defined in the following location(s).

/google-api/src/contrib/Google_YouTubeService.php  
  1. class Google_VideosServiceResource extends Google_ServiceResource { 
  2.  
  3.  
  4. /** 
  5. * Deletes a YouTube video. (videos.delete) 
  6. * @param string $id The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID. 
  7. * @param array $optParams Optional parameters. 
  8. */ 
  9. public function delete($id, $optParams = array()) { 
  10. $params = array('id' => $id); 
  11. $params = array_merge($params, $optParams); 
  12. $data = $this->__call('delete', array($params)); 
  13. return $data; 
  14. /** 
  15. * Uploads a video to YouTube and optionally sets the video's metadata. (videos.insert) 
  16. * @param string $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. 
  17. The part names that you can include in the parameter value are snippet, contentDetails, player, statistics, status, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. 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. 
  18. * @param Google_Video $postBody 
  19. * @param array $optParams Optional parameters. 
  20. * @return Google_Video 
  21. */ 
  22. public function insert($part, Google_Video $postBody, $optParams = array()) { 
  23. $params = array('part' => $part, 'postBody' => $postBody); 
  24. $params = array_merge($params, $optParams); 
  25. $data = $this->__call('insert', array($params)); 
  26. if ($this->useObjects()) { 
  27. return new Google_Video($data); 
  28. } else { 
  29. return $data; 
  30. /** 
  31. * Returns a list of videos that match the API request parameters. (videos.list) 
  32. * @param string $id The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID. 
  33. * @param string $part The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, player, statistics, status, and topicDetails. 
  34. 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. 
  35. * @param array $optParams Optional parameters. 
  36. * @opt_param string onBehalfOfContentOwner The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. 
  37. * @return Google_VideoListResponse 
  38. */ 
  39. public function listVideos($id, $part, $optParams = array()) { 
  40. $params = array('id' => $id, 'part' => $part); 
  41. $params = array_merge($params, $optParams); 
  42. $data = $this->__call('list', array($params)); 
  43. if ($this->useObjects()) { 
  44. return new Google_VideoListResponse($data); 
  45. } else { 
  46. return $data; 
  47. /** 
  48. * Like, dislike, or remove rating from a video. (videos.rate) 
  49. * @param string $id The id parameter specifies the YouTube video ID. 
  50. * @param string $rating Specifies the rating to record. 
  51. * @param array $optParams Optional parameters. 
  52. */ 
  53. public function rate($id, $rating, $optParams = array()) { 
  54. $params = array('id' => $id, 'rating' => $rating); 
  55. $params = array_merge($params, $optParams); 
  56. $data = $this->__call('rate', array($params)); 
  57. return $data; 
  58. /** 
  59. * Updates a video's metadata. (videos.update) 
  60. * @param string $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. 
  61. The part names that you can include in the parameter value are snippet, contentDetails, player, statistics, status, and topicDetails. 
  62. 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. 
  63. In addition, not all of those parts contain properties that can be set when setting or updating a video's metadata. 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. 
  64. * @param Google_Video $postBody 
  65. * @param array $optParams Optional parameters. 
  66. * @return Google_Video 
  67. */ 
  68. public function update($part, Google_Video $postBody, $optParams = array()) { 
  69. $params = array('part' => $part, 'postBody' => $postBody); 
  70. $params = array_merge($params, $optParams); 
  71. $data = $this->__call('update', array($params)); 
  72. if ($this->useObjects()) { 
  73. return new Google_Video($data); 
  74. } else { 
  75. return $data;