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.

没有正确的解决方案

其他提示

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();

                        }

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top