在推特上上传视频 [英] Upload video on twitter
问题描述
我必须从 android 应用程序在 twitter 上上传视频.我已成功在推特上上传图片和文字.我正在使用 twitter4j-core-3.0.3.jar
库.
I have to upload a video on twitter from android app. I have successfully uploaded image and text on twitter. I am using the twitter4j-core-3.0.3.jar
library.
我尝试使用与图像相同的方法上传视频,但上传失败并收到异常代码 403
和 TwitterException {exceptionCode=[2ea3c142-58dea759], statusCode=403,message=错误创建状态.,代码=189,retryAfter=-1,rateLimitStatus=null,version=3.0.3}
.
I tried uploading video using the same method I used for images, but failed to upload and got exception code 403
and TwitterException {exceptionCode=[2ea3c142-58dea759], statusCode=403, message=Error creating status., code=189, retryAfter=-1, rateLimitStatus=null, version=3.0.3}
.
我还从 http://twitvid.pbworks.com/下载了 twitvid sdkw/page/22556292/Client%20Libraries,但即使集成了这个sdk,我也无法在twitter上上传视频.
I also downloaded twitvid sdk from http://twitvid.pbworks.com/w/page/22556292/Client%20Libraries, but even after integrating this sdk, I could not upload video on twitter.
根据 twitter 官方讨论主题 https://dev.twitter.com/discussions/11241 我们可以使用该代码使用 twitvid 上传视频.
As per twitter official discusion thread https://dev.twitter.com/discussions/11241 we can upload video using twitvid using that code.
由于我没有合适的 sdk,我无法处理此问题.任何帮助从 android 应用程序在 twitter 上上传视频将不胜感激.
Since I am not having a suitable sdk, I am not able to work on this. Any help to upload video on twitter from android app will be highly appreciated.
推荐答案
EDIT 2016: 此答案已过时.除了链接之外,Twitter 现在还支持视频上传.
EDIT 2016: This answer is outdated. Twitter now support video upload in addition to linking.
您不能将视频直接上传到 Twitter - 他们根本不支持.
You cannot upload video directly to Twitter - they simply don't support it.
这是您必须做的事情.
- 将视频上传到第三方服务(如 YouTube)
- 获取上传视频的公开网址
- 将 URL 添加到您发送到 Twitter 的状态中 - 例如"这是我的视频 http://example.com/video123"
如果需要,您可以添加视频的缩略图作为图像附件.
If you want, you can add a thumbnail of the video as an image attachment.
这篇关于在推特上上传视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!