Google_VideosServiceResource

The "videos" collection of methods.

Defined (1)

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

/src/contrib/Google_YouTubeService.php  
  1. class Google_VideosServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Deletes a YouTube video. (videos.delete) 
  5. * @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. 
  6. * @param array $optParams Optional parameters. 
  7. * @opt_param string onBehalfOfContentOwner USE_DESCRIPTION --- channels:list:onBehalfOfContentOwner 
  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. * Get user ratings for videos. (videos.getRating) 
  16. * @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. 
  17. * @param array $optParams Optional parameters. 
  18. * @opt_param string onBehalfOfContentOwner USE_DESCRIPTION --- channels:list:onBehalfOfContentOwner 
  19. * @return Google_VideoGetRatingResponse 
  20. */ 
  21. public function getRating($id, $optParams = array()) { 
  22. $params = array('id' => $id); 
  23. $params = array_merge($params, $optParams); 
  24. $data = $this->__call('getRating', array($params)); 
  25. if ($this->useObjects()) { 
  26. return new Google_VideoGetRatingResponse($data); 
  27. } else { 
  28. return $data; 
  29. /** 
  30. * Uploads a video to YouTube and optionally sets the video's metadata. (videos.insert) 
  31. * @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. 
  32. 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. 
  33. * @param Google_Video $postBody 
  34. * @param array $optParams Optional parameters. 
  35. * @opt_param bool autoLevels The autoLevels parameter specifies whether the video should be auto-leveled by YouTube. 
  36. * @opt_param string onBehalfOfContentOwner USE_DESCRIPTION --- channels:list:onBehalfOfContentOwner 
  37. * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. 
  38. The onBehalfOfContentOwnerChannel parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the channel specified in the parameter value. This parameter must be used in conjunction with the onBehalfOfContentOwner parameter, and the user must be authenticated using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. In addition, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. 
  39. 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. 
  40. * @opt_param bool stabilize The stabilize parameter specifies whether the video should be stabilized by YouTube. 
  41. * @return Google_Video 
  42. */ 
  43. public function insert($part, Google_Video $postBody, $optParams = array()) { 
  44. $params = array('part' => $part, 'postBody' => $postBody); 
  45. $params = array_merge($params, $optParams); 
  46. $data = $this->__call('insert', array($params)); 
  47. if ($this->useObjects()) { 
  48. return new Google_Video($data); 
  49. } else { 
  50. return $data; 
  51. /** 
  52. * Returns a list of videos that match the API request parameters. (videos.list) 
  53. * @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. 
  54. 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. 
  55. * @param array $optParams Optional parameters. 
  56. * @opt_param string chart Set this parameter's value to mostPopular to instruct the API to return videos belonging to the chart of most popular videos. 
  57. * @opt_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. 
  58. * @opt_param string locale The locale parameter selects a video chart available in the specified locale. If using this parameter, chart must also be set. The parameter value is an BCP 47 locale. Supported locales include ar_AE, ar_DZ, ar_EG, ar_JO, ar_MA, ar_SA, ar_TN, ar_YE, cs_CZ, de_DE, el_GR, en_AU, en_BE, en_CA, en_GB, en_GH, en_IE, en_IL, en_IN, en_KE, en_NG, en_NZ, en_SG, en_UG, en_US, en_ZA, es_AR, es_CL, es_CO, es_ES, es_MX, es_PE, fil_PH, fr_FR, hu_HU, id_ID, it_IT, ja_JP, ko_KR, ms_MY, nl_NL, pl_PL, pt_BR, ru_RU, sv_SE, tr_TR, zh_HK, zh_TW 
  59. * @opt_param string maxResults USE_DESCRIPTION --- channels:list:maxResults 
  60. * @opt_param string myRating Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user. 
  61. * @opt_param string onBehalfOfContentOwner USE_DESCRIPTION --- channels:list:onBehalfOfContentOwner 
  62. * @opt_param string pageToken USE_DESCRIPTION --- channels:list:pageToken 
  63. * @opt_param string videoCategoryId The videoCategoryId parameter selects a video chart based on the category. If using this parameter, chart must also be set. 
  64. * @return Google_VideoListResponse 
  65. */ 
  66. public function listVideos($part, $optParams = array()) { 
  67. $params = array('part' => $part); 
  68. $params = array_merge($params, $optParams); 
  69. $data = $this->__call('list', array($params)); 
  70. if ($this->useObjects()) { 
  71. return new Google_VideoListResponse($data); 
  72. } else { 
  73. return $data; 
  74. /** 
  75. * Like, dislike, or remove rating from a video. (videos.rate) 
  76. * @param string $id The id parameter specifies the YouTube video ID. 
  77. * @param string $rating Specifies the rating to record. 
  78. * @param array $optParams Optional parameters. 
  79. * @opt_param string onBehalfOfContentOwner USE_DESCRIPTION --- channels:list:onBehalfOfContentOwner 
  80. */ 
  81. public function rate($id, $rating, $optParams = array()) { 
  82. $params = array('id' => $id, 'rating' => $rating); 
  83. $params = array_merge($params, $optParams); 
  84. $data = $this->__call('rate', array($params)); 
  85. return $data; 
  86. /** 
  87. * Updates a video's metadata. (videos.update) 
  88. * @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. 
  89. The part names that you can include in the parameter value are snippet, contentDetails, player, statistics, status, and topicDetails. 
  90. 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. 
  91. 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. 
  92. * @param Google_Video $postBody 
  93. * @param array $optParams Optional parameters. 
  94. * @opt_param string onBehalfOfContentOwner USE_DESCRIPTION --- channels:list:onBehalfOfContentOwner 
  95. * @return Google_Video 
  96. */ 
  97. public function update($part, Google_Video $postBody, $optParams = array()) { 
  98. $params = array('part' => $part, 'postBody' => $postBody); 
  99. $params = array_merge($params, $optParams); 
  100. $data = $this->__call('update', array($params)); 
  101. if ($this->useObjects()) { 
  102. return new Google_Video($data); 
  103. } else { 
  104. return $data;