admin管理员组

文章数量:1403182

Im trying with this code:

$playlistId = "YOUR_PLAYLIST_ID"; // Replace with your actual Playlist ID
$playlistItem = new Google\Service\YouTube\PlaylistItem();
$playlistItemSnippet = new Google\Service\YouTube\PlaylistItemSnippet();
$playlistItemSnippet->setPlaylistId($playlistId);
$playlistItemSnippet->setResourceId(new Google\Service\YouTube\ResourceId([
    'kind' => 'youtube#video',
    'videoId' => $videoId
]));

$playlistItem->setSnippet($playlistItemSnippet);
$response = $youtube->playlistItems->insert('snippet', $playlistItem);

but the video doesnt get the playlist, there is not error nor exception, and response is a Guzzle typed.

本文标签: youtubeHow to put a video to a playlistin phpStack Overflow