cinematic-renderer2d 0.1.0
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 +21 -0
- package/README.md +827 -0
- package/dist/angular.cjs +189 -0
- package/dist/angular.cjs.map +1 -0
- package/dist/angular.d.cts +577 -0
- package/dist/angular.d.ts +577 -0
- package/dist/angular.js +189 -0
- package/dist/angular.js.map +1 -0
- package/dist/cli/index.js +1243 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.cjs +182 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1663 -0
- package/dist/index.d.ts +1663 -0
- package/dist/index.js +182 -0
- package/dist/index.js.map +1 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/react.cjs +182 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +510 -0
- package/dist/react.d.ts +510 -0
- package/dist/react.js +182 -0
- package/dist/react.js.map +1 -0
- package/package.json +151 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { OnInit, OnDestroy, OnChanges, ElementRef, EventEmitter, NgZone, SimpleChanges } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Quality and Performance Types for cinematicRenderer2D
|
|
5
|
+
*
|
|
6
|
+
* These types define the adaptive quality system that monitors performance
|
|
7
|
+
* and automatically adjusts rendering quality to maintain target frame rates.
|
|
8
|
+
*
|
|
9
|
+
* Requirements: 8.1, 8.2, 8.3, 8.4, 8.5 - Adaptive quality system
|
|
10
|
+
*/
|
|
11
|
+
type QualityLevel$1 = 'low' | 'medium' | 'high' | 'ultra' | 'auto';
|
|
12
|
+
interface QualitySettings {
|
|
13
|
+
/** Maximum number of particles to render */
|
|
14
|
+
particleCount: number;
|
|
15
|
+
/** Canvas resolution multiplier (0.5 = half resolution) */
|
|
16
|
+
canvasResolution: number;
|
|
17
|
+
/** Animation interpolation precision (higher = smoother) */
|
|
18
|
+
animationPrecision: number;
|
|
19
|
+
/** Whether to enable blur effects */
|
|
20
|
+
enableBlur: boolean;
|
|
21
|
+
/** Whether to enable shadow effects */
|
|
22
|
+
enableShadows: boolean;
|
|
23
|
+
/** Target frame rate for this quality level */
|
|
24
|
+
targetFps: number;
|
|
25
|
+
/** Whether to enable advanced visual effects */
|
|
26
|
+
enableAdvancedEffects: boolean;
|
|
27
|
+
/** Texture quality multiplier */
|
|
28
|
+
textureQuality: number;
|
|
29
|
+
/** Whether to use hardware acceleration */
|
|
30
|
+
useHardwareAcceleration: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface PerformanceMetrics {
|
|
33
|
+
/** Current frames per second */
|
|
34
|
+
fps: number;
|
|
35
|
+
/** Frame time in milliseconds */
|
|
36
|
+
frameTime: number;
|
|
37
|
+
/** Memory usage in MB */
|
|
38
|
+
memoryUsage?: number;
|
|
39
|
+
/** GPU memory usage in MB */
|
|
40
|
+
gpuMemory?: number;
|
|
41
|
+
/** Number of active particles */
|
|
42
|
+
activeParticles: number;
|
|
43
|
+
/** Number of active layers */
|
|
44
|
+
activeLayers: number;
|
|
45
|
+
/** Number of DOM nodes created */
|
|
46
|
+
domNodes: number;
|
|
47
|
+
/** Canvas draw calls per frame */
|
|
48
|
+
drawCalls: number;
|
|
49
|
+
/** Asset loading time in milliseconds */
|
|
50
|
+
assetLoadTime?: number;
|
|
51
|
+
/** Compilation time in milliseconds */
|
|
52
|
+
compilationTime?: number;
|
|
53
|
+
}
|
|
54
|
+
interface DeviceCapabilities {
|
|
55
|
+
/** Device memory in GB */
|
|
56
|
+
memory?: number;
|
|
57
|
+
/** Number of CPU cores */
|
|
58
|
+
cores?: number;
|
|
59
|
+
/** GPU information */
|
|
60
|
+
gpu?: string;
|
|
61
|
+
/** User prefers reduced motion */
|
|
62
|
+
prefersReducedMotion: boolean;
|
|
63
|
+
/** Device power mode */
|
|
64
|
+
powerMode?: 'high-performance' | 'balanced' | 'power-saver';
|
|
65
|
+
/** Screen refresh rate */
|
|
66
|
+
refreshRate?: number;
|
|
67
|
+
/** Device pixel ratio */
|
|
68
|
+
devicePixelRatio: number;
|
|
69
|
+
/** Whether device supports hardware acceleration */
|
|
70
|
+
supportsHardwareAcceleration: boolean;
|
|
71
|
+
/** Maximum texture size supported */
|
|
72
|
+
maxTextureSize?: number;
|
|
73
|
+
/** Whether device is mobile */
|
|
74
|
+
isMobile: boolean;
|
|
75
|
+
/** Network connection type */
|
|
76
|
+
connectionType?: 'slow-2g' | '2g' | '3g' | '4g' | '5g' | 'wifi' | 'ethernet';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Main interface for the CinematicRenderer2D engine
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
interface ICinematicRenderer2D {
|
|
84
|
+
mount(): Promise<void>;
|
|
85
|
+
play(): void;
|
|
86
|
+
pause(): void;
|
|
87
|
+
stop(): void;
|
|
88
|
+
destroy(): void;
|
|
89
|
+
seek(timeMs: number): void;
|
|
90
|
+
goToEvent(eventId: string): void;
|
|
91
|
+
goToScene(sceneId: string): void;
|
|
92
|
+
setQuality(level: QualityLevel$1): void;
|
|
93
|
+
resize(width: number, height: number): void;
|
|
94
|
+
on(event: string, callback: Function): void;
|
|
95
|
+
off(event: string, callback: Function): void;
|
|
96
|
+
getCurrentTime(): number;
|
|
97
|
+
getDuration(): number;
|
|
98
|
+
isPlaying(): boolean;
|
|
99
|
+
isPaused(): boolean;
|
|
100
|
+
getCurrentEvent(): string | null;
|
|
101
|
+
getCurrentScene(): string | null;
|
|
102
|
+
getState(): PlaybackState;
|
|
103
|
+
getQuality(): QualityLevel$1;
|
|
104
|
+
isMounted(): boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* JSON Specification Types for cinematicRenderer2D
|
|
109
|
+
*
|
|
110
|
+
* These types define the structure of JSON specifications that describe
|
|
111
|
+
* cinematic experiences with events, scenes, layers, and animations.
|
|
112
|
+
*
|
|
113
|
+
* Requirements: 3.1, 3.5 - JSON specification processing with schema versioning
|
|
114
|
+
*/
|
|
115
|
+
interface CinematicSpec {
|
|
116
|
+
/** Schema version for backward compatibility (e.g., "1.0.0") */
|
|
117
|
+
schemaVersion: string;
|
|
118
|
+
/** Engine configuration and global settings */
|
|
119
|
+
engine: EngineConfig;
|
|
120
|
+
/** Array of cinematic events that define high-level sequences */
|
|
121
|
+
events: CinematicEvent[];
|
|
122
|
+
/** Array of scenes containing layers and timing information */
|
|
123
|
+
scenes: CinematicScene[];
|
|
124
|
+
/** Optional asset definitions for preloading and caching */
|
|
125
|
+
assets?: AssetDefinition[];
|
|
126
|
+
}
|
|
127
|
+
interface EngineConfig {
|
|
128
|
+
/** Target frame rate (default: 60, supports up to 120fps) */
|
|
129
|
+
targetFps?: number;
|
|
130
|
+
/** Quality level for performance optimization */
|
|
131
|
+
quality?: QualityLevel;
|
|
132
|
+
/** Enable debug mode with performance overlay */
|
|
133
|
+
debug?: boolean;
|
|
134
|
+
/** Auto-start playback after mounting */
|
|
135
|
+
autoplay?: boolean;
|
|
136
|
+
}
|
|
137
|
+
interface CinematicEvent {
|
|
138
|
+
/** Unique identifier for the event */
|
|
139
|
+
id: string;
|
|
140
|
+
/** Human-readable name for the event */
|
|
141
|
+
name: string;
|
|
142
|
+
/** Array of scene IDs that make up this event */
|
|
143
|
+
scenes: string[];
|
|
144
|
+
/** Optional transitions between scenes */
|
|
145
|
+
transitions?: TransitionSpec[];
|
|
146
|
+
}
|
|
147
|
+
interface CinematicScene {
|
|
148
|
+
/** Unique identifier for the scene */
|
|
149
|
+
id: string;
|
|
150
|
+
/** Human-readable name for the scene */
|
|
151
|
+
name: string;
|
|
152
|
+
/** Duration of the scene in milliseconds */
|
|
153
|
+
duration: number;
|
|
154
|
+
/** Array of layers that make up this scene */
|
|
155
|
+
layers: LayerSpec[];
|
|
156
|
+
/** Optional audio tracks for this scene */
|
|
157
|
+
audio?: AudioTrackSpec[];
|
|
158
|
+
}
|
|
159
|
+
interface LayerSpec {
|
|
160
|
+
/** Unique identifier for the layer */
|
|
161
|
+
id: string;
|
|
162
|
+
/** Layer type - determines which renderer handles this layer */
|
|
163
|
+
type: LayerType;
|
|
164
|
+
/** Z-index for layer ordering (higher values render on top) */
|
|
165
|
+
zIndex: number;
|
|
166
|
+
/** Layer-specific configuration properties */
|
|
167
|
+
config: LayerConfig;
|
|
168
|
+
/** Optional animation tracks for this layer */
|
|
169
|
+
animations?: AnimationTrackSpec[];
|
|
170
|
+
}
|
|
171
|
+
/** Supported layer types for different rendering backends */
|
|
172
|
+
type LayerType = 'gradient' | 'image' | 'textBlock' | 'vignette' | 'glowOrb' | 'noiseOverlay' | 'particles' | 'starfield' | 'dust' | 'nebulaNoise' | 'webgl-custom';
|
|
173
|
+
/** Base configuration for all layer types */
|
|
174
|
+
interface LayerConfig {
|
|
175
|
+
/** Layer opacity (0-1) */
|
|
176
|
+
opacity?: number;
|
|
177
|
+
/** Layer visibility */
|
|
178
|
+
visible?: boolean;
|
|
179
|
+
/** Position and transform properties */
|
|
180
|
+
transform?: TransformConfig;
|
|
181
|
+
/** Layer-specific properties (varies by type) */
|
|
182
|
+
[key: string]: any;
|
|
183
|
+
}
|
|
184
|
+
/** Transform configuration for layer positioning and animation */
|
|
185
|
+
interface TransformConfig {
|
|
186
|
+
/** X position (pixels or percentage) */
|
|
187
|
+
x?: number | string;
|
|
188
|
+
/** Y position (pixels or percentage) */
|
|
189
|
+
y?: number | string;
|
|
190
|
+
/** Scale factor */
|
|
191
|
+
scale?: number;
|
|
192
|
+
/** Rotation in degrees */
|
|
193
|
+
rotation?: number;
|
|
194
|
+
/** Transform origin point */
|
|
195
|
+
origin?: string;
|
|
196
|
+
}
|
|
197
|
+
interface AnimationTrackSpec {
|
|
198
|
+
/** CSS property path to animate (e.g., 'opacity', 'transform.scale', 'filter.blur') */
|
|
199
|
+
property: string;
|
|
200
|
+
/** Starting value for the animation */
|
|
201
|
+
from: AnimationValue;
|
|
202
|
+
/** Ending value for the animation */
|
|
203
|
+
to: AnimationValue;
|
|
204
|
+
/** Animation start time in milliseconds */
|
|
205
|
+
startMs: number;
|
|
206
|
+
/** Animation end time in milliseconds */
|
|
207
|
+
endMs: number;
|
|
208
|
+
/** Easing function name or cubic-bezier values */
|
|
209
|
+
easing?: EasingType;
|
|
210
|
+
/** Whether to loop the animation */
|
|
211
|
+
loop?: boolean;
|
|
212
|
+
/** Whether to reverse the animation on each loop */
|
|
213
|
+
yoyo?: boolean;
|
|
214
|
+
}
|
|
215
|
+
/** Supported animation value types */
|
|
216
|
+
type AnimationValue = number | string | boolean | AnimationValueObject;
|
|
217
|
+
/** Complex animation values for multi-property animations */
|
|
218
|
+
interface AnimationValueObject {
|
|
219
|
+
[key: string]: number | string | boolean;
|
|
220
|
+
}
|
|
221
|
+
/** Supported easing function types */
|
|
222
|
+
type EasingType = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'ease-in-sine' | 'ease-out-sine' | 'ease-in-out-sine' | 'ease-in-quad' | 'ease-out-quad' | 'ease-in-out-quad' | 'ease-in-cubic' | 'ease-out-cubic' | 'ease-in-out-cubic' | 'ease-in-quart' | 'ease-out-quart' | 'ease-in-out-quart' | 'ease-in-quint' | 'ease-out-quint' | 'ease-in-out-quint' | 'ease-in-expo' | 'ease-out-expo' | 'ease-in-out-expo' | 'ease-in-circ' | 'ease-out-circ' | 'ease-in-out-circ' | 'ease-in-back' | 'ease-out-back' | 'ease-in-out-back' | 'ease-in-elastic' | 'ease-out-elastic' | 'ease-in-out-elastic' | 'ease-in-bounce' | 'ease-out-bounce' | 'ease-in-out-bounce' | `cubic-bezier(${number},${number},${number},${number})`;
|
|
223
|
+
interface AudioTrackSpec {
|
|
224
|
+
/** Unique identifier for the audio track */
|
|
225
|
+
id: string;
|
|
226
|
+
/** Type of audio content */
|
|
227
|
+
type: AudioTrackType;
|
|
228
|
+
/** Source URL or asset ID for the audio file */
|
|
229
|
+
src: string;
|
|
230
|
+
/** Start time in milliseconds */
|
|
231
|
+
startMs: number;
|
|
232
|
+
/** End time in milliseconds (optional, defaults to audio duration) */
|
|
233
|
+
endMs?: number;
|
|
234
|
+
/** Volume level (0-1, default: 1) */
|
|
235
|
+
volume?: number;
|
|
236
|
+
/** Fade in duration in milliseconds */
|
|
237
|
+
fadeIn?: number;
|
|
238
|
+
/** Fade out duration in milliseconds */
|
|
239
|
+
fadeOut?: number;
|
|
240
|
+
/** Whether to loop the audio */
|
|
241
|
+
loop?: boolean;
|
|
242
|
+
}
|
|
243
|
+
/** Supported audio track types */
|
|
244
|
+
type AudioTrackType = 'voiceover' | 'ambience' | 'transition' | 'music' | 'sfx';
|
|
245
|
+
interface TransitionSpec {
|
|
246
|
+
/** Type of transition effect */
|
|
247
|
+
type: TransitionType;
|
|
248
|
+
/** Duration of the transition in milliseconds */
|
|
249
|
+
duration: number;
|
|
250
|
+
/** Easing function for the transition */
|
|
251
|
+
easing?: EasingType;
|
|
252
|
+
/** Additional transition-specific properties */
|
|
253
|
+
config?: TransitionConfig;
|
|
254
|
+
}
|
|
255
|
+
/** Supported transition types */
|
|
256
|
+
type TransitionType = 'fade' | 'slide' | 'zoom' | 'wipe' | 'dissolve' | 'blur';
|
|
257
|
+
/** Configuration for transition effects */
|
|
258
|
+
interface TransitionConfig {
|
|
259
|
+
/** Direction for slide/wipe transitions */
|
|
260
|
+
direction?: 'up' | 'down' | 'left' | 'right' | 'in' | 'out';
|
|
261
|
+
/** Blur amount for blur transitions */
|
|
262
|
+
blurAmount?: number;
|
|
263
|
+
/** Custom properties for advanced transitions */
|
|
264
|
+
[key: string]: any;
|
|
265
|
+
}
|
|
266
|
+
interface AssetDefinition {
|
|
267
|
+
/** Unique identifier for the asset */
|
|
268
|
+
id: string;
|
|
269
|
+
/** Type of asset */
|
|
270
|
+
type: AssetType;
|
|
271
|
+
/** Source URL for the asset */
|
|
272
|
+
src: string;
|
|
273
|
+
/** Whether to preload this asset */
|
|
274
|
+
preload?: boolean;
|
|
275
|
+
/** Fallback asset ID or URL if loading fails */
|
|
276
|
+
fallback?: string;
|
|
277
|
+
/** Additional metadata for the asset */
|
|
278
|
+
metadata?: AssetMetadata;
|
|
279
|
+
}
|
|
280
|
+
/** Supported asset types */
|
|
281
|
+
type AssetType = 'image' | 'video' | 'audio' | 'font' | 'json' | 'binary';
|
|
282
|
+
/** Asset metadata for optimization and caching */
|
|
283
|
+
interface AssetMetadata {
|
|
284
|
+
/** Expected file size in bytes */
|
|
285
|
+
size?: number;
|
|
286
|
+
/** MIME type */
|
|
287
|
+
mimeType?: string;
|
|
288
|
+
/** Cache duration in milliseconds */
|
|
289
|
+
cacheDuration?: number;
|
|
290
|
+
/** Asset dimensions for images/videos */
|
|
291
|
+
dimensions?: {
|
|
292
|
+
width: number;
|
|
293
|
+
height: number;
|
|
294
|
+
};
|
|
295
|
+
/** Audio duration in milliseconds */
|
|
296
|
+
duration?: number;
|
|
297
|
+
}
|
|
298
|
+
type QualityLevel = 'low' | 'medium' | 'high' | 'ultra' | 'auto';
|
|
299
|
+
|
|
300
|
+
interface CinematicRenderer2DOptions {
|
|
301
|
+
container: HTMLElement;
|
|
302
|
+
spec: CinematicSpec;
|
|
303
|
+
autoplay?: boolean;
|
|
304
|
+
quality?: QualityLevel$1;
|
|
305
|
+
debug?: boolean;
|
|
306
|
+
}
|
|
307
|
+
type PlaybackState = 'idle' | 'loading' | 'ready' | 'playing' | 'paused' | 'stopped' | 'destroyed';
|
|
308
|
+
declare class CinematicRenderer2D implements ICinematicRenderer2D {
|
|
309
|
+
private _container;
|
|
310
|
+
private _spec;
|
|
311
|
+
private _compiledSpec;
|
|
312
|
+
private _options;
|
|
313
|
+
private eventListeners;
|
|
314
|
+
private _state;
|
|
315
|
+
private _currentTime;
|
|
316
|
+
private _duration;
|
|
317
|
+
private _currentEventId;
|
|
318
|
+
private _currentSceneId;
|
|
319
|
+
private _quality;
|
|
320
|
+
private _resizeListener;
|
|
321
|
+
private _scheduler;
|
|
322
|
+
private _qualitySystem;
|
|
323
|
+
private _audioSystem;
|
|
324
|
+
private _debugOverlay;
|
|
325
|
+
private _layerRegistry;
|
|
326
|
+
private _domRenderer;
|
|
327
|
+
private _canvas2DRenderer;
|
|
328
|
+
private _layers;
|
|
329
|
+
private _currentSceneLayers;
|
|
330
|
+
private _resizeObserver;
|
|
331
|
+
private _mounted;
|
|
332
|
+
constructor(options: CinematicRenderer2DOptions);
|
|
333
|
+
mount(): Promise<void>;
|
|
334
|
+
play(): void;
|
|
335
|
+
pause(): void;
|
|
336
|
+
stop(): void;
|
|
337
|
+
destroy(): void;
|
|
338
|
+
seek(timeMs: number): void;
|
|
339
|
+
goToEvent(eventId: string): void;
|
|
340
|
+
goToScene(sceneId: string): void;
|
|
341
|
+
setQuality(level: QualityLevel$1): void;
|
|
342
|
+
resize(width: number, height: number): void;
|
|
343
|
+
on(event: string, callback: Function): void;
|
|
344
|
+
off(event: string, callback: Function): void;
|
|
345
|
+
getCurrentTime(): number;
|
|
346
|
+
getDuration(): number;
|
|
347
|
+
isPlaying(): boolean;
|
|
348
|
+
isPaused(): boolean;
|
|
349
|
+
getCurrentEvent(): string | null;
|
|
350
|
+
getCurrentScene(): string | null;
|
|
351
|
+
getState(): PlaybackState;
|
|
352
|
+
getQuality(): QualityLevel$1;
|
|
353
|
+
isMounted(): boolean;
|
|
354
|
+
getCurrentFps(): number;
|
|
355
|
+
getPerformanceMetrics(): PerformanceMetrics;
|
|
356
|
+
getQualitySettings(): QualitySettings;
|
|
357
|
+
getDeviceCapabilities(): DeviceCapabilities;
|
|
358
|
+
setMasterVolume(volume: number): void;
|
|
359
|
+
getMasterVolume(): number;
|
|
360
|
+
isWebAudioAvailable(): boolean;
|
|
361
|
+
getActiveAudioTrackCount(): number;
|
|
362
|
+
isDebugEnabled(): boolean;
|
|
363
|
+
toggleDebug(): void;
|
|
364
|
+
showDebug(): void;
|
|
365
|
+
hideDebug(): void;
|
|
366
|
+
protected emit(event: string, ...args: any[]): void;
|
|
367
|
+
private _onFrame;
|
|
368
|
+
private _setState;
|
|
369
|
+
private _calculateDuration;
|
|
370
|
+
private _calculateEventStartTime;
|
|
371
|
+
private _calculateSceneStartTime;
|
|
372
|
+
private _updateCurrentEventAndScene;
|
|
373
|
+
private _setupContainer;
|
|
374
|
+
private _setupResizeObserver;
|
|
375
|
+
private _setupResizeListener;
|
|
376
|
+
private _initializeRenderers;
|
|
377
|
+
private _initializeLayers;
|
|
378
|
+
private _updateCurrentSceneLayers;
|
|
379
|
+
private _mountLayer;
|
|
380
|
+
private _renderCurrentFrame;
|
|
381
|
+
private _getCurrentScene;
|
|
382
|
+
private _getLayerConfig;
|
|
383
|
+
private _resetLayersToInitialState;
|
|
384
|
+
private _destroyAllLayers;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Angular adapter for cinematicRenderer2D
|
|
389
|
+
*
|
|
390
|
+
* Provides a CinematicPlayerComponent Angular component that wraps the core engine
|
|
391
|
+
* with Angular-specific lifecycle management and event handling.
|
|
392
|
+
*
|
|
393
|
+
* Requirements: 10.2, 10.3, 10.4, 10.5 - Angular integration with proper lifecycle
|
|
394
|
+
*/
|
|
395
|
+
|
|
396
|
+
interface CinematicPlayerEvents {
|
|
397
|
+
ready: void;
|
|
398
|
+
play: {
|
|
399
|
+
previousState: PlaybackState;
|
|
400
|
+
currentTime: number;
|
|
401
|
+
};
|
|
402
|
+
pause: {
|
|
403
|
+
previousState: PlaybackState;
|
|
404
|
+
currentTime: number;
|
|
405
|
+
};
|
|
406
|
+
stop: {
|
|
407
|
+
previousState: PlaybackState;
|
|
408
|
+
};
|
|
409
|
+
seek: {
|
|
410
|
+
previousTime: number;
|
|
411
|
+
currentTime: number;
|
|
412
|
+
currentEvent: string | null;
|
|
413
|
+
currentScene: string | null;
|
|
414
|
+
};
|
|
415
|
+
eventChange: {
|
|
416
|
+
eventId: string;
|
|
417
|
+
eventName: string;
|
|
418
|
+
currentTime: number;
|
|
419
|
+
};
|
|
420
|
+
sceneChange: {
|
|
421
|
+
sceneId: string;
|
|
422
|
+
sceneName: string;
|
|
423
|
+
currentTime: number;
|
|
424
|
+
};
|
|
425
|
+
qualityChange: {
|
|
426
|
+
previousQuality: QualityLevel$1;
|
|
427
|
+
currentQuality: QualityLevel$1;
|
|
428
|
+
metrics?: any;
|
|
429
|
+
};
|
|
430
|
+
resize: {
|
|
431
|
+
width: number;
|
|
432
|
+
height: number;
|
|
433
|
+
};
|
|
434
|
+
frame: {
|
|
435
|
+
currentTime: number;
|
|
436
|
+
fps: number;
|
|
437
|
+
deltaMs: number;
|
|
438
|
+
currentEvent: string | null;
|
|
439
|
+
currentScene: string | null;
|
|
440
|
+
};
|
|
441
|
+
stateChange: {
|
|
442
|
+
previousState: PlaybackState;
|
|
443
|
+
currentState: PlaybackState;
|
|
444
|
+
};
|
|
445
|
+
ended: void;
|
|
446
|
+
error: Error;
|
|
447
|
+
loading: void;
|
|
448
|
+
destroy: {
|
|
449
|
+
previousState: PlaybackState;
|
|
450
|
+
};
|
|
451
|
+
audioError: {
|
|
452
|
+
trackId: string;
|
|
453
|
+
error: Error;
|
|
454
|
+
};
|
|
455
|
+
autoplayBlocked: {
|
|
456
|
+
trackId: string;
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* CinematicPlayerComponent Angular Component
|
|
461
|
+
*
|
|
462
|
+
* An Angular wrapper for the CinematicRenderer2D engine that handles:
|
|
463
|
+
* - Angular lifecycle integration (ngOnInit/ngOnDestroy)
|
|
464
|
+
* - Input/Output bindings for spec and events
|
|
465
|
+
* - Event forwarding to Angular event system
|
|
466
|
+
* - Automatic cleanup on component destruction
|
|
467
|
+
*/
|
|
468
|
+
declare class CinematicPlayerComponent implements OnInit, OnDestroy, OnChanges {
|
|
469
|
+
private ngZone;
|
|
470
|
+
containerRef: ElementRef<HTMLDivElement>;
|
|
471
|
+
spec: CinematicSpec;
|
|
472
|
+
autoplay: boolean;
|
|
473
|
+
quality?: QualityLevel$1;
|
|
474
|
+
debug: boolean;
|
|
475
|
+
containerClass?: string;
|
|
476
|
+
containerStyle?: {
|
|
477
|
+
[key: string]: any;
|
|
478
|
+
};
|
|
479
|
+
ready: EventEmitter<void>;
|
|
480
|
+
play: EventEmitter<{
|
|
481
|
+
previousState: PlaybackState;
|
|
482
|
+
currentTime: number;
|
|
483
|
+
}>;
|
|
484
|
+
pause: EventEmitter<{
|
|
485
|
+
previousState: PlaybackState;
|
|
486
|
+
currentTime: number;
|
|
487
|
+
}>;
|
|
488
|
+
stop: EventEmitter<{
|
|
489
|
+
previousState: PlaybackState;
|
|
490
|
+
}>;
|
|
491
|
+
seek: EventEmitter<{
|
|
492
|
+
previousTime: number;
|
|
493
|
+
currentTime: number;
|
|
494
|
+
currentEvent: string | null;
|
|
495
|
+
currentScene: string | null;
|
|
496
|
+
}>;
|
|
497
|
+
eventChange: EventEmitter<{
|
|
498
|
+
eventId: string;
|
|
499
|
+
eventName: string;
|
|
500
|
+
currentTime: number;
|
|
501
|
+
}>;
|
|
502
|
+
sceneChange: EventEmitter<{
|
|
503
|
+
sceneId: string;
|
|
504
|
+
sceneName: string;
|
|
505
|
+
currentTime: number;
|
|
506
|
+
}>;
|
|
507
|
+
qualityChange: EventEmitter<{
|
|
508
|
+
previousQuality: QualityLevel$1;
|
|
509
|
+
currentQuality: QualityLevel$1;
|
|
510
|
+
metrics?: any;
|
|
511
|
+
}>;
|
|
512
|
+
resize: EventEmitter<{
|
|
513
|
+
width: number;
|
|
514
|
+
height: number;
|
|
515
|
+
}>;
|
|
516
|
+
frame: EventEmitter<{
|
|
517
|
+
currentTime: number;
|
|
518
|
+
fps: number;
|
|
519
|
+
deltaMs: number;
|
|
520
|
+
currentEvent: string | null;
|
|
521
|
+
currentScene: string | null;
|
|
522
|
+
}>;
|
|
523
|
+
stateChange: EventEmitter<{
|
|
524
|
+
previousState: PlaybackState;
|
|
525
|
+
currentState: PlaybackState;
|
|
526
|
+
}>;
|
|
527
|
+
ended: EventEmitter<void>;
|
|
528
|
+
error: EventEmitter<Error>;
|
|
529
|
+
loading: EventEmitter<void>;
|
|
530
|
+
destroy: EventEmitter<{
|
|
531
|
+
previousState: PlaybackState;
|
|
532
|
+
}>;
|
|
533
|
+
audioError: EventEmitter<{
|
|
534
|
+
trackId: string;
|
|
535
|
+
error: Error;
|
|
536
|
+
}>;
|
|
537
|
+
autoplayBlocked: EventEmitter<{
|
|
538
|
+
trackId: string;
|
|
539
|
+
}>;
|
|
540
|
+
private engine;
|
|
541
|
+
private initialized;
|
|
542
|
+
constructor(ngZone: NgZone);
|
|
543
|
+
ngOnInit(): void;
|
|
544
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
545
|
+
ngOnDestroy(): void;
|
|
546
|
+
playEngine(): void;
|
|
547
|
+
pauseEngine(): void;
|
|
548
|
+
stopEngine(): void;
|
|
549
|
+
seekEngine(timeMs: number): void;
|
|
550
|
+
goToEvent(eventId: string): void;
|
|
551
|
+
goToScene(sceneId: string): void;
|
|
552
|
+
setQuality(level: QualityLevel$1): void;
|
|
553
|
+
resizeEngine(width: number, height: number): void;
|
|
554
|
+
getCurrentTime(): number;
|
|
555
|
+
getDuration(): number;
|
|
556
|
+
isPlaying(): boolean;
|
|
557
|
+
isPaused(): boolean;
|
|
558
|
+
getCurrentEvent(): string | null;
|
|
559
|
+
getCurrentScene(): string | null;
|
|
560
|
+
getState(): PlaybackState;
|
|
561
|
+
getQuality(): QualityLevel$1;
|
|
562
|
+
isMounted(): boolean;
|
|
563
|
+
getCurrentFps(): number;
|
|
564
|
+
getPerformanceMetrics(): any;
|
|
565
|
+
getQualitySettings(): any;
|
|
566
|
+
getDeviceCapabilities(): any;
|
|
567
|
+
setMasterVolume(volume: number): void;
|
|
568
|
+
getMasterVolume(): number;
|
|
569
|
+
isWebAudioAvailable(): boolean;
|
|
570
|
+
getActiveAudioTrackCount(): number;
|
|
571
|
+
getEngine(): CinematicRenderer2D | null;
|
|
572
|
+
private initializeEngine;
|
|
573
|
+
private setupEventListeners;
|
|
574
|
+
private destroyEngine;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export { type CinematicEvent, CinematicPlayerComponent, type CinematicPlayerEvents, type CinematicScene, type CinematicSpec, type LayerSpec, type LayerType, type PlaybackState, type QualityLevel };
|