@variantic/player 0.0.23 → 0.0.25
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 +35 -3
- package/assembly.d.ts +4762 -0
- package/index.d.ts +2198 -0
- package/package.json +17 -10
- package/libs/packages/player/src/index.d.ts +0 -8
- package/libs/schemas/engine/src/index.d.ts +0 -3
- package/libs/schemas/engine/src/lib/documentation.d.ts +0 -9
- package/libs/schemas/engine/src/lib/engine.d.ts +0 -206
- package/libs/schemas/engine/src/lib/publication.d.ts +0 -83
- package/libs/schemas/file-types/export-configuration/src/index.d.ts +0 -1
- package/libs/schemas/file-types/export-configuration/src/lib/export-configuration.d.ts +0 -10
- package/libs/schemas/file-types/vas/src/index.d.ts +0 -3
- package/libs/schemas/file-types/vas/src/lib/interaction.d.ts +0 -3
- package/libs/schemas/file-types/vas/src/lib/object-configuration.d.ts +0 -25
- package/libs/schemas/file-types/vas/src/lib/vas.d.ts +0 -526
- package/libs/schemas/library-api/src/index.d.ts +0 -1
- package/libs/schemas/library-api/src/lib/library-api.d.ts +0 -27
- package/libs/schemas/web-component/api/player/ar/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/ar/src/lib/ar.d.ts +0 -22
- package/libs/schemas/web-component/api/player/configuration/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/configuration/src/lib/configuration.d.ts +0 -27
- package/libs/schemas/web-component/api/player/documentation/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/documentation/src/lib/documentation.d.ts +0 -26
- package/libs/schemas/web-component/api/player/events/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/events/src/lib/events.d.ts +0 -19
- package/libs/schemas/web-component/api/player/integration-connector/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/integration-connector/src/lib/integration-connector.d.ts +0 -30
- package/libs/schemas/web-component/api/player/layout/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/layout/src/lib/layout.d.ts +0 -18
- package/libs/schemas/web-component/api/player/player/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/player/src/lib/player.d.ts +0 -46
- package/libs/schemas/web-component/api/player/snapshot/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/snapshot/src/lib/snapshot.d.ts +0 -29
- package/libs/schemas/web-component/api/player/viewer/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/viewer/src/lib/viewer.d.ts +0 -471
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@ Future versions will introduce functionalities for controlling the embedded play
|
|
|
6
6
|
|
|
7
7
|
## 📦 Installation
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Install this type-only package as a development dependency:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install @variantic/player
|
|
12
|
+
npm install --save-dev @variantic/player
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## 🚀 Usage
|
|
@@ -17,7 +17,7 @@ npm install @variantic/player
|
|
|
17
17
|
Import the necessary types into your TypeScript project:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
|
-
import { TSnapshotUrl } from '@variantic/player';
|
|
20
|
+
import type { TSnapshotUrl } from '@variantic/player';
|
|
21
21
|
|
|
22
22
|
const snapshotUrl: TSnapshotUrl = {
|
|
23
23
|
url: 'testUrl',
|
|
@@ -25,6 +25,38 @@ const snapshotUrl: TSnapshotUrl = {
|
|
|
25
25
|
};
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
## Assembly player (player-ng)
|
|
29
|
+
|
|
30
|
+
Use the `/assembly` entrypoint for the assembly player's public API, query store,
|
|
31
|
+
and addon types:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import type { TPlayerComponent } from '@variantic/player/assembly';
|
|
35
|
+
|
|
36
|
+
await customElements.whenDefined('variantic-player-ng');
|
|
37
|
+
|
|
38
|
+
const player = document.querySelector('variantic-player-ng') as TPlayerComponent | null;
|
|
39
|
+
if (!player) {
|
|
40
|
+
throw new Error('The player element was not found');
|
|
41
|
+
}
|
|
42
|
+
await player.api.ready();
|
|
43
|
+
|
|
44
|
+
console.log('Current status:', player.api.query.get('status'));
|
|
45
|
+
|
|
46
|
+
const unsubscribe = player.api.query.subscribe('status', (status) => {
|
|
47
|
+
console.log('Player status:', status);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Call this when your integration is disposed.
|
|
51
|
+
function destroyPlayerIntegration() {
|
|
52
|
+
unsubscribe();
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Run this setup after embedding `<variantic-player-ng>` and loading its script.
|
|
57
|
+
`api.ready()` waits for addon APIs, the initial scene, and query state, including
|
|
58
|
+
when the player has already finished initializing.
|
|
59
|
+
|
|
28
60
|
## 📜 License
|
|
29
61
|
|
|
30
62
|
This package is licensed under the MIT License. See [LICENSE](./LICENSE) for details.
|