首页 > 解决方案 > A-frame 图像在移动 ios Safari 的反应中未正确加载。我得到一个黑盒子而不是图像

问题描述

一切似乎在 android 上运行良好,但 ios 始终给我一个块框。

<Entity primitive="a-assets">
     {userState.photo_memory_filepath && !loading ? (
              <img
                id="first-image"
                src={`${GOOGLE_CLOUD_BUCKET_PUBLIC}/${userState.photo_memory_filepath}`}
                crossOrigin="Anonymous"
              />
            ) : null}
   </Entity>

后来我有

{userState.photo_memory_filepath && !loading ? (
            <Entity
              primitive="a-image"
              src="#first-image"
              position="0 3 -9"
              width="2"
              height="2"
              material="side: double"
              id="first-image-view"
            ></Entity>
          ) : null}

Loading 是一种 redux 状态,在发出请求之前设置为 true。在桌面网络和安卓上一切正常,但 ios 让我大吃一惊。哦,我还尝试了 createObjectURL,它也适用于桌面和 android,但对 ios 无用。我真的相信 IOS 移动 webapp 开发者被诅咒了

标签: iosreactjsimageaframe

解决方案


推荐阅读