Originally created by: ahmedeldeeb25
I was using this method to publish videos on Twitter, but since 5 days it didn't work despite I didn't change anything in the code and the same code I use to upload an image and works fine
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true).setOAuthConsumerKey("")
.setOAuthConsumerSecret("")
.setOAuthAccessToken("")
.setOAuthAccessTokenSecret("");
TwitterFactory tf = new TwitterFactory(cb.build());
Twitter twitter = tf.getInstance();
File file = new File("videoPath");
StatusUpdate post = new StatusUpdate("test").media(file);
Status status = twitter.updateStatus(post);