这里需要填写「授权证书文件」和「授权服务地址」,如有疑问请联系我们的商务或技术支持。
通过调用 ARSDK.createSession
即可创建一个 ARSession,Web AR SDK 的大部分功能都可以通过操作 ARSession 来实现。
import {
ARSession,
ARSDK,
} from "@volcengine/webar";
// 获取之前创建的 canvas.
// Get get canvas element created in the previous step.
const canvas = document.getElementById("preview")! as HTMLCanvasElement;
// 创建 ARSession
// Create an ARSession
const session = ARSDK.createSession({
canvas,
authorization: {
// 你的「授权证书文件」地址或内容:「https 文件链接」或「文件的 Base64 内容」。
// Your authorization file url or content.
file: "",
// 授权服务地址
// The authorization service endpoint.
serviceEndpoint: "https://webar.volces.com/api/v2/webardeliver/verify",
},
});