@avaturn-live/web-sdk 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -10
- package/dist/.vite/manifest.json +0 -6
- package/dist/main.cjs +70 -22
- package/dist/main.d.ts +17 -4
- package/dist/main.js +832 -678
- package/dist/type.d.ts +9 -0
- package/package.json +1 -6
- package/dist/extra.cjs +0 -48
- package/dist/extra.d.ts +0 -21
- package/dist/extra.js +0 -221
package/README.md
CHANGED
|
@@ -23,16 +23,10 @@ npm install @avaturn-live/web-sdk
|
|
|
23
23
|
2. Initialize the `AvaturnHead` instance with your session token.
|
|
24
24
|
|
|
25
25
|
```typescript
|
|
26
|
-
const
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
3. Once the avatar is initialized, get a reference to the HTML video element where you want to display the avatar's video stream.
|
|
26
|
+
const domElement = document.querySelector("#root");
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const videoRef: HTMLVideoElement = document.querySelector("#video")!;
|
|
34
|
-
videoRef.srcObject = avatar.mediaStream;
|
|
35
|
-
videoRef.play();
|
|
28
|
+
const avatar = new AvaturnHead(domElement, {
|
|
29
|
+
sessionToken: "<YOUR_SESSION_TOKEN>",
|
|
36
30
|
});
|
|
37
31
|
```
|
|
38
32
|
|
|
@@ -49,7 +43,7 @@ Ensure you have an HTML structure with a video element that has an `id` of `vide
|
|
|
49
43
|
<title>Avaturn Head Example</title>
|
|
50
44
|
</head>
|
|
51
45
|
<body>
|
|
52
|
-
<
|
|
46
|
+
<div id="root"></div>
|
|
53
47
|
|
|
54
48
|
<!-- Include your bundled JavaScript here -->
|
|
55
49
|
</body>
|