Removing videos from a playlist with YouTube v3 data API

I am creating an application with which users can create playlists using drag and drop. I want them to be able to delete videos from the playlist. But I am embarrassed with the documents.

I am using the youtube api php client library. Keep in mind that the user is logged in.

$youtubeService = new Google_YouTubeService($client);
$playlistItems = $youtubeService->playlistItems;
$deleteVid = $playlistItems->delete($videocode);

And this is the delete function from the client library:

 /**
 * Deletes a playlist item. (playlistItems.delete)
 *
 * @param string $id The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item ID.
 * @param array $optParams Optional parameters.
 */

public function delete($id, $optParams = array()) {
  $params = array('id' => $id);
  $params = array_merge($params, $optParams);
  $data = $this->__call('delete', array($params));
  return $data;
}

There is nowhere where I can indicate which playlist to delete the video. Does anyone have an idea how to do this? Other playlistItem functions use the Google_PlaylistItem object as a parameter. But this is just a line for the video code ... So strange, I can’t figure it out on my own.

Any help would be greatly appreciated.

+3
2

PlaylistItemId . , .

https://developers.google.com/youtube/v3/docs/playlistItems

, , playlistitemId , .

playlistitemId playlistItems- > list, .

+5

. . , , Youtube " ", , " "! - " " !!!

?

.

0

All Articles