1

my codes to upload video:

request = Request.newUploadVideoRequest(Session.getActiveSession(),  new File("/mnt/sdcard/DCIM/Camera/VID_20130317_185519.3gp"), FBRequestCallbacker);
Bundle params = request.getParameters();
if (!mPost.getDescription().equals("")) {
    params.putString("description",mPost.getDescription() + " \n\n" + footer.toString());
} else {
    params.putString("description", footer.toString());
}

if (!mPost.getDescription().equals("title")) {
    params.putString("title", mPost.getTitle());
}

request.setParameters(params);
request.executeAsync();

There is no error returned from the callback function, i.e. response.getError() == null. However, Facebook website returns "Your video could not be processed. Visit the Video help page to learn about common problems." and there is no way to check further down.

Any idea? Thank you very much.

hjchin
  • 864
  • 2
  • 8
  • 25
  • I tried to use previous SDK and with a fix that I found (similar to http://stackoverflow.com/questions/10696683/cant-post-video-in-facebook-in-android) which able to upload video but it can't right now. It got the same message as SDK3.0. It is strange that they don't have video upload example in the SDK3.0. Does anyone has working example? I have been struggling on this issue for the past few days. – hjchin Mar 20 '13 at 16:10
  • I have found the post that I followed last time. http://stackoverflow.com/questions/6908413/is-uploading-videos-from-an-sd-card-to-facebook-possible-with-the-facebook-sdk and I re-implemented it but it is no longer working. The same message "Your video could not be processed. Visit the Video help page to learn about common problems" appears at FB notification. I can't post any comments on that post due to my reputation score is insufficient. Could someone confirm if that codes still working? Thank you very much. – hjchin Mar 20 '13 at 17:53
  • This question appears to be off-topic because it is about a problem with a Facebook account. – Robert Harvey Aug 08 '13 at 16:13

2 Answers2

2

Try this code, it is working:

File file=new File(Environment.getExternalStorageDirectory()+"/testvideo.mp4");
                        try {
                            Request audioRequest = Request.newUploadVideoRequest(session, file, new Request.Callback() {

                                @Override
                                public void onCompleted(Response response) {
                                    // TODO Auto-generated method stub

                                    if(response.getError()==null)
                                    {
                                        Toast.makeText(MainActivity.this, "Video Shared Successfully", Toast.LENGTH_SHORT).show();
                                    }
                                    else
                                    {
                                        Toast.makeText(MainActivity.this, response.getError().getErrorMessage(), Toast.LENGTH_SHORT).show();
                                    }
                                }
                            });
                            audioRequest.executeAsync();
                        } catch (Exception e) {
                            e.printStackTrace();

                        }
Mohit Verma
  • 3,025
  • 1
  • 20
  • 36
  • This code works fine but it doesn't allow for a description. How can you pop up the user to write a description of the video? Or at least how can you pass a description string as parameter? – Stefan Alexandru Mar 12 '14 at 09:57
0

I finally figured out what's wrong with the previous testings. The codes at Is uploading videos from an SD Card to Facebook possible with the Facebook SDK? works perfectly. The culprit behinds all the problems is the FB account that I used for the testing. I'm not sure what happened to the test account which I have been using for couple of months. It was working fine couple of months ago. The notification messages just appear in my test account but never in my real FB account. I have successfully uploaded video to my real FB account without any problem.

But this doesn't explain why the test account has failed in the testing.

Community
  • 1
  • 1
hjchin
  • 864
  • 2
  • 8
  • 25