0

I am using TweetInvi to post video on Twitter.

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();

Tweet is posting successfully. But video file is missing. I have used code from tweetinvi twwet with media

Thanks in advance.

Kees C. Bakker
  • 32,294
  • 27
  • 115
  • 203
JSP.NET
  • 188
  • 13
  • i used tinytwitter https://github.com/SnapStreamJason/TinyTwitter. video uplaod is working properly. – JSP.NET Jun 30 '15 at 11:57

1 Answers1

2

Twitter is using a new upload mechanism for videos. Tweetinvi has not yet released this feature but it will be available in Tweetinvi 0.9.8.2 that I will release today that will contains this specific feature.

In the meantime please follow the instructions available in this link (read the mark as answered solution).


Update :

You can now use the VideoUploader using Tweetinvi 0.9.8.2. Unfortunately, nuget has some issues so you will have to specify the version for now:

Install-Package TweetinviAPI -Version 0.9.8.2

Here is a code sample :

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();

Cheers, Linvi

Linvi
  • 2,077
  • 1
  • 14
  • 28