7

I am trying to post 360° photos on behalf of my app's users, but I can't figure out how to make it work.

I loaded the Facebook Javascript Graph API, logged the user with "publish_actions" scope and used the following code to post a picture using equirectangular projection:

FB.api(
        "/me/photos",
        "POST",
        {
            "url": "MY_PUBLIC_URL",
            "allow_spherical_photo": true,
            "spherical_metadata": {
                "ProjectionType": "equirectangular",
                "CroppedAreaImageWidthPixels": 240,
                "CroppedAreaImageHeightPixels": 240,
                "FullPanoWidthPixels": 1962,
                "FullPanoHeightPixels": 981,
                "CroppedAreaLeftPixels": 981,
                "CroppedAreaTopPixels": 490
            }
    }, function (response) {
        console.log(response); // I get "{"id":"...", post_id:"..."} so no error
        if (response && !response.error) {
          /* handle the result */
        }
    }
);

It is posting correctly on the current user's timeline, but it is shown as a "normal" picture, not a 360° panorama.

Did someone implement a 360° panorama posting feature that works?

My photo should have the correct ratio (2:1) and is a correct 360° photo.

Thank you in advance for your help.

4

1 回答 1

4

我终于为我的问题找到了一个可行的解决方案:仅 put"allow_spherical_photo": true和 remove spherical_metadata

然后,360° 图片上需要有元数据,以便 Facebook 处理正确显示它们(此处解释的 XMP 元数据:https ://developers.google.com/streetview/spherical-metadata )

谢谢。

于 2017-01-22T15:33:49.723 回答