可能是未能正确设置视频URL或AR跟踪失败导致的。可以尝试重新设置视频URL或检查AR跟踪是否成功。
代码示例:
let videoURL = URL(string: "video.mp4")
if let videoAnchor = try? ARAnchor(url: videoURL!) {
sceneView.session.add(anchor: videoAnchor)
} else {
print("Failed to load video anchor")
}
func session(_ session: ARSession, didFailWithError error: Error) {
if let arError = error as? ARError {
if arError.code == .errorGenerallyUnavailable {
print("AR tracking unavailable")
}
}
}