@3dsource/angular-unreal-module 0.0.85 → 0.0.86

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/LICENSE CHANGED
@@ -1,14 +1,14 @@
1
- Copyright (c) 2025 3dsource
2
- All Rights Reserved.
3
-
4
- This software and associated documentation files (the “Software”) are proprietary
5
- and confidential. Unauthorized copying, modification, distribution, or any other
6
- use of the Software, in whole or in part, without the prior written consent of
7
- the copyright holder is strictly prohibited.
8
-
9
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11
- FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
12
- COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
13
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2025 3dsource
2
+ All Rights Reserved.
3
+
4
+ This software and associated documentation files (the “Software”) are proprietary
5
+ and confidential. Unauthorized copying, modification, distribution, or any other
6
+ use of the Software, in whole or in part, without the prior written consent of
7
+ the copyright holder is strictly prohibited.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11
+ FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
12
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
13
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,169 +1,169 @@
1
- # @3dsource/angular-unreal-module
2
-
3
- A set of standalone Angular components, services, and providers for integrating Unreal Engine (WebRTC) scenes into Angular applications. It facilitates communication between Angular and Unreal Engine and enables interactive 3D experiences.
4
-
5
- ## Overview
6
-
7
- This package provides:
8
-
9
- - Standalone Unreal scene component to embed UE stream
10
- - Communication bridge (commands, UI interactions, input data)
11
- - NgRx state and effects for 3D stream lifecycle
12
- - Config and utilities for telemetry, errors, and regions ping
13
-
14
- ## Installation
15
-
16
- ### Prerequisites
17
-
18
- - Angular 18+
19
- - NgRx store and effects (v18+)
20
-
21
- ### Peer Dependencies
22
-
23
- This library requires the following peer dependencies (match or exceed versions):
24
-
25
- ```json
26
- {
27
- "@3dsource/source-ui-native": ">=1.0.9",
28
- "@3dsource/types-unreal": ">=0.0.7",
29
- "@3dsource/utils": ">=1.0.21",
30
- "@angular/cdk": ">=18.0.0",
31
- "@angular/common": ">=18.0.0",
32
- "@angular/core": ">=18.0.0",
33
- "@angular/forms": ">=18.0.0",
34
- "@ngrx/effects": ">=18.0.0",
35
- "@ngrx/store": ">=18.0.0"
36
- }
37
- ```
38
-
39
- ### Library Installation
40
-
41
- ```shell
42
- npm i @3dsource/angular-unreal-module
43
- ```
44
-
45
- ## Usage
46
-
47
- The API is fully standalone (no NgModule). Use providers and components as shown below.
48
-
49
- ### 1) Provide the module services and store slice
50
-
51
- Add providers in your application bootstrap (e.g., app.config.ts):
52
-
53
- ```ts
54
- import { ApplicationConfig } from '@angular/core';
55
- import { provideRouter } from '@angular/router';
56
- import { provideStore } from '@ngrx/store';
57
- import { provideEffects } from '@ngrx/effects';
58
- import { provideAngularUnrealModule, UNREAL_CONFIG } from '@3dsource/angular-unreal-module';
59
-
60
- export const appConfig: ApplicationConfig = {
61
- providers: [
62
- provideRouter([]),
63
- // Root NgRx (if not already added in your app)
64
- provideStore(),
65
- provideEffects(),
66
-
67
- // Unreal providers (adds feature state and effects internally)
68
- // Tip: pass { playwright: true } to switch to testing/dummy services
69
- ...provideAngularUnrealModule({ playwright: false }),
70
-
71
- // Optional initial config
72
- {
73
- provide: UNREAL_CONFIG,
74
- useValue: {
75
- // customErrorsEndpoint?: string,
76
- // commandTelemetryReceiver?: string,
77
- // regionsPingUrl?: string,
78
- // screenLockerContainerId?: string,
79
- // dataChannelConnectionTimeout?: number,
80
- // playwright?: boolean, // mirrors the provider flag; can be used by services/effects
81
- },
82
- },
83
- ],
84
- };
85
- ```
86
-
87
- ### 2) Use the Unreal scene component
88
-
89
- Import the component into a standalone component and use it in the template.
90
-
91
- ```ts
92
- import { Component } from '@angular/core';
93
- import { UnrealSceneComponent } from '@3dsource/angular-unreal-module';
94
-
95
- @Component({
96
- selector: 'app-root',
97
- standalone: true,
98
- imports: [UnrealSceneComponent],
99
- template: ` <app-unreal-scene [isStudio]="false" [useContainerAsSizeProvider]="true" [studioResolutionSize]="{ width: 1920, height: 1080 }" (changeMouseOverScene)="onHover($event)"></app-unreal-scene> `,
100
- })
101
- export class AppComponent {
102
- onHover(isOver: boolean) {
103
- // handle mouse over scene
104
- }
105
- }
106
- ```
107
-
108
- Component selector: <app-unreal-scene>
109
-
110
- Inputs:
111
-
112
- - isStudio: boolean = false
113
- - useContainerAsSizeProvider: boolean = true
114
- - studioResolutionSize: { width: number; height: number } = { width: 1920, height: 1080 }
115
-
116
- Outputs:
117
-
118
- - changeMouseOverScene: EventEmitter<boolean>
119
-
120
- ### 3) Send commands / interactions to Unreal
121
-
122
- Inject `UnrealCommunicatorService` to send commands or UI interactions. Types for command packets are provided by `@3dsource/types-unreal`.
123
-
124
- ```ts
125
- import { Component, inject } from '@angular/core';
126
- import { UnrealCommunicatorService } from '@3dsource/angular-unreal-module';
127
- import type { MetaBoxCommandPacket } from '@3dsource/types-unreal';
128
-
129
- @Component({ standalone: true, template: '' })
130
- export class MyComponent {
131
- private unreal = inject(UnrealCommunicatorService);
132
-
133
- sendSomeCommand() {
134
- const packet: MetaBoxCommandPacket = {
135
- command: 'SomeCommand',
136
- parameters: {
137
- /* command parameters */
138
- },
139
- } as MetaBoxCommandPacket;
140
-
141
- // Records telemetry and dispatches store events
142
- this.unreal.sendCommandToUnreal(packet);
143
- // Or use:
144
- // this.unreal.emitCommand(packet); // to send as Command message
145
- // this.unreal.emitUIInteraction(packet); // to send as UIInteraction
146
- }
147
- }
148
- ```
149
-
150
- ## Features
151
-
152
- - Standalone Unreal Scene Component
153
- - Command and UI Interaction API via UnrealCommunicatorService
154
- - Event-driven status UI (freeze frame, video stats, play overlay)
155
- - NgRx-powered state management and effects
156
- - Optional initial configuration via UNREAL_CONFIG token
157
-
158
- ## Examples
159
-
160
- Check the demo application for complete usage examples:
161
-
162
- ```shell
163
- npm run demo:start
164
- ```
165
-
166
- ## Engine requirements
167
-
168
- - Node.js: >=20
169
- - npm: >9
1
+ # @3dsource/angular-unreal-module
2
+
3
+ A set of standalone Angular components, services, and providers for integrating Unreal Engine (WebRTC) scenes into Angular applications. It facilitates communication between Angular and Unreal Engine and enables interactive 3D experiences.
4
+
5
+ ## Overview
6
+
7
+ This package provides:
8
+
9
+ - Standalone Unreal scene component to embed UE stream
10
+ - Communication bridge (commands, UI interactions, input data)
11
+ - NgRx state and effects for 3D stream lifecycle
12
+ - Config and utilities for telemetry, errors, and regions ping
13
+
14
+ ## Installation
15
+
16
+ ### Prerequisites
17
+
18
+ - Angular 18+
19
+ - NgRx store and effects (v18+)
20
+
21
+ ### Peer Dependencies
22
+
23
+ This library requires the following peer dependencies (match or exceed versions):
24
+
25
+ ```json
26
+ {
27
+ "@3dsource/source-ui-native": ">=1.0.9",
28
+ "@3dsource/types-unreal": ">=0.0.7",
29
+ "@3dsource/utils": ">=1.0.21",
30
+ "@angular/cdk": ">=18.0.0",
31
+ "@angular/common": ">=18.0.0",
32
+ "@angular/core": ">=18.0.0",
33
+ "@angular/forms": ">=18.0.0",
34
+ "@ngrx/effects": ">=18.0.0",
35
+ "@ngrx/store": ">=18.0.0"
36
+ }
37
+ ```
38
+
39
+ ### Library Installation
40
+
41
+ ```shell
42
+ npm i @3dsource/angular-unreal-module
43
+ ```
44
+
45
+ ## Usage
46
+
47
+ The API is fully standalone (no NgModule). Use providers and components as shown below.
48
+
49
+ ### 1) Provide the module services and store slice
50
+
51
+ Add providers in your application bootstrap (e.g., app.config.ts):
52
+
53
+ ```ts
54
+ import { ApplicationConfig } from '@angular/core';
55
+ import { provideRouter } from '@angular/router';
56
+ import { provideStore } from '@ngrx/store';
57
+ import { provideEffects } from '@ngrx/effects';
58
+ import { provideAngularUnrealModule, UNREAL_CONFIG } from '@3dsource/angular-unreal-module';
59
+
60
+ export const appConfig: ApplicationConfig = {
61
+ providers: [
62
+ provideRouter([]),
63
+ // Root NgRx (if not already added in your app)
64
+ provideStore(),
65
+ provideEffects(),
66
+
67
+ // Unreal providers (adds feature state and effects internally)
68
+ // Tip: pass { playwright: true } to switch to testing/dummy services
69
+ ...provideAngularUnrealModule({ playwright: false }),
70
+
71
+ // Optional initial config
72
+ {
73
+ provide: UNREAL_CONFIG,
74
+ useValue: {
75
+ // customErrorsEndpoint?: string,
76
+ // commandTelemetryReceiver?: string,
77
+ // regionsPingUrl?: string,
78
+ // screenLockerContainerId?: string,
79
+ // dataChannelConnectionTimeout?: number,
80
+ // playwright?: boolean, // mirrors the provider flag; can be used by services/effects
81
+ },
82
+ },
83
+ ],
84
+ };
85
+ ```
86
+
87
+ ### 2) Use the Unreal scene component
88
+
89
+ Import the component into a standalone component and use it in the template.
90
+
91
+ ```ts
92
+ import { Component } from '@angular/core';
93
+ import { UnrealSceneComponent } from '@3dsource/angular-unreal-module';
94
+
95
+ @Component({
96
+ selector: 'app-root',
97
+ standalone: true,
98
+ imports: [UnrealSceneComponent],
99
+ template: ` <app-unreal-scene [isStudio]="false" [useContainerAsSizeProvider]="true" [studioResolutionSize]="{ width: 1920, height: 1080 }" (changeMouseOverScene)="onHover($event)"></app-unreal-scene> `,
100
+ })
101
+ export class AppComponent {
102
+ onHover(isOver: boolean) {
103
+ // handle mouse over scene
104
+ }
105
+ }
106
+ ```
107
+
108
+ Component selector: <app-unreal-scene>
109
+
110
+ Inputs:
111
+
112
+ - isStudio: boolean = false
113
+ - useContainerAsSizeProvider: boolean = true
114
+ - studioResolutionSize: { width: number; height: number } = { width: 1920, height: 1080 }
115
+
116
+ Outputs:
117
+
118
+ - changeMouseOverScene: EventEmitter<boolean>
119
+
120
+ ### 3) Send commands / interactions to Unreal
121
+
122
+ Inject `UnrealCommunicatorService` to send commands or UI interactions. Types for command packets are provided by `@3dsource/types-unreal`.
123
+
124
+ ```ts
125
+ import { Component, inject } from '@angular/core';
126
+ import { UnrealCommunicatorService } from '@3dsource/angular-unreal-module';
127
+ import type { MetaBoxCommandPacket } from '@3dsource/types-unreal';
128
+
129
+ @Component({ standalone: true, template: '' })
130
+ export class MyComponent {
131
+ private unreal = inject(UnrealCommunicatorService);
132
+
133
+ sendSomeCommand() {
134
+ const packet: MetaBoxCommandPacket = {
135
+ command: 'SomeCommand',
136
+ parameters: {
137
+ /* command parameters */
138
+ },
139
+ } as MetaBoxCommandPacket;
140
+
141
+ // Records telemetry and dispatches store events
142
+ this.unreal.sendCommandToUnreal(packet);
143
+ // Or use:
144
+ // this.unreal.emitCommand(packet); // to send as Command message
145
+ // this.unreal.emitUIInteraction(packet); // to send as UIInteraction
146
+ }
147
+ }
148
+ ```
149
+
150
+ ## Features
151
+
152
+ - Standalone Unreal Scene Component
153
+ - Command and UI Interaction API via UnrealCommunicatorService
154
+ - Event-driven status UI (freeze frame, video stats, play overlay)
155
+ - NgRx-powered state management and effects
156
+ - Optional initial configuration via UNREAL_CONFIG token
157
+
158
+ ## Examples
159
+
160
+ Check the demo application for complete usage examples:
161
+
162
+ ```shell
163
+ npm run demo:start
164
+ ```
165
+
166
+ ## Engine requirements
167
+
168
+ - Node.js: >=20
169
+ - npm: >9