@hyperframes/producer 0.9.40 → 0.9.41

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.
@@ -2231,6 +2231,7 @@ import {
2231
2231
  rewriteInlineStyleAssetUrls
2232
2232
  } from "@hyperframes/core";
2233
2233
  import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
2234
+ import { CAPTURE_CANVAS_SELECTOR } from "@hyperframes/core/html-in-canvas";
2234
2235
  import { readPlaybackRate } from "@hyperframes/parsers/media-duration";
2235
2236
  import { resolveRateSpec } from "@hyperframes/core/speed-ramp";
2236
2237
  import { gsapCdnDist as gsapCdnDist2, normalizeGsapBaseUrl } from "@hyperframes/core/gsap-cdn";
@@ -3361,7 +3362,7 @@ function runtimeRoot(document2) {
3361
3362
  function detectRenderModeHints(html, pageMotionBlur) {
3362
3363
  const reasons = [];
3363
3364
  const { document: document2 } = parseHTML5(html);
3364
- if (document2.querySelector("canvas[layoutsubtree]")) {
3365
+ if (document2.querySelector(CAPTURE_CANVAS_SELECTOR)) {
3365
3366
  reasons.push({
3366
3367
  code: "htmlInCanvas",
3367
3368
  message: "Detected html-in-canvas API (layoutsubtree canvas). Chrome does not support concurrent drawElementImage across multiple workers; render is pinned to a single worker."
@@ -3369,7 +3370,7 @@ function detectRenderModeHints(html, pageMotionBlur) {
3369
3370
  } else if (pageMotionBlur !== "off" && runtimeRoot(document2)?.getAttribute("data-motion-blur") === "on") {
3370
3371
  reasons.push({
3371
3372
  code: "captureMotionBlur",
3372
- message: 'Detected capture motion blur (data-motion-blur="on"), which draws each frame with html-in-canvas; routed through screenshot capture mode.'
3373
+ message: 'Detected motion blur (data-motion-blur="on"), drawn per frame with an SVG filter or, on the capture tier, html-in-canvas; routed through screenshot capture mode.'
3373
3374
  });
3374
3375
  }
3375
3376
  if (document2.querySelector("iframe")) {
@@ -4110,13 +4111,26 @@ async function localizeRemoteMediaSources(html, downloadDir) {
4110
4111
  if (m[1]) urlSet.add(m[1]);
4111
4112
  }
4112
4113
  }
4113
- return downloadAndRewriteUrls(
4114
+ const localized = await downloadAndRewriteUrls(
4114
4115
  urlSet,
4115
4116
  html,
4116
4117
  join9(downloadDir, REMOTE_MEDIA_SUBDIR),
4117
4118
  "Remote media download failed",
4118
4119
  "Localized remote media source(s)"
4119
4120
  );
4121
+ return { ...localized, html: dropBindingOnLocalizedMedia(localized.html) };
4122
+ }
4123
+ function dropBindingOnLocalizedMedia(html) {
4124
+ if (!html.includes("data-var-src")) return html;
4125
+ const { document: document2 } = parseHTML5(html);
4126
+ let changed = false;
4127
+ for (const el of document2.querySelectorAll("video[data-var-src], audio[data-var-src]")) {
4128
+ if (el.closest("[data-variable-values]")) continue;
4129
+ if (!el.getAttribute("src")?.startsWith(`${REMOTE_MEDIA_SUBDIR}/`)) continue;
4130
+ el.removeAttribute("data-var-src");
4131
+ changed = true;
4132
+ }
4133
+ return changed ? document2.toString() : html;
4120
4134
  }
4121
4135
  async function localizeRemoteImageSources(html, downloadDir) {
4122
4136
  const urlSet = /* @__PURE__ */ new Set();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "15ceaa5025a85e0af724e23a20ae8e6671c67c1680fa0c9736708f42f1676e3f",
4
+ "sha256": "365a71ffb699cdb086477aaf2be92cf655d7212891ba42c9d92131a47c3ede06",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"