Tuesday, September 27, 2011

[YouTube-API] Adding a video to a playlist typo and error

The last line should be:

request.AddToPlaylist(p, pm);

However, even when I do use the above line, the video is not added.


Adding a video to a playlist

You can add a video to a playlist by using a PlayListMember object. The following code creates a PlayListMember object with a known ID value and then adds it to the Playlist object (p). Since the request does not specify a position where the video will appear in the playlist, the new video is added to the end of the playlist.

// For Playlist object p
PlayListMember pm = new PlayListMember();

// Insert <id> or <videoid> for video here
pm
.Id = VIDEOID;
request
.AddToPlaylist(p, m);

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/crQORuicf7QJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment