Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9069715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:30:10+00:00 2026-06-16T17:30:10+00:00

Does anyone know how to add a video to a playlist when using resumable

  • 0

Does anyone know how to add a video to a playlist when using resumable upload?

Let me make this clear. Below is my code.

Video newVideo = new Video();
newVideo.Title = fileName.Split(".".ToCharArray())[0];
newVideo.Tags.Add(new MediaCategory("Nonprofit", YouTubeNameTable.CategorySchema));
newVideo.Description = DateTime.Now.ToShortDateString();
newVideo.YouTubeEntry.Private = false;
ResumableUploader m_ResumableUploader = null;
Authenticator YouTubeAuthenticator;

m_ResumableUploader = new ResumableUploader(100); //chunksize 1 MB
m_ResumableUploader.AsyncOperationCompleted += new AsyncOperationCompletedEventHandler(m_ResumableUploader_AsyncOperationCompleted);
m_ResumableUploader.AsyncOperationProgress += new AsyncOperationProgressEventHandler(m_ResumableUploader_AsyncOperationProgress);

YouTubeAuthenticator = new ClientLoginAuthenticator("YouTubeUploader", ServiceNames.YouTube, ConfigurationManager.AppSettings["USERNAME"].ToString(), ConfigurationManager.AppSettings["PASSWORD"].ToString());

YouTubeAuthenticator.DeveloperKey = ConfigurationManager.AppSettings["DEVELOPER_KEY"].ToString();
string contentType = MediaFileSource.GetContentTypeForFileName(fileName);
newVideo.MediaSource = new MediaFileSource(filePath, contentType);

AtomLink link = new AtomLink("http://uploads.gdata.youtube.com/resumable/feeds/api/users/<username>/uploads");
link.Rel = ResumableUploader.CreateMediaRelation;
newVideo.YouTubeEntry.Links.Add(link);

System.IO.FileStream stream = new System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read);

m_ResumableUploader.InsertAsync(YouTubeAuthenticator, newVideo.YouTubeEntry, new object());  

I am trying to upload a video directly to a playlist.

I am looking at this code and I am having a difficult time connecting the two. Need help.

https://developers.google.com/youtube/2.0/developers_guide_dotnet

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, pm);

Update 1 – I get an “Unsupported URI format” error when adding to playlist.

YouTubeRequestSettings ys = new YouTubeRequestSettings("YouTubeUploader",
ConfigurationManager.AppSettings["DEVELOPER_KEY"].ToString());
YouTubeRequest ytr = new YouTubeRequest(ys);
Video v = ytr.ParseVideo(e.ResponseStream);                  
PlayListMember pm = new PlayListMember();
Feed<Playlist> userPlaylists = ytr.GetPlaylistsFeed(ytr.Credentials.Username);
foreach (Playlist p in userPlaylists.Entries)
{
     fs.WriteLine(p.Title);
     if (p.Title == "Test 2")
     {
          pm.Id = v.VideoId;
          ytr.AddToPlaylist(p, pm);

          fs.WriteLine("Added To Playlist ");
     }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:30:12+00:00Added an answer on June 16, 2026 at 5:30 pm

    I figured it out. The code on YouTube has an error in it. It tells you to set the PlayListMember id to the VIDEOID.

     // For Playlist object p
     PlayListMember pm = new PlayListMember();
     // Insert <id> or <videoid> for video here
     pm.Id = VIDEOID;
     request.AddToPlaylist(p, pm);
    

    That is incorrect. You need to set the VIDEOID to the PlayListMember VideoID

     // For Playlist object p
     PlayListMember pm = new PlayListMember();
     // Insert <id> or <videoid> for video here
     pm.VideoId = VIDEOID;
     request.AddToPlaylist(p, pm);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to add multiple records using just one form in Yii?
Does anyone know how to add a border to a Dockpanel. i have this:
Does anyone know how to add a note using Google Reader's API? In looking
Does anyone know how to add an Image on a td element using vbscript?
Does anyone know how to add an item to a list but do it
Does anyone know how to add full (n.n.n.n) Windows file version information to COM
Does anyone know how to add a listener to the action overflow menu button
Does anyone know how to add a subversion branch to hudson and have it
Does anyone know of a quick way to add a role CRUD system to
Does anyone know the syntax to use to add pattern styles to the cell

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.