【问题标题】:Video cannot be processed error notification while uploading a video [closed]上传视频时无法处理视频错误通知[关闭]
【发布时间】:2013-03-20 08:19:21
【问题描述】:

当我尝试从我的 android 应用程序将不同格式的视频(包括 .mp4 和 .3gp 文件)上传到 facebook 时,我在我的 facebook 帐户中收到一条通知,提示“无法处理您的视频。请访问视频帮助页面了解常见问题”。请帮助我。 postToWall 功能将视频发布到 facebook。

    private void postToWall(String accessToken) {        
         String dataPath = "/mnt/sdcard/DCIM/Camera/video-2013-04-11-04-30-05.mp4";
         InputStream is = null;
         byte[] data = null;
         try {
            is = new FileInputStream(dataPath);
            data = readBytes(is);
        } catch (FileNotFoundException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 
        Bundle params = new Bundle();   
        params.putString(Facebook.TOKEN, mFacebook.getAccessToken());              
        params.putString("filename", "Video_02.mp4");
        params.putByteArray("video", data);
        params.putString("contentType", "video/quicktime");
       params.putString("message", "video message");         
        mAsyncRunner.request("me/videos", params, "POST", new PostRequestListener(), null);
    }


               public byte[] readBytes(InputStream inputStream) throws IOException {
        // This dynamically extends to take the bytes you read.
        ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();

        // This is storage overwritten on each iteration with bytes.
        int bufferSize = 1024;
        byte[] buffer = new byte[bufferSize];

        // We need to know how may bytes were read to write them to the byteBuffer.
        int len = 0;
        while ((len = inputStream.read(buffer)) != -1) {
            byteBuffer.write(buffer, 0, len);
        }

        // And then we can return your byte array.
        return byteBuffer.toByteArray();
    }

【问题讨论】:

标签: android facebook video upload video-processing


【解决方案1】:

这似乎是 Facebook API 或 SDK 的一个新的已知错误(今天第一次报告)。

您可以在此处支持错误报告: http://developers.facebook.com/bugs/543903808965945

【讨论】:

    猜你喜欢
    • 2021-10-12
    • 2012-08-04
    • 2017-06-18
    • 1970-01-01
    • 2019-06-18
    • 2012-11-20
    • 2023-03-13
    • 2011-07-31
    • 2021-07-19
    相关资源
    最近更新 更多