@taole/giftstage 0.1.30 → 0.1.32

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.
@@ -528,6 +528,12 @@ export interface AddGiftOptions {
528
528
  /** Whether to auto-remove after playback stops. Default: true. */
529
529
  clearsAfterStop?: boolean;
530
530
  mute?: boolean;
531
+ /**
532
+ * SVGA only: called when the visible frame advances. Slow frames may be
533
+ * skipped, so consumers should compare with a threshold instead of requiring
534
+ * an exact frame number.
535
+ */
536
+ onFrame?: (frame: number, gift: GiftHandle) => void;
531
537
  onComplete?: (gift: GiftHandle) => void;
532
538
  }
533
539
  export interface GiftHandle {
@@ -560,6 +566,10 @@ export interface GiftSlot {
560
566
  loopCount: number;
561
567
  videoEntity: VideoEntity | null;
562
568
  loadAbortController?: AbortController | null;
569
+ /** HTMLVideoElement finite-playback watchdog; cleared on normal completion or resource release. */
570
+ videoPlaybackWatchdogTimer?: ReturnType<typeof setTimeout> | null;
571
+ /** Guards the HTMLVideo ended/watchdog race so completion is dispatched exactly once. */
572
+ videoPlaybackCompletionStarted?: boolean;
563
573
  svgaSlotTextures?: Map<string, ResolvedSVGASlotTexture>;
564
574
  videoElement: HTMLVideoElement | null;
565
575
  releaseMediaSource?: (() => void) | null;
@@ -601,6 +611,7 @@ export interface GiftSlot {
601
611
  map: unknown;
602
612
  size: number;
603
613
  };
614
+ onFrame?: (frame: number, gift: GiftHandle) => void;
604
615
  onComplete?: (gift: GiftHandle) => void;
605
616
  }
606
617
  export interface VAPConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/giftstage",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "High-performance WebGPU/WebGL gift animation player unifying SVGA, VAP, AlphaVideo, and images",
5
5
  "type": "module",
6
6
  "main": "dist/gift-stage.cjs.js",