• File: youtube_service.class.php
  • Full Path: /home/bravrvjk/hpgt.org/wp-content/plugins/unlimited-elements-for-elementor/inc_php/framework/google/youtube/youtube_service.class.php
  • Date Modified: 09/21/2023 1:48 PM
  • File size: 732 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

/**
 * @link https://developers.google.com/youtube/v3/docs
 */
class UEGoogleAPIYouTubeService extends UEGoogleAPIClient{

	/**
	 * Get the playlist items.
	 *
	 * @param string $playlistId
	 * @param array $params
	 *
	 * @return UEGoogleAPIPlaylistItem[]
	 */
	public function getPlaylistItems($playlistId, $params = array()){

		$params["playlistId"] = $playlistId;
		$params["part"] = "snippet,contentDetails";

		$response = $this->get("/playlistItems", $params);
		$response = UEGoogleAPIPlaylistItem::transformAll($response["items"]);

		return $response;
	}

	/**
	 * Get the base URL for the API.
	 *
	 * @return string
	 */
	protected function getBaseUrl(){

		return "https://www.googleapis.com/youtube/v3";
	}

}