facebook c# api, video getting uploaded but its PUBLIC

可紊 提交于 2019-12-10 12:18:42

问题


I am able to upload video from the code below. But the video isn't PRIVATE. I need video to be PRIVATE or in other words it should be SELF.

FacebookMediaObject mediaObject1 = new FacebookMediaObject
{
FileName = pbmFile.fullPath,
ContentType = Path.GetExtension(filePath)
};
byte[] fileBytes1 = System.IO.File.ReadAllBytes(filePath);
mediaObject1.SetValue(fileBytes1);
IDictionary<string, object> upload1 = new Dictionary<string, object>();
upload1.Add("image", mediaObject1);

staticGlobalConst.fbClient1.Post("/me/videos", upload1, staticGlobalConst.del1Video) as JsonObject

When I add the code below it throws exception

I tried adding parameter

upload1.Add("privacy", "SELF");

How can I upload a private video?

Thanks Sujit


回答1:


I solved it by adding below parameter

upload1.Add("privacy", "{\"value\":\"SELF\"}");



回答2:


that is depends on what was your choice for " Visibility of app and posts: " option when the first time you authenticated with the app.

you can change it to : Public,Friends,Only Me , from your Account Settings>Apps and choose your application and change it .



来源:https://stackoverflow.com/questions/15038867/facebook-c-sharp-api-video-getting-uploaded-but-its-public

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!