3

我想通过我的应用在 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          
4

0 回答 0