@swf2es/web 0.1.20 → 0.1.22

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.
@@ -37,6 +37,15 @@ export declare class Playback {
37
37
  private destroyed;
38
38
  /** The stage's quality it last drew by. */
39
39
  private quality;
40
+ /** The last animation frame's time. */
41
+ private frameTime;
42
+ /**
43
+ * performance.now() as the last animation frame that came in time ended, by which the timer
44
+ * tells that they stopped: a minimized window's come a second apart, which is not in time.
45
+ */
46
+ private framed;
47
+ /** The timer that plays on while no animation frame comes. */
48
+ private pump;
40
49
  private constructor();
41
50
  /**
42
51
  * A renderer for `player` in `box` (docs/renderer.md), which takes WebGL 2.
@@ -48,7 +57,7 @@ export declare class Playback {
48
57
  static create(box: HTMLElement, player: Player, scripting: Scripting | null, look: () => Look, report: (error: unknown) => void, stage3D?: Stage3DSession | null): Promise<Playback>;
49
58
  /** The renderer's WebGL context, null once destroyed. */
50
59
  get gl(): WebGL2RenderingContext | null;
51
- /** Play and draw on every animation frame, from now. */
60
+ /** Play and draw on every animation frame, from now; play on by a timer while none comes. */
52
61
  run(): void;
53
62
  /** Something the host shows differently: draw again on the next frame. */
54
63
  changed(): void;
@@ -56,6 +65,18 @@ export declare class Playback {
56
65
  invalidate(): void;
57
66
  private readonly shown;
58
67
  private readonly tick;
68
+ /**
69
+ * A hidden page gets no animation frames: a minimized window's, or on Windows one another
70
+ * window covers, Electron's included, and an Electron window that is never throttled gets
71
+ * one a second while minimized. Played only by them, the player stopped dead: no timer
72
+ * fired, nothing went out, and what its sockets received piled up, all of it handled, and
73
+ * answered, in the first frame once shown, a burst a server may take for a flood, after a
74
+ * silence it may take for a lost client. Flash kept a hidden SWF playing; here a timer plays
75
+ * the frames while they do not come in time, at the SWF's rate as far as the page's timers
76
+ * may run (a browser slows a hidden page's to one a second), and draws nothing.
77
+ */
78
+ private readonly idle;
79
+ private step;
59
80
  /**
60
81
  * Drawn by the stage's quality as a script or the page changes it:
61
82
  * Flash's low draws edges aliased and smooths no bitmap; medium, high and
@@ -1 +1 @@
1
- {"version":3,"file":"playback.d.ts","sourceRoot":"","sources":["../src/playback.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,MAAM,EACX,KAAK,SAAS,EAEf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,6EAA6E;AAC7E,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,qBAAa,QAAQ;IAsBjB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IA3B1B,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,IAAI,CAAuB;IACnC;;;;OAIG;IACH,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,KAAK,CAAM;IACnB,0GAA0G;IAC1G,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,4FAA4F;IAC5F,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,SAAS,CAAS;IAC1B,2CAA2C;IAC3C,OAAO,CAAC,OA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,MAAM,GAAG,MAAM,CAQxE;AAED,mGAAmG;AACnG,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAOrD"}
package/dist/playback.js CHANGED
@@ -30,6 +30,15 @@ export class Playback {
30
30
  destroyed = false;
31
31
  /** The stage's quality it last drew by. */
32
32
  quality = "";
33
+ /** The last animation frame's time. */
34
+ frameTime = null;
35
+ /**
36
+ * performance.now() as the last animation frame that came in time ended, by which the timer
37
+ * tells that they stopped: a minimized window's come a second apart, which is not in time.
38
+ */
39
+ framed = Number.NEGATIVE_INFINITY;
40
+ /** The timer that plays on while no animation frame comes. */
41
+ pump;
33
42
  constructor(box, player, scripting, view, look, report, stage3D) {
34
43
  this.box = box;
35
44
  this.player = player;
@@ -94,10 +103,11 @@ export class Playback {
94
103
  }
95
104
  return this.view.gl;
96
105
  }
97
- /** Play and draw on every animation frame, from now. */
106
+ /** Play and draw on every animation frame, from now; play on by a timer while none comes. */
98
107
  run() {
99
108
  if (!this.destroyed && !this.frame) {
100
109
  this.frame = requestAnimationFrame(this.tick);
110
+ this.pump = setTimeout(this.idle, STALL_MS);
101
111
  }
102
112
  }
103
113
  /** Something the host shows differently: draw again on the next frame. */
@@ -116,6 +126,33 @@ export class Playback {
116
126
  };
117
127
  tick = (now) => {
118
128
  this.frame = requestAnimationFrame(this.tick);
129
+ const steady = this.frameTime !== null && now - this.frameTime < STALL_MS;
130
+ this.frameTime = now;
131
+ this.step(now, true);
132
+ if (steady) {
133
+ this.framed = performance.now();
134
+ }
135
+ };
136
+ /**
137
+ * A hidden page gets no animation frames: a minimized window's, or on Windows one another
138
+ * window covers, Electron's included, and an Electron window that is never throttled gets
139
+ * one a second while minimized. Played only by them, the player stopped dead: no timer
140
+ * fired, nothing went out, and what its sockets received piled up, all of it handled, and
141
+ * answered, in the first frame once shown, a burst a server may take for a flood, after a
142
+ * silence it may take for a lost client. Flash kept a hidden SWF playing; here a timer plays
143
+ * the frames while they do not come in time, at the SWF's rate as far as the page's timers
144
+ * may run (a browser slows a hidden page's to one a second), and draws nothing.
145
+ */
146
+ idle = () => {
147
+ const now = performance.now();
148
+ const stalled = now - this.framed >= STALL_MS;
149
+ // Set before the step, as tick asks for its next frame first: a destroy inside clears it.
150
+ this.pump = setTimeout(this.idle, stalled ? 1000 / (this.player.frameRate || 24) : STALL_MS);
151
+ if (stalled) {
152
+ this.step(now, false);
153
+ }
154
+ };
155
+ step(now, show) {
119
156
  const dt = this.last === null ? 0 : now - this.last;
120
157
  this.last = now;
121
158
  // Moved to a display of another density, or zoomed: drawn anew for its pixels.
@@ -135,10 +172,10 @@ export class Playback {
135
172
  if (this.player.quality !== this.quality) {
136
173
  this.requality();
137
174
  }
138
- if (this.player.changes !== this.drawn || this.dirty) {
175
+ if (show && (this.player.changes !== this.drawn || this.dirty)) {
139
176
  this.draw();
140
177
  }
141
- };
178
+ }
142
179
  /**
143
180
  * Drawn by the stage's quality as a script or the page changes it:
144
181
  * Flash's low draws edges aliased and smooths no bitmap; medium, high and
@@ -277,6 +314,7 @@ export class Playback {
277
314
  }
278
315
  this.destroyed = true;
279
316
  cancelAnimationFrame(this.frame);
317
+ clearTimeout(this.pump);
280
318
  this.resize.disconnect();
281
319
  for (const unbind of this.unbind.splice(0)) {
282
320
  unbind();
@@ -305,6 +343,11 @@ function stageAround(rect, view, stageWidth, stageHeight) {
305
343
  resolution: view.resolution,
306
344
  };
307
345
  }
346
+ /**
347
+ * How long without an animation frame, in ms, before the timer plays one: well past a frame
348
+ * at any display's rate or a slow one's draw, so that it never plays between frames that come.
349
+ */
350
+ const STALL_MS = 250;
308
351
  /** The most a canvas's multisampled buffers may take, colour and depth-stencil together. */
309
352
  const STAGE_BYTES = 256 * 1024 * 1024;
310
353
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"playback.js","sourceRoot":"","sources":["../src/playback.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,qEAAqE;AACrE,0EAA0E;AAE1E,OAAO,EACL,cAAc,EACd,YAAY,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G,CAAC,CAAC;IACd,OAAO,KAAK,GAAG,MAAM,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,OAAO,OAAO,GAAG,CAAC,IAAI,MAAM,GAAG,OAAO,GAAG,CAAC,GAAG,WAAW,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC,CAAC;IACf,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type Swf } from "@swf2es/format";
2
+ import type { WebWorkerHost } from "@swf2es/player-hosts/workers";
3
+ /**
4
+ * Whether a SWF's ActionScript names WorkerDomain, in its ABCs' strings:
5
+ * one that does may start a worker and wait for it in the same script,
6
+ * which only a Web Worker started ahead can answer.
7
+ */
8
+ export declare function namesWorkers(swf: Swf): boolean;
9
+ /**
10
+ * How long a SWF that names workers waits for the Web Workers started
11
+ * ahead before its first frame: past it, it plays on, and a worker it
12
+ * starts takes one still loading.
13
+ */
14
+ export declare const READY_WAIT = 10000;
15
+ /** A player's Web Workers, or none where their module does not load, as under an import map that does not name it. */
16
+ export declare function workersOrNone(ahead: boolean): Promise<WebWorkerHost | null>;
17
+ //# sourceMappingURL=workers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workers.d.ts","sourceRoot":"","sources":["../src/workers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAQ,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAMlE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAwB9C;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAAS,CAAC;AAEjC,sHAAsH;AACtH,wBAAsB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAOjF"}
@@ -0,0 +1,49 @@
1
+ // A SWF's Web Workers as the element starts them: whether its ActionScript
2
+ // names WorkerDomain, the host, and how long its first frame waits for them.
3
+ import { tags } from "@swf2es/format";
4
+ import { workerHostForPlayer } from "./config.js";
5
+ /** The bytes of "WorkerDomain", the class a SWF's ActionScript names to start a worker. */
6
+ const WORKER_DOMAIN = new TextEncoder().encode("WorkerDomain");
7
+ /**
8
+ * Whether a SWF's ActionScript names WorkerDomain, in its ABCs' strings:
9
+ * one that does may start a worker and wait for it in the same script,
10
+ * which only a Web Worker started ahead can answer.
11
+ */
12
+ export function namesWorkers(swf) {
13
+ const bytes = swf.bytes;
14
+ const first = WORKER_DOMAIN[0];
15
+ for (const tag of swf.tags) {
16
+ if (tag.code !== tags.DoABC && tag.code !== tags.DoABC2) {
17
+ continue;
18
+ }
19
+ const end = tag.offset + tag.length - WORKER_DOMAIN.length;
20
+ for (let at = bytes.indexOf(first, tag.offset); at !== -1 && at <= end;) {
21
+ let k = 1;
22
+ while (k < WORKER_DOMAIN.length && bytes[at + k] === WORKER_DOMAIN[k]) {
23
+ k++;
24
+ }
25
+ if (k === WORKER_DOMAIN.length) {
26
+ return true;
27
+ }
28
+ at = bytes.indexOf(first, at + 1);
29
+ }
30
+ }
31
+ return false;
32
+ }
33
+ /**
34
+ * How long a SWF that names workers waits for the Web Workers started
35
+ * ahead before its first frame: past it, it plays on, and a worker it
36
+ * starts takes one still loading.
37
+ */
38
+ export const READY_WAIT = 10_000;
39
+ /** A player's Web Workers, or none where their module does not load, as under an import map that does not name it. */
40
+ export async function workersOrNone(ahead) {
41
+ try {
42
+ return await workerHostForPlayer(ahead);
43
+ }
44
+ catch (error) {
45
+ console.warn(`swf2es: workers are off, as their host did not load: ${error}`);
46
+ return null;
47
+ }
48
+ }
49
+ //# sourceMapp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,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AAEjC,sHAAsH;AACtH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAc;IAChD,IAAI,CAAC;QACH,OAAO,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,wDAAwD,KAAK,EAAE,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swf2es/web",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Plays SWFs on any web page: the <swf2es-player> element, replaceFlash and ExternalInterface",
5
5
  "keywords": [
6
6
  "swf",
@@ -32,9 +32,9 @@
32
32
  "src"
33
33
  ],
34
34
  "dependencies": {
35
- "@swf2es/format": "0.1.20",
36
- "@swf2es/player": "0.1.20",
37
- "@swf2es/codegen": "0.1.20",
38
- "@swf2es/player-hosts": "0.1.20"
35
+ "@swf2es/codegen": "0.1.22",
36
+ "@swf2es/format": "0.1.22",
37
+ "@swf2es/player-hosts": "0.1.22",
38
+ "@swf2es/player": "0.1.22"
39
39
  }
40
40
  }
@@ -0,0 +1,59 @@
1
+ // What an <embed>'s attributes say, read as Flash read them: sizes, colours,
2
+ // FlashVars, allowScriptAccess and quality.
3
+
4
+ /** "550" is pixels, as an <embed>'s width is; "100%" and other CSS lengths are themselves. */
5
+ export function cssLength(value: string | null): string | null {
6
+ if (value === null || value.trim() === "") {
7
+ return null;
8
+ }
9
+
10
+ return /^\s*\d+(\.\d+)?\s*$/.test(value) ? `${Number(value)}px` : value.trim();
11
+ }
12
+
13
+ /** A colour as Flash's bgcolor gives it, "#RRGGBB" or "RRGGBB"; null for none or another form. */
14
+ export function parseColor(value: string | null): number | null {
15
+ const hex = /^\s*#?([0-9a-f]{6})\s*$/i.exec(value ?? "")?.[1];
16
+ return hex ? Number.parseInt(hex, 16) : null;
17
+ }
18
+
19
+ /** FlashVars, "name=value&...", URL-encoded, as Flash read them. */
20
+ export function parseFlashVars(value: string | null): Record<string, string> {
21
+ const vars: Record<string, string> = {};
22
+ for (const [name, text] of new URLSearchParams(value ?? "")) {
23
+ vars[name] = text;
24
+ }
25
+
26
+ return vars;
27
+ }
28
+
29
+ /**
30
+ * Whether a SWF from `swfUrl` may script its page, by allowScriptAccess as
31
+ * Flash read it: "always", "never", or by default "sameDomain", the SWF's
32
+ * origin the page's.
33
+ */
34
+ export function scriptAccess(value: string | null, swfUrl: string, pageUrl: string): boolean {
35
+ switch (value?.toLowerCase()) {
36
+ case "always":
37
+ return true;
38
+ case "never":
39
+ return false;
40
+ default:
41
+ try {
42
+ const origin = new URL(swfUrl, pageUrl).origin;
43
+ // An opaque origin ("null": data:, a sandboxed frame) is no one's domain, not even its own.
44
+ return origin !== "null" && origin === new URL(pageUrl).origin;
45
+ } catch {
46
+ return false;
47
+ }
48
+ }
49
+ }
50
+
51
+ /** Flash's quality names; the auto ones as what they start at. */
52
+ export function quality(value: string | null): string {
53
+ const named = (value ?? "high").toUpperCase();
54
+ if (named === "AUTOLOW") {
55
+ return "LOW";
56
+ }
57
+
58
+ return ["LOW", "MEDIUM", "HIGH", "BEST"].includes(named) ? named : "HIGH";
59
+ }
package/src/element.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  // <swf2es-player>: a SWF on a page as an <embed> showed one, with the
2
2
  // embedding's attributes, a load() and destroy() of its own, and the
3
3
  // SWF's ExternalInterface callbacks as methods on the element.
4
- import { definesInput, isAs3, readActions, readSwf, type Swf, tags } from "@swf2es/format";
4
+ import { definesInput, isAs3, readActions, readSwf, tags } from "@swf2es/format";
5
5
  import {
6
6
  type AirApplication,
7
7
  Avm1,
8
8
  type ExternalInterfaceHost,
9
- type FetchRequest,
10
- type FetchResult,
11
9
  type FileSystemHost,
12
10
  type FullScreenHost,
13
11
  Player,
@@ -18,19 +16,21 @@ import type { WebWorkerHost } from "@swf2es/player-hosts/workers";
18
16
  import { AIR_DIRECTORIES, AirApp, airAppForSwf, elementWindow, namesAir } from "./air.js";
19
17
  import { type AirFiles, airFiles } from "./air-files.js";
20
18
  import { type AirItems, airItems } from "./air-items.js";
19
+ import { cssLength, parseColor, parseFlashVars, quality, scriptAccess } from "./attributes.js";
21
20
  import {
22
21
  codegenForPlayer,
23
22
  configuration,
24
23
  moduleCacheOptions,
25
24
  playerLibraries,
26
25
  socketHost,
27
- workerHostForPlayer,
28
26
  } from "./config.js";
29
27
  import { externalInterfaceHost, type PageBridge, type PageValue } from "./external.js";
28
+ import { fetchFor, fetchMovie } from "./fetching.js";
30
29
  import { scaleMode } from "./layout.js";
31
30
  import { type Look, Playback } from "./playback.js";
32
31
  import type { Stage3DSession } from "./stage3d.js";
33
32
  import { UncaughtReports } from "./uncaught.js";
33
+ import { namesWorkers, READY_WAIT, workersOrNone } from "./workers.js";
34
34
 
35
35
  export const TAG = "swf2es-player";
36
36
 
@@ -68,7 +68,7 @@ const connected = (e: HTMLElement): boolean => Boolean(dom?.isConnected?.call(e)
68
68
  const idOf = (e: HTMLElement): string => String(dom?.id?.call(e) ?? "");
69
69
 
70
70
  /** What one load holds, let go of all at once when the next load or destroy comes. */
71
- interface Session {
71
+ export interface Session {
72
72
  scripting: Scripting | null;
73
73
  player: Player | null;
74
74
  playback: Playback | null;
@@ -125,196 +125,6 @@ function deferred(): Deferred {
125
125
  return d;
126
126
  }
127
127
 
128
- /** "550" is pixels, as an <embed>'s width is; "100%" and other CSS lengths are themselves. */
129
- function cssLength(value: string | null): string | null {
130
- if (value === null || value.trim() === "") {
131
- return null;
132
- }
133
-
134
- return /^\s*\d+(\.\d+)?\s*$/.test(value) ? `${Number(value)}px` : value.trim();
135
- }
136
-
137
- /** A colour as Flash's bgcolor gives it, "#RRGGBB" or "RRGGBB"; null for none or another form. */
138
- export function parseColor(value: string | null): number | null {
139
- const hex = /^\s*#?([0-9a-f]{6})\s*$/i.exec(value ?? "")?.[1];
140
- return hex ? Number.parseInt(hex, 16) : null;
141
- }
142
-
143
- /** FlashVars, "name=value&...", URL-encoded, as Flash read them. */
144
- export function parseFlashVars(value: string | null): Record<string, string> {
145
- const vars: Record<string, string> = {};
146
- for (const [name, text] of new URLSearchParams(value ?? "")) {
147
- vars[name] = text;
148
- }
149
-
150
- return vars;
151
- }
152
-
153
- /**
154
- * Whether a SWF from `swfUrl` may script its page, by allowScriptAccess as
155
- * Flash read it: "always", "never", or by default "sameDomain", the SWF's
156
- * origin the page's.
157
- */
158
- export function scriptAccess(value: string | null, swfUrl: string, pageUrl: string): boolean {
159
- switch (value?.toLowerCase()) {
160
- case "always":
161
- return true;
162
- case "never":
163
- return false;
164
- default:
165
- try {
166
- const origin = new URL(swfUrl, pageUrl).origin;
167
- // An opaque origin ("null": data:, a sandboxed frame) is no one's domain, not even its own.
168
- return origin !== "null" && origin === new URL(pageUrl).origin;
169
- } catch {
170
- return false;
171
- }
172
- }
173
- }
174
-
175
- /** The bytes of "WorkerDomain", the class a SWF's ActionScript names to start a worker. */
176
- const WORKER_DOMAIN = new TextEncoder().encode("WorkerDomain");
177
-
178
- /**
179
- * Whether a SWF's ActionScript names WorkerDomain, in its ABCs' strings:
180
- * one that does may start a worker and wait for it in the same script,
181
- * which only a Web Worker started ahead can answer.
182
- */
183
- export function namesWorkers(swf: Swf): boolean {
184
- const bytes = swf.bytes;
185
- const first = WORKER_DOMAIN[0];
186
- for (const tag of swf.tags) {
187
- if (tag.code !== tags.DoABC && tag.code !== tags.DoABC2) {
188
- continue;
189
- }
190
-
191
- const end = tag.offset + tag.length - WORKER_DOMAIN.length;
192
- for (let at = bytes.indexOf(first, tag.offset); at !== -1 && at <= end; ) {
193
- let k = 1;
194
- while (k < WORKER_DOMAIN.length && bytes[at + k] === WORKER_DOMAIN[k]) {
195
- k++;
196
- }
197
-
198
- if (k === WORKER_DOMAIN.length) {
199
- return true;
200
- }
201
-
202
- at = bytes.indexOf(first, at + 1);
203
- }
204
- }
205
-
206
- return false;
207
- }
208
-
209
- /**
210
- * How long a SWF that names workers waits for the Web Workers started
211
- * ahead before its first frame: past it, it plays on, and a worker it
212
- * starts takes one still loading.
213
- */
214
- const READY_WAIT = 10_000;
215
-
216
- /** A player's Web Workers, or none where their module does not load, as under an import map that does not name it. */
217
- async function workersOrNone(ahead: boolean): Promise<WebWorkerHost | null> {
218
- try {
219
- return await workerHostForPlayer(ahead);
220
- } catch (error) {
221
- console.warn(`swf2es: workers are off, as their host did not load: ${error}`);
222
- return null;
223
- }
224
- }
225
-
226
- /** Flash's quality names; the auto ones as what they start at. */
227
- function quality(value: string | null): string {
228
- const named = (value ?? "high").toUpperCase();
229
- if (named === "AUTOLOW") {
230
- return "LOW";
231
- }
232
-
233
- return ["LOW", "MEDIUM", "HIGH", "BEST"].includes(named) ? named : "HIGH";
234
- }
235
-
236
- /** The SWF at `url`, by the embedder's fetch where it gave one, and the URL a redirect took it to. */
237
- async function fetchMovie(
238
- url: string,
239
- signal: AbortSignal,
240
- ): Promise<{ bytes: Uint8Array; url: string }> {
241
- const fetchOf = configuration().fetch;
242
- if (fetchOf) {
243
- const result = await fetchOf(
244
- { url, method: "GET", headers: [], body: null, purpose: "movie" },
245
- signal,
246
- );
247
- if (!result.bytes) {
248
- throw new Error(`swf2es: ${result.status} for ${url}`);
249
- }
250
-
251
- return { bytes: result.bytes, url: result.url ?? url };
252
- }
253
-
254
- const response = await fetch(url, { signal });
255
- if (!response.ok) {
256
- throw new Error(`swf2es: ${response.status} for ${url}`);
257
- }
258
-
259
- return { bytes: new Uint8Array(await response.arrayBuffer()), url: response.url || url };
260
- }
261
-
262
- /**
263
- * What a session's SWFs load by: its AIR application's files, then the
264
- * embedder's fetch or the browser's; `offline` (allowNetworking "none"),
265
- * nothing past the application's own files, which are no network.
266
- */
267
- function fetchFor(
268
- session: Session,
269
- offline: boolean,
270
- ): (request: FetchRequest, signal: AbortSignal) => Promise<FetchResult> {
271
- const fetchOf: (request: FetchRequest, signal: AbortSignal) => Promise<FetchResult> = offline
272
- ? () => Promise.reject(new Error("allowNetworking is none"))
273
- : (configuration().fetch ?? browserFetch);
274
- const app = session.air?.app;
275
- if (!app) {
276
- return fetchOf;
277
- }
278
-
279
- return (request, signal) => {
280
- const local = app.fetch(request, session.air?.files);
281
- if (!local) {
282
- return fetchOf(request, signal);
283
- }
284
-
285
- // A file the application does not hold, from the directory it came from: one the server
286
- // has none of is a file that is not there, not its error's body.
287
- const remote = local.bytes ? null : app.remote(request.url);
288
- return remote
289
- ? fetchOf({ ...request, url: remote, errorBody: false }, signal)
290
- : Promise.resolve(local);
291
- };
292
- }
293
-
294
- /** The host's fetch for what a SWF loads: the browser's, its status and headers as they come. */
295
- async function browserFetch(request: FetchRequest, signal: AbortSignal): Promise<FetchResult> {
296
- const response = await fetch(request.url, {
297
- signal,
298
- method: request.method,
299
- headers: request.headers.map(([name, value]) => [name, value]),
300
- body: request.body ? new Uint8Array(request.body).buffer : null,
301
- });
302
- const headers: [string, string][] = [];
303
- response.headers.forEach((value, name) => {
304
- headers.push([name, value]);
305
- });
306
-
307
- // An error's body only where it is asked for, as an AIR application's URLLoader reads it.
308
- const read = response.ok || (!!request.errorBody && response.status >= 400);
309
- return {
310
- bytes: read ? new Uint8Array(await response.arrayBuffer()) : null,
311
- status: response.status,
312
- headers,
313
- // Where a redirect took it: the SWF is judged and named by that.
314
- ...(response.redirected ? { url: response.url } : {}),
315
- };
316
- }
317
-
318
128
  /**
319
129
  * Callback names the element refuses though it has no such property:
320
130
  * protocols other code looks for on any object. A `then` would make the