player: runtime-src is honoured for srcdoc only - an src embed always fetches the runtime from jsDelivr
维护者通常 1 天内回复
@srikarsunchu 已经在做这个了。
开始于 2026年9月21日。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start with the player entry points H, F, Pt, and _injectRuntime in hyperframes-player.global.js, then reproduce the src path using host.html and comp-nested.html. Done means an src embed requests /local-runtime.js when runtime-src is valid and otherwise retains the jsDelivr fallback, matching srcdoc behavior.
由索引模型根据 Issue 内容生成。
描述
Summary
<hyperframes-player> accepts a runtime-src attribute, and validates it carefully (http/https,
same-origin or loopback). But it is only ever read on the srcdoc path:
function H(r, e) { return qe(It(e, ...), Pt(r)); } // srcdoc -> honours runtime-src (Pt)
function F(r, e) { return Lt(e, ...); } // src -> URL params only
The probe that injects the runtime into an src iframe uses the module constant instead, with no
access to the host element:
var k = "https://cdn.jsdelivr.net/npm/@hyperframes/[email protected]/dist/hyperframe.runtime.iife.js";
_injectRuntime() {
this._runtimeInjected = true;
const t = doc.createElement("script");
t.src = k; // <- always the CDN
(doc.head || doc.documentElement).appendChild(t);
}
So an src embed cannot be given a local runtime. On an offline or air-gapped machine, or behind
a script-src 'self' CSP, the injection silently fails (it is inside a bare try {} catch {}),
__hf never appears, and the element eventually emits
error: "Composition timeline not found after 8s".
Reproduction
comp-nested.html — a [data-composition-src] child makes the probe inject immediately:
<!doctype html><html><head><meta charset="utf-8"></head><body>
<div id="root" data-composition-id="main" data-width="1080" data-height="1920">
<div data-composition-src="child.html" data-start="0" data-duration="5"></div>
</div>
</body></html>
host.html, served over http from the same origin as a local copy of the runtime:
<script src="https://cdn.jsdelivr.net/npm/@hyperframes/[email protected]/dist/hyperframes-player.global.js"></script>
<hyperframes-player src="comp-nested.html" runtime-src="/local-runtime.js"
width="1080" height="1920"></hyperframes-player>
Actual
The network panel shows
GET https://cdn.jsdelivr.net/npm/@hyperframes/[email protected]/dist/hyperframe.runtime.iife.js 200
and no request for /local-runtime.js. runtime-src passes the element's own validation and is
still ignored.
Expected
src and srcdoc resolve the runtime the same way: runtime-src when it is set and valid, the
jsDelivr default otherwise. Concretely, pass the resolved URL into the probe (it is already
computed by Pt(host)) instead of closing over the module constant, so an embed can serve its own
pinned copy.
Two smaller things that would help either way:
- the injected
<script>has noonerror, so a blocked or 404 runtime is indistinguishable from
a slow one — the element just times out after 8 s with a message about the timeline; - documenting
runtime-srcas srcdoc-only would at least make the current behaviour discoverable.
Environment
@hyperframes/player0.8.41, Chromium 141, Linux
Why it matters
A local review tool that embeds staged projects has to reach a CDN for every composition it opens,
or pre-inject the runtime into the served HTML itself (which is what we now do) — even though the
exact matching runtime is already sitting in node_modules/hyperframes/dist/.
- 主要语言
- TypeScript
- 星标
- 54.1k
- 派生
- 4.9k
- 平均合并
- 11 小时 3 分钟
- 30 天内合并 PR
- 772
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
heygen-com/hyperframes 的其他 Issue
-
Batch rendering rejects JSON files saved with a byte order mark可能已有人在做 @AksharP5 于 1 天前认领。 未关闭bug triage/ready
难度 2/5 1-3 小时 新手友好度 74/100
heygen-com/hyperframes#6604 ·
维护者通常 1 天内回复
-
bug difficulty/easy triage/ready
难度 2/5 1-3 小时 新手友好度 78/100
heygen-com/hyperframes#6481 · 2 条评论 ·
维护者通常 1 天内回复
-
Timeline: show a clip's full name when its label is cut off可能已有人在做 @DanielMcSheehy 于 11 天前认领。 未关闭desktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
难度 2/5 1-3 小时 新手友好度 85/100
heygen-com/hyperframes#5582 · 2 条评论 ·
维护者通常 1 天内回复
-
Studio: press ? to open the keyboard shortcuts panel可能已有人在做 @B-Payal 于 15 天前认领。 未关闭desktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
难度 2/5 1-3 小时 新手友好度 82/100
heygen-com/hyperframes#5580 · 1 条评论 ·
维护者通常 1 天内回复
-
lint: add tests for three caption rules that have none可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭difficulty/easy enhancement help wanted triage/ready
难度 2/5 1-3 小时 新手友好度 85/100
heygen-com/hyperframes#5388 · 1 条评论 ·
维护者通常 1 天内回复
查看 heygen-com/hyperframes 的全部 Issue
相似的 Issue
-
Shell: serve the home app's Cookie Policy on a hard reload可能已有人在做 @2001anshkaushik 今天认领。 未关闭feature module:ai
难度 2/5 1-3 小时 新手友好度 88/100
rocketride-org/rocketride-server#2899 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
wazuh/wazuh-dashboard-plugins#9551 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
gofish-graphics/gofish-graphics#1252 ·
维护者通常 1 天内回复
-
optimization P3 size:XS
难度 1/5 1-3 小时 新手友好度 88/100
josephfung/curia#2366 ·
维护者通常 1 天内回复
-
type:bug
难度 2/5 1-3 小时 新手友好度 65/100
nightgauge/nightgauge#2688 ·
维护者通常 1 天内回复