mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-07 15:27:14 +00:00
* feat(player): wait for a composition's media, images and fonts before playing
The player used to fire ready/autoplay the moment the timeline resolved,
even if the composition's video, images or fonts hadn't loaded yet -
visible as a flash of missing content or a frozen first frame. It now
waits for those assets (readyState >= HAVE_FUTURE_DATA for media, decoded
images, document.fonts.ready) before play() proceeds, showing its own
loading overlay (reusing the shader-transition loading panel) while it
waits, bounded by an 8s timeout that plays anyway and logs which assets
were still stuck.
Settles synchronously with no overlay when nothing needs waiting (already
loaded, or a cross-origin composition the player has no DOM access to
inspect), so today's immediate-autoplay behavior is unchanged for the
common case. A new assetsReady getter and assetsready event mirror the
gate for hosts that want to observe it.
* chore(player): drop internal decision-ref from a public-repo comment
An internal tracking id leaked into a code comment and a test name in the
previous commit. This repo is public; internal references don't belong here.
* fix(player): stop a stale asset-wait from settling a newer composition
An independent review found that a composition swap mid-wait (a new src or
srcdoc arriving while the previous composition's media/images/fonts were
still loading) had no way to invalidate the old wait. If the old wait's
promise resolved after the swap, it could mark the NEW composition ready
and even play it, while the new composition's own assets were still
pending - defeating the point of waiting in the first place. The same gap
let a late-resolving wait flip a disconnected player's paused state back to
false and fire a spurious play event after removal.
Fixed both with one generation counter: every new wait captures the current
generation, disconnect and reload each bump it, and a wait's eventual
settle no-ops if its generation is no longer current.
Also fixed: the loading overlay's aria-label ("Loading assets") never got
restored once the asset wait was done, so a later shader-transition overlay
on the same player kept misannouncing itself to assistive tech.
* fix(player): invalidate the asset wait from every navigation path, not two
The generation-counter fix only bumped at two of the six places that set
_ready = false ahead of a navigation, reload, or disconnect - src/srcdoc
attribute changes, a sandbox-origin policy reload, and a shader-options
reload all started a new navigation without invalidating the previous
wait, leaving the same race open through those paths.
One _invalidateAssetsWait() helper now owns the reset (assetsReady,
pendingPlay, generation, the loading attribute, hiding the overlay) and
every one of the six sites calls it before starting whatever comes next.
* fix(player): gate play on real composition readiness, not just duration
Add a shared composition-readiness gate in packages/core, exported as the
@hyperframes/core/composition-readiness subpath. It resolves once every
declared input settles (media for now: video/audio/image/font loads), or
after a timeout, and calls back synchronously when nothing is pending so a
caller that plays immediately after sees the decision already applied.
The player element now queues an early play() call instead of dropping it
when called before the runtime is ready, and both of Studio's readiness
call sites (the direct-adapter path and the message-based fallback) go
through one store action, requestTimelineReady, instead of duplicating a
generation-counter-and-settle pattern across two hook files.
* fix(player): stop a queued early play() and a project switch from double-firing readiness
An independent review of the readiness gate found two real races:
play() queued before the runtime was ready re-ran its full body once ready,
dispatching the public "play" event twice for one user action. It now
dispatches "play" only on the call that actually starts playback.
Studio's requestTimelineReady generation guard was never invalidated by a
project switch or a full timeline reset, so a slow-loading project's
in-flight wait could resolve after the switch and mark the new, unchecked
project ready. Resetting the timeline now bumps the generation, and setting
timelineReady directly does too.
* fix(player): cancel a queued play on pause or seek during the asset wait
A play() queued while assets buffer (_pendingPlay) used to fire once they
settled even after an explicit pause or seek during the wait. pause() and
seek() now clear the flag, so a user pause/seek wins.
409 lines
15 KiB
JSON
409 lines
15 KiB
JSON
{
|
|
"package": "@hyperframes/core",
|
|
"localNodeRuntime": true,
|
|
"subpaths": {
|
|
".": {
|
|
"source": "./src/index.ts",
|
|
"runtime": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./package.json": {
|
|
"source": "./package.json",
|
|
"runtime": "./package.json",
|
|
"types": null,
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./canary": {
|
|
"source": "./src/canary.ts",
|
|
"runtime": "./dist/canary.js",
|
|
"types": "./dist/canary.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./canary-registry": {
|
|
"source": "./src/canaryRegistry.ts",
|
|
"runtime": "./dist/canaryRegistry.js",
|
|
"types": "./dist/canaryRegistry.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./beats": {
|
|
"source": "./src/beats/index.ts",
|
|
"runtime": "./dist/beats/index.js",
|
|
"types": "./dist/beats/index.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./html-attr-safety": {
|
|
"source": "./src/utils/htmlAttrSafety.ts",
|
|
"runtime": "./dist/utils/htmlAttrSafety.js",
|
|
"types": "./dist/utils/htmlAttrSafety.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./rich-text-sanitize": {
|
|
"source": "./src/utils/richTextSanitize.ts",
|
|
"runtime": "./dist/utils/richTextSanitize.js",
|
|
"types": "./dist/utils/richTextSanitize.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./composition-contract": {
|
|
"source": "./src/compositionContract.ts",
|
|
"runtime": "./dist/compositionContract.js",
|
|
"types": "./dist/compositionContract.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./media-timing": {
|
|
"source": "./src/mediaTiming.ts",
|
|
"runtime": "./dist/mediaTiming.js",
|
|
"types": "./dist/mediaTiming.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./composition-readiness": {
|
|
"source": "./src/compositionReadiness.ts",
|
|
"runtime": "./dist/compositionReadiness.js",
|
|
"types": "./dist/compositionReadiness.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./editing": {
|
|
"source": "./src/editing/affordances.ts",
|
|
"runtime": "./dist/editing/affordances.js",
|
|
"types": "./dist/editing/affordances.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./editing/draft-markers": {
|
|
"source": "./src/editing/draftMarkers.ts",
|
|
"runtime": "./dist/editing/draftMarkers.js",
|
|
"types": "./dist/editing/draftMarkers.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./variables": {
|
|
"source": "./src/variables.ts",
|
|
"runtime": "./dist/variables.js",
|
|
"types": "./dist/variables.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./slideshow": {
|
|
"source": "./src/slideshow/index.ts",
|
|
"runtime": "./dist/slideshow/index.js",
|
|
"types": "./dist/slideshow/index.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./generators": {
|
|
"source": "./src/generators/hyperframes.ts",
|
|
"runtime": "./dist/generators/hyperframes.js",
|
|
"types": "./dist/generators/hyperframes.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./lint": {
|
|
"source": "./src/lint/index.ts",
|
|
"runtime": "./dist/lint/index.js",
|
|
"types": "./dist/lint/index.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./compiler": {
|
|
"source": "./src/compiler/index.ts",
|
|
"runtime": "./dist/compiler/index.js",
|
|
"types": "./dist/compiler/index.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./audio-fx": {
|
|
"source": "./src/audioFx.ts",
|
|
"runtime": "./dist/audioFx.js",
|
|
"types": "./dist/audioFx.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-fx-copy": {
|
|
"source": "./src/audioFxCopy.ts",
|
|
"runtime": "./dist/audioFxCopy.js",
|
|
"types": "./dist/audioFxCopy.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-fx-profiles": {
|
|
"source": "./src/audioFxProfiles.ts",
|
|
"runtime": "./dist/audioFxProfiles.js",
|
|
"types": "./dist/audioFxProfiles.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-fx-jobs": {
|
|
"source": "./src/audioFxJobs.ts",
|
|
"runtime": "./dist/audioFxJobs.js",
|
|
"types": "./dist/audioFxJobs.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-fx-eq": {
|
|
"source": "./src/audioFxEq.ts",
|
|
"runtime": "./dist/audioFxEq.js",
|
|
"types": "./dist/audioFxEq.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-leveller": {
|
|
"source": "./src/audioLeveller.ts",
|
|
"runtime": "./dist/audioLeveller.js",
|
|
"types": "./dist/audioLeveller.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-fx-presets": {
|
|
"source": "./src/audioFxPresets.ts",
|
|
"runtime": "./dist/audioFxPresets.js",
|
|
"types": "./dist/audioFxPresets.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-fx-tail": {
|
|
"source": "./src/audio/audioFxTail.ts",
|
|
"runtime": "./dist/audio/audioFxTail.js",
|
|
"types": "./dist/audio/audioFxTail.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-fx-runtime": {
|
|
"source": "./src/generated/audio-fx-runtime-inline.ts",
|
|
"runtime": "./dist/generated/audio-fx-runtime-inline.js",
|
|
"types": "./dist/generated/audio-fx-runtime-inline.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./audio-carve": {
|
|
"source": "./src/audioCarve.ts",
|
|
"runtime": "./dist/audioCarve.js",
|
|
"types": "./dist/audioCarve.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-groups": {
|
|
"source": "./src/audioGroups.ts",
|
|
"runtime": "./dist/audioGroups.js",
|
|
"types": "./dist/audioGroups.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-automation": {
|
|
"source": "./src/audioAutomation.ts",
|
|
"runtime": "./dist/audioAutomation.js",
|
|
"types": "./dist/audioAutomation.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./audio-gain": {
|
|
"source": "./src/audioGain.ts",
|
|
"runtime": "./dist/audioGain.js",
|
|
"types": "./dist/audioGain.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./color-grading": {
|
|
"source": "./src/colorGrading.ts",
|
|
"runtime": "./dist/colorGrading.js",
|
|
"types": "./dist/colorGrading.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./color-luts": {
|
|
"source": "./src/colorLuts.ts",
|
|
"runtime": "./dist/colorLuts.js",
|
|
"types": "./dist/colorLuts.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./media-grade-analyzer": {
|
|
"source": "./src/mediaGradeAnalyzer.ts",
|
|
"runtime": "./dist/mediaGradeAnalyzer.js",
|
|
"types": "./dist/mediaGradeAnalyzer.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./storyboard": {
|
|
"source": "./src/storyboard/index.ts",
|
|
"runtime": "./dist/storyboard/index.js",
|
|
"types": "./dist/storyboard/index.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime": {
|
|
"source": "./dist/hyperframe.runtime.iife.js",
|
|
"runtime": "./dist/hyperframe.runtime.iife.js",
|
|
"types": null,
|
|
"environments": ["browser"]
|
|
},
|
|
"./runtime/clipTree": {
|
|
"source": "./src/runtime/clipTree.ts",
|
|
"runtime": "./dist/runtime/clipTree.js",
|
|
"types": "./dist/runtime/clipTree.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/custom-ease": {
|
|
"source": "./src/runtime/customEase.ts",
|
|
"runtime": "./dist/runtime/customEase.js",
|
|
"types": "./dist/runtime/customEase.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/start-expression": {
|
|
"source": "./src/runtime/startExpression.ts",
|
|
"runtime": "./dist/runtime/startExpression.js",
|
|
"types": "./dist/runtime/startExpression.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/start-resolver": {
|
|
"source": "./src/runtime/startResolver.ts",
|
|
"runtime": "./dist/runtime/startResolver.js",
|
|
"types": "./dist/runtime/startResolver.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/protocol": {
|
|
"source": "./src/runtime/protocol.ts",
|
|
"runtime": "./dist/runtime/protocol.js",
|
|
"types": "./dist/runtime/protocol.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/stacking-context": {
|
|
"source": "./src/runtime/stackingContext.ts",
|
|
"runtime": "./dist/runtime/stackingContext.js",
|
|
"types": "./dist/runtime/stackingContext.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/web-audio-route": {
|
|
"source": "./src/runtime/webAudioRoute.ts",
|
|
"runtime": "./dist/runtime/webAudioRoute.js",
|
|
"types": "./dist/runtime/webAudioRoute.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./compiler/html-document": {
|
|
"source": "./src/compiler/htmlDocument.ts",
|
|
"runtime": "./dist/compiler/htmlDocument.js",
|
|
"types": "./dist/compiler/htmlDocument.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/position-edits": {
|
|
"source": "./src/runtime/positionEdits.ts",
|
|
"runtime": "./dist/runtime/positionEdits.js",
|
|
"types": "./dist/runtime/positionEdits.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/position-edits-render": {
|
|
"source": "./src/generated/position-edits-render-inline.ts",
|
|
"runtime": "./dist/generated/position-edits-render-inline.js",
|
|
"types": "./dist/generated/position-edits-render-inline.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./runtime/lottie-readiness": {
|
|
"source": "./src/lottieReadiness.ts",
|
|
"runtime": "./dist/lottieReadiness.js",
|
|
"types": "./dist/lottieReadiness.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./studio-api": {
|
|
"source": "./src/studio-api/index.ts",
|
|
"runtime": "./dist/studio-api/index.js",
|
|
"types": "./dist/studio-api/index.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./studio-api/screenshot-clip": {
|
|
"source": "./src/studio-api/helpers/screenshotClip.ts",
|
|
"runtime": "./dist/studio-api/helpers/screenshotClip.js",
|
|
"types": "./dist/studio-api/helpers/screenshotClip.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./studio-api/manual-edits-render-script": {
|
|
"source": "./src/studio-api/helpers/manualEditsRenderScript.ts",
|
|
"runtime": "./dist/studio-api/helpers/manualEditsRenderScript.js",
|
|
"types": "./dist/studio-api/helpers/manualEditsRenderScript.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./studio-api/studio-motion-render-script": {
|
|
"source": "./src/studio-api/helpers/studioMotionRenderScript.ts",
|
|
"runtime": "./dist/studio-api/helpers/studioMotionRenderScript.js",
|
|
"types": "./dist/studio-api/helpers/studioMotionRenderScript.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./studio-api/draft-markers": {
|
|
"source": "./src/studio-api/helpers/draftMarkers.ts",
|
|
"runtime": "./dist/studio-api/helpers/draftMarkers.js",
|
|
"types": "./dist/studio-api/helpers/draftMarkers.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./studio-api/finite-mutation": {
|
|
"source": "./src/studio-api/helpers/finiteMutation.ts",
|
|
"runtime": "./dist/studio-api/helpers/finiteMutation.js",
|
|
"types": "./dist/studio-api/helpers/finiteMutation.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./text": {
|
|
"source": "./src/text/index.ts",
|
|
"runtime": "./dist/text/index.js",
|
|
"types": "./dist/text/index.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./registry": {
|
|
"source": "./src/registry/index.ts",
|
|
"runtime": "./dist/registry/index.js",
|
|
"types": "./dist/registry/index.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./media-volume-envelope": {
|
|
"source": "./src/runtime/mediaVolumeEnvelope.ts",
|
|
"runtime": "./dist/runtime/mediaVolumeEnvelope.js",
|
|
"types": "./dist/runtime/mediaVolumeEnvelope.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./hf-ids": {
|
|
"source": "./src/parsers/hfIds.ts",
|
|
"runtime": "./dist/parsers/hfIds.js",
|
|
"types": "./dist/parsers/hfIds.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./gsap-parser": {
|
|
"source": "./src/parsers/gsapParserExports.ts",
|
|
"runtime": "./dist/parsers/gsapParserExports.js",
|
|
"types": "./dist/parsers/gsapParserExports.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./gsap-parser-acorn": {
|
|
"source": "./src/parsers/gsapParserAcorn.ts",
|
|
"runtime": "./dist/parsers/gsapParserAcorn.js",
|
|
"types": "./dist/parsers/gsapParserAcorn.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./gsap-writer-acorn": {
|
|
"source": "./src/parsers/gsapWriterAcorn.ts",
|
|
"runtime": "./dist/parsers/gsapWriterAcorn.js",
|
|
"types": "./dist/parsers/gsapWriterAcorn.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./gsap-constants": {
|
|
"source": "./src/parsers/gsapConstants.ts",
|
|
"runtime": "./dist/parsers/gsapConstants.js",
|
|
"types": "./dist/parsers/gsapConstants.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./spring-ease": {
|
|
"source": "./src/parsers/springEase.ts",
|
|
"runtime": "./dist/parsers/springEase.js",
|
|
"types": "./dist/parsers/springEase.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./wiggle-ease": {
|
|
"source": "./src/runtime/wiggleEase.ts",
|
|
"runtime": "./dist/runtime/wiggleEase.js",
|
|
"types": "./dist/runtime/wiggleEase.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./fonts/aliases": {
|
|
"source": "./src/fonts/aliases.ts",
|
|
"runtime": "./dist/fonts/aliases.js",
|
|
"types": "./dist/fonts/aliases.d.ts",
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./fonts/system-locator": {
|
|
"source": "./src/fonts/systemFontLocator.ts",
|
|
"runtime": "./dist/fonts/systemFontLocator.js",
|
|
"types": "./dist/fonts/systemFontLocator.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./figma": {
|
|
"source": "./src/figma/index.ts",
|
|
"runtime": "./dist/figma/index.js",
|
|
"types": "./dist/figma/index.d.ts",
|
|
"environments": ["bun", "node"]
|
|
},
|
|
"./schemas/registry.json": {
|
|
"source": "./schemas/registry.json",
|
|
"runtime": "./schemas/registry.json",
|
|
"types": null,
|
|
"environments": ["browser", "bun", "node"]
|
|
},
|
|
"./schemas/registry-item.json": {
|
|
"source": "./schemas/registry-item.json",
|
|
"runtime": "./schemas/registry-item.json",
|
|
"types": null,
|
|
"environments": ["browser", "bun", "node"]
|
|
}
|
|
}
|
|
}
|