@viji-dev/core 0.8.3 → 0.8.4

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/dist/index.d.ts CHANGED
@@ -2654,7 +2654,7 @@ declare type TrackingState = 'TRACKING' | 'LOCKED' | 'BREAKDOWN' | 'LOST';
2654
2654
  /** Returned by `on*` listener registration calls; invoke to unsubscribe. */
2655
2655
  export declare type Unsubscribe = () => void;
2656
2656
 
2657
- export declare const VERSION = "0.8.2";
2657
+ export declare const VERSION = "0.8.3";
2658
2658
 
2659
2659
  /**
2660
2660
  * Real-time video API: drawable frame, dimensions, and the source-side
@@ -3067,6 +3067,7 @@ export declare class VijiCore {
3067
3067
  private performanceSnapshotListeners;
3068
3068
  private capabilityTransitionListeners;
3069
3069
  private capabilityReportingEnabled;
3070
+ private renderLoopPaused;
3070
3071
  constructor(config: VijiCoreConfig);
3071
3072
  /**
3072
3073
  * Capture current scene frame
@@ -3811,6 +3812,33 @@ export declare class VijiCore {
3811
3812
  * Gets current performance statistics
3812
3813
  */
3813
3814
  getStats(): PerformanceStats;
3815
+ /**
3816
+ * Pauses the scene render loop — stops the worker from rendering. Intended to
3817
+ * be driven from the host on `document.hidden`, so a hidden tab doesn't keep
3818
+ * rasterizing a heavy scene (which otherwise pegs the GPU and causes a freeze
3819
+ * on return).
3820
+ *
3821
+ * Only the rendering stops. The scene clock keeps running on real wall-clock,
3822
+ * and audio analysis, video/audio streams, CV, parameters and all scene state
3823
+ * keep running too — so audio you can still hear is still analyzed. On
3824
+ * {@link resumeRenderLoop}, `viji.time` reflects the **real** elapsed time
3825
+ * (including the hidden duration) and the first frame's `viji.deltaTime` is the
3826
+ * **real** time-away gap. (That gap can be large; the scene sees true time, not
3827
+ * a frozen clock.) Idempotent.
3828
+ *
3829
+ * For a live compositor *source* feeding a visible mixer, do NOT pause it
3830
+ * while its own tab is hidden — it must keep rendering. Pause is per-core and
3831
+ * host-controlled.
3832
+ */
3833
+ pauseRenderLoop(): void;
3834
+ /**
3835
+ * Resumes the scene render loop after {@link pauseRenderLoop} (e.g. on the tab
3836
+ * becoming visible). The scene resumes on real wall-clock time, so the first
3837
+ * frame's `viji.deltaTime` is the elapsed time-away gap. Idempotent.
3838
+ */
3839
+ resumeRenderLoop(): void;
3840
+ /** Whether the render loop is currently paused (see {@link pauseRenderLoop}). */
3841
+ isRenderLoopPaused(): boolean;
3814
3842
  /**
3815
3843
  * Runs an on-demand fenced benchmark: the worker renders `frameCount` frames,
3816
3844
  * fencing each to capture fence-accurate CPU + GPU time per frame, and
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as a, V as i, a as s, b as e } from "./index-BzW31blh.js";
1
+ import { A as a, V as i, a as s, b as e } from "./index-DF_IFS3A.js";
2
2
  export {
3
3
  a as AudioSystem,
4
4
  i as VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viji-dev/core",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Universal execution engine for Viji Creative scenes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",