You need to enable JavaScript to run this app.
AR互动营销

AR互动营销

复制全文
快速开始
初始化Web AR SDK
复制全文
初始化Web AR SDK

这里需要填写「授权证书文件」和「授权服务地址」,如有疑问请联系我们的商务或技术支持。
通过调用 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",
    },
});
最近更新时间:2023.11.21 14:50:49
这个页面对您有帮助吗?
有用
有用
无用
无用