cryptoRebel / sukiyoshi

Automatically exported from code.google.com/p/sukiyoshi
0 stars 0 forks source link

Problem with updating playlist with new videos #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I try to update my playlist with some new videos, but it fails.(I can update 
the name of the playlist but adding others videos fails). I uyse this code. 
Thank you for your help.

BCVideo newVid = new BCVideo();
                uvVideo = (VideoAddUpdate)TemplateContainer.FindControl("uvVideo");
                newVid.name = uvVideo.FileName;
                newVid.longDescription = "long description";
                newVid.shortDescription = "short desc";
                newVid.tags.Add("sample");
                newVid.tags.Add("now vid");
                newVid.id = 1048081821551;
                newVid.publishedDate = DateTime.Now;

newVid.economics = BCVideoEconomics.AD_SUPPORTED;

RPCResponse<long> rpcr = bc.CreateVideo(newVid, uvVideo.FileName, 
uvVideo.FileBytes);
                BCPlaylist result = bc.FindPlaylistByReferenceId("sample");
                result.videos.Add(newVid);
                result.videoIds.Add(newVid.id);
                result.name = "now list updated 4";

                RPCResponse<BCPlaylist> p = bc.UpdatePlaylist(result);
                this.Page.Response.Write("json: " + result.ToUpdateJSON());

                if (p.error.message != null)
                {
                    this.Page.Response.Write(p.error.message);
                }
                else
                {
                    this.Page.Response.Write(p.result.name);
                }

Original issue reported on code.google.com by ouhib...@gmail.com on 1 Aug 2011 at 8:05

GoogleCodeExporter commented 8 years ago
Hi, There may be an issue with timing. When you create videos through the API 
it takes time to upload and process the video before it's ready. This may be 
the case. I'd suggest waiting until the video is uploaded and can be queried 
from the API before adding it to a playlist. 

Original comment by stiles.m...@gmail.com on 1 Sep 2011 at 2:06