我正在使用TweetInvi在推特上发布视频。
TwitterCredentials.SetCredentials(token.Token,token.TokenSecret,ConfigurationManager.AppSettings["ConsumerKey"], ConfigurationManager. AppSettings["ConsumerSecret"]);
var filePath = string.Format("{0}content\\participant\\video\\{1}.{2}", Request.PhysicalApplicationPath, p.video, "mp4");
byte[] file1 =System.IO.File.ReadAllBytes(filePath);
var tweet = Tweetinvi.Tweet.CreateTweet(message);
tweet.AddMedia(file1, "video");
var success = tweet.Publish();推特已经成功发布了。但是视频文件不见了。我使用了来自tweetinvi和媒体的代码
提前谢谢。
发布于 2015-06-30 12:20:44
Twitter正在使用一种新的视频上传机制。Tweetinvi还没有发布这个特性,但是我将在今天发布的Tweetinvi 0.9.8.2中提供包含这个特定特性的特性。
同时,请按照本链接中可用的说明(将标记作为应答解决方案阅读)。
最新情况:
现在可以使用Tweetinvi 0.9.8.2使用VideoUploader。不幸的是,nuget有一些问题,所以您现在必须指定版本:
安装-软件包TweetinviAPI -Version 0.9.8.2
下面是一个代码示例:
var binary = File.ReadAllBytes(@"C:\video.mp4");
var media = VideoUploader.UploadVideo(binary);
var tweet = Tweet.CreateTweet("hello" + Guid.NewGuid());
tweet.AddMedia(media);
var success = tweet.Publish();干杯,伦维
https://stackoverflow.com/questions/31135902
复制相似问题