我想通过我的应用程序在Facebook上传视频,我可以上传5 MB的小视频。 但是我无法上传大型视频。
CODE:
byte[] data = null;
InputStream is;
String dataMsg = "Your video description here.";
String dataName=".mp4";
Bundle param;
// FakeX509TrustManager.allowAllSSL();
mFacebook = new Facebook(APP_ID);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
// System.setProperty("http.keepAlive", "false");
//file = new File(videoPath);
// System.gc();
try {
is = new FileInputStream(videoPath);
data = readBytes(is);
// data = IOUtils.toByteArray(is);
param = new Bundle();
param.putString(Facebook.TOKEN, AG.access_token);
param.putString("message", dataMsg);
param.putString("filename", dataName);
param.putString("method", "me/videos");
param.putString("contentType", "video/quicktime");
param.putByteArray("video.mp4", data);
// param.putByteArray("video", data);
mAsyncRunner.request("me/videos", param, "POST", new fbRequestListener(), null);
Thanks in advance