@swf2es/web 0.1.28 → 0.1.30
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.
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/element.d.ts +49 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +228 -5
- package/dist/element.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/meter.d.ts +73 -0
- package/dist/meter.d.ts.map +1 -0
- package/dist/meter.js +422 -0
- package/dist/meter.js.map +1 -0
- package/dist/playback.d.ts +37 -0
- package/dist/playback.d.ts.map +1 -1
- package/dist/playback.js +53 -2
- package/dist/playback.js.map +1 -1
- package/package.json +5 -5
- package/src/config.ts +7 -0
- package/src/element.ts +274 -2
- package/src/index.ts +2 -0
- package/src/meter.ts +498 -0
- package/src/playback.ts +91 -2
package/dist/playback.js
CHANGED
|
@@ -11,6 +11,22 @@ export class Playback {
|
|
|
11
11
|
look;
|
|
12
12
|
report;
|
|
13
13
|
stage3D;
|
|
14
|
+
/**
|
|
15
|
+
* Told after every call of the loop, while set: one listener, which
|
|
16
|
+
* another replaces; unset, the loop measures nothing for it. Its time is
|
|
17
|
+
* not the player's: the frames' pacing counts only the frames' own.
|
|
18
|
+
*/
|
|
19
|
+
onFrame = null;
|
|
20
|
+
/** What onFrame hears, filled anew for each call. */
|
|
21
|
+
stats = {
|
|
22
|
+
time: 0,
|
|
23
|
+
frames: 0,
|
|
24
|
+
frameRate: 0,
|
|
25
|
+
play: 0,
|
|
26
|
+
draw: 0,
|
|
27
|
+
drew: false,
|
|
28
|
+
shown: false,
|
|
29
|
+
};
|
|
14
30
|
frame = 0;
|
|
15
31
|
last = null;
|
|
16
32
|
/**
|
|
@@ -152,7 +168,11 @@ export class Playback {
|
|
|
152
168
|
this.step(now, false);
|
|
153
169
|
}
|
|
154
170
|
};
|
|
155
|
-
step(
|
|
171
|
+
step(at, show) {
|
|
172
|
+
// The timer reads performance.now() as it runs; an animation frame's time is when the frame
|
|
173
|
+
// began, which may be before a timer's call just ahead of it. Its time so goes no further back
|
|
174
|
+
// than the last call's, and the player is never handed time going backwards.
|
|
175
|
+
const now = this.last === null ? at : Math.max(at, this.last);
|
|
156
176
|
const dt = this.last === null ? 0 : now - this.last;
|
|
157
177
|
this.last = now;
|
|
158
178
|
// Moved to a display of another density, or zoomed: drawn anew for its pixels.
|
|
@@ -160,8 +180,9 @@ export class Playback {
|
|
|
160
180
|
this.layout();
|
|
161
181
|
}
|
|
162
182
|
const start = performance.now();
|
|
183
|
+
let played = 0;
|
|
163
184
|
try {
|
|
164
|
-
this.player.advance(dt, this.busy);
|
|
185
|
+
played = this.player.advance(dt, this.busy);
|
|
165
186
|
}
|
|
166
187
|
catch (error) {
|
|
167
188
|
this.report(error);
|
|
@@ -172,8 +193,37 @@ export class Playback {
|
|
|
172
193
|
if (this.player.quality !== this.quality) {
|
|
173
194
|
this.requality();
|
|
174
195
|
}
|
|
196
|
+
let drew = false;
|
|
175
197
|
if (show && (this.player.changes !== this.drawn || this.dirty)) {
|
|
176
198
|
this.draw();
|
|
199
|
+
drew = true;
|
|
200
|
+
}
|
|
201
|
+
// A frame played and not drawn still settles what a draw would for its scripts.
|
|
202
|
+
if (!drew && played > 0) {
|
|
203
|
+
this.player.undrawn();
|
|
204
|
+
}
|
|
205
|
+
// A frame's script may have destroyed the player: there is nothing left to tell of.
|
|
206
|
+
if (this.onFrame && !this.destroyed) {
|
|
207
|
+
this.told(this.onFrame, now, played, start, drew, show);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/** Tell `listener` of the call that began at `start`, its frames' part `this.busy`. */
|
|
211
|
+
told(listener, now, frames, start, drew, shown) {
|
|
212
|
+
const end = performance.now();
|
|
213
|
+
const stats = this.stats;
|
|
214
|
+
stats.time = now;
|
|
215
|
+
stats.frames = frames;
|
|
216
|
+
stats.frameRate = this.player.frameRate;
|
|
217
|
+
stats.play = this.busy;
|
|
218
|
+
stats.draw = drew ? end - start - this.busy : 0;
|
|
219
|
+
stats.drew = drew;
|
|
220
|
+
stats.shown = shown;
|
|
221
|
+
// A listener that throws is the page's error, not the loop's: the loop goes on.
|
|
222
|
+
try {
|
|
223
|
+
listener(stats);
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
reportError(error);
|
|
177
227
|
}
|
|
178
228
|
}
|
|
179
229
|
/**
|
|
@@ -223,6 +273,7 @@ export class Playback {
|
|
|
223
273
|
this.dirty = false;
|
|
224
274
|
this.view.background = background;
|
|
225
275
|
this.view.transparent = clear;
|
|
276
|
+
this.view.highlight = this.player.focusHighlight();
|
|
226
277
|
// A frame played that changed nothing drawn is left as it shows: no frame for the browser to
|
|
227
278
|
// composite, as Flash repaints nothing of a still stage. What the host changed draws anew.
|
|
228
279
|
if (forced || !this.view.unchanged(this.player.stage)) {
|
package/dist/playback.js.map
CHANGED
|
@@ -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,EACZ,aAAa,GAId,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEL,KAAK,EAEL,cAAc,EAEd,QAAQ,GACT,MAAM,aAAa,CAAC;AAarB,MAAM,OAAO,QAAQ;IA+BA,GAAG;IACH,MAAM;IACN,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,OAAO;IApClB,KAAK,GAAG,CAAC,CAAC;IACV,IAAI,GAAkB,IAAI,CAAC;IACnC;;;;OAIG;IACK,IAAI,GAAG,CAAC,CAAC;IACT,KAAK,GAAG,CAAC,CAAC,CAAC;IACnB,0GAA0G;IAClG,KAAK,GAAG,IAAI,CAAC;IACb,GAAG,GAAG,CAAC,CAAC;IACC,MAAM,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,MAAM,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;IAC9D,IAAI,KAAK,GAAG,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swf2es/web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
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/
|
|
36
|
-
"@swf2es/
|
|
37
|
-
"@swf2es/codegen": "0.1.
|
|
38
|
-
"@swf2es/player": "0.1.
|
|
35
|
+
"@swf2es/player": "0.1.30",
|
|
36
|
+
"@swf2es/format": "0.1.30",
|
|
37
|
+
"@swf2es/codegen": "0.1.30",
|
|
38
|
+
"@swf2es/player-hosts": "0.1.30"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/src/config.ts
CHANGED
|
@@ -129,6 +129,13 @@ export interface Configuration {
|
|
|
129
129
|
* element fires `audioblocked` and `audiounblocked` either way.
|
|
130
130
|
*/
|
|
131
131
|
unmutePrompt?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Whether an element offers its performance meter in its context menu
|
|
134
|
+
* ("Show stats"), and shows it as the viewer last left it there: on
|
|
135
|
+
* by default; an element's `performancemeter` attribute decides for
|
|
136
|
+
* itself. The page may show the meter through `performanceMeter` either way.
|
|
137
|
+
*/
|
|
138
|
+
performanceMeter?: boolean;
|
|
132
139
|
/** The page's build, a short commit or a version, which the context menu's About item names. */
|
|
133
140
|
build?: string;
|
|
134
141
|
/**
|
package/src/element.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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 type { Codegen } from "@swf2es/codegen";
|
|
4
5
|
import { definesInput, definesSound, isAs3, readActions, readSwf, tags } from "@swf2es/format";
|
|
5
6
|
import {
|
|
6
7
|
type AirApplication,
|
|
@@ -8,6 +9,8 @@ import {
|
|
|
8
9
|
type ExternalInterfaceHost,
|
|
9
10
|
type FileSystemHost,
|
|
10
11
|
type FullScreenHost,
|
|
12
|
+
type MenuItem,
|
|
13
|
+
nativeMemory,
|
|
11
14
|
Player,
|
|
12
15
|
Scripting,
|
|
13
16
|
type WorkerHost,
|
|
@@ -36,7 +39,18 @@ import {
|
|
|
36
39
|
import { externalInterfaceHost, type PageBridge, type PageValue } from "./external.js";
|
|
37
40
|
import { fetchFor, fetchMovie } from "./fetching.js";
|
|
38
41
|
import { scaleMode } from "./layout.js";
|
|
39
|
-
import {
|
|
42
|
+
import {
|
|
43
|
+
isMeterCorner,
|
|
44
|
+
METER_STYLE,
|
|
45
|
+
type MeterCorner,
|
|
46
|
+
nextCorner,
|
|
47
|
+
PerformanceMeter,
|
|
48
|
+
storeCorner,
|
|
49
|
+
storedCorner,
|
|
50
|
+
storedMeter,
|
|
51
|
+
storeMeter,
|
|
52
|
+
} from "./meter.js";
|
|
53
|
+
import { type FrameListener, type Look, Playback } from "./playback.js";
|
|
40
54
|
import type { Stage3DSession } from "./stage3d.js";
|
|
41
55
|
import { UncaughtReports } from "./uncaught.js";
|
|
42
56
|
import { UNMUTE_STYLE, UnmutePrompt } from "./unmute.js";
|
|
@@ -79,6 +93,8 @@ const idOf = (e: HTMLElement): string => String(dom?.id?.call(e) ?? "");
|
|
|
79
93
|
|
|
80
94
|
/** What one load holds, let go of all at once when the next load or destroy comes. */
|
|
81
95
|
export interface Session {
|
|
96
|
+
/** The compiler its code is compiled by, an AS3 SWF's or an AVM1 SWF's; null for a SWF without code. */
|
|
97
|
+
codegen: Codegen | null;
|
|
82
98
|
scripting: Scripting | null;
|
|
83
99
|
player: Player | null;
|
|
84
100
|
playback: Playback | null;
|
|
@@ -158,9 +174,20 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
158
174
|
"quality",
|
|
159
175
|
"menu",
|
|
160
176
|
"unmuteprompt",
|
|
177
|
+
"performancemeter",
|
|
161
178
|
"allowcapture",
|
|
162
179
|
];
|
|
163
180
|
|
|
181
|
+
// For the tests alone, under a key no page types: whether anything hears the loop's frames,
|
|
182
|
+
// the page's frame listener or the meter, which the loop then measures for.
|
|
183
|
+
static {
|
|
184
|
+
Object.defineProperty(Swf2esPlayerElement.prototype, Symbol.for("swf2es.frameHook"), {
|
|
185
|
+
get(this: Swf2esPlayerElement): boolean {
|
|
186
|
+
return !!this.#session?.playback?.onFrame;
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
164
191
|
#session: Session | null = null;
|
|
165
192
|
#readiness = deferred();
|
|
166
193
|
/** The source the element last loaded, to tell a new src from the one playing. */
|
|
@@ -171,6 +198,18 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
171
198
|
#stageSize: [number, number] | null = null;
|
|
172
199
|
/** The button over the player while its sound is held, made the first time it is. */
|
|
173
200
|
#prompt: UnmutePrompt | null = null;
|
|
201
|
+
#frameListener: FrameListener | null = null;
|
|
202
|
+
/** The performance meter, made the first time it shows. */
|
|
203
|
+
#meter: PerformanceMeter | null = null;
|
|
204
|
+
#meterShown = false;
|
|
205
|
+
/** Whether the meter shows by the viewer's choice, the menu's or the one kept, not a script's. */
|
|
206
|
+
#meterChosen = false;
|
|
207
|
+
/** The element's corner the meter sits in. */
|
|
208
|
+
#meterCorner: MeterCorner = "top-left";
|
|
209
|
+
/** Whether a script put the meter in its corner, which the viewer's kept corner then leaves. */
|
|
210
|
+
#cornerSet = false;
|
|
211
|
+
/** The page's frame listener and the meter's together, made once both listen. */
|
|
212
|
+
#bothListeners: FrameListener | null = null;
|
|
174
213
|
|
|
175
214
|
constructor() {
|
|
176
215
|
super();
|
|
@@ -180,7 +219,8 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
180
219
|
style.textContent =
|
|
181
220
|
":host { display: inline-block; position: relative; overflow: hidden; outline: none }" +
|
|
182
221
|
" .box { position: absolute; inset: 0; overflow: hidden }" +
|
|
183
|
-
UNMUTE_STYLE
|
|
222
|
+
UNMUTE_STYLE +
|
|
223
|
+
METER_STYLE;
|
|
184
224
|
this.#sizing = document.createElement("style");
|
|
185
225
|
this.#box = document.createElement("div");
|
|
186
226
|
this.#box.className = "box";
|
|
@@ -219,6 +259,216 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
219
259
|
return this.#session?.playback?.gl ?? null;
|
|
220
260
|
}
|
|
221
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Told after each animation frame what the player did in it: the SWF's
|
|
264
|
+
* frames played, its frame rate, and the ms its frames and the drawing
|
|
265
|
+
* took (FrameStats), for a page's performance meter. The object is the
|
|
266
|
+
* same each time, overwritten by the next frame's: copy what is kept.
|
|
267
|
+
* It holds for every SWF the element plays until set to null, as it
|
|
268
|
+
* starts; unset, the player measures nothing. There is one: setting it
|
|
269
|
+
* replaces the one before.
|
|
270
|
+
*/
|
|
271
|
+
get frameListener(): FrameListener | null {
|
|
272
|
+
return this.#frameListener;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
set frameListener(listener: FrameListener | null) {
|
|
276
|
+
this.#frameListener = typeof listener === "function" ? listener : null;
|
|
277
|
+
this.#listen();
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Whether the performance meter shows over the player: fps against the
|
|
282
|
+
* SWF's rate, the player's ms in a frame, draw calls, the JS heap and the
|
|
283
|
+
* WebAssembly memories. Off by default. The context menu's "Show
|
|
284
|
+
* performance" turns it on and keeps the viewer's choice, for every
|
|
285
|
+
* element of the origin, in localStorage; setting this shows or hides it
|
|
286
|
+
* for the page alone, keeping nothing. The element fires
|
|
287
|
+
* `performancemeterchange` as it shows or hides.
|
|
288
|
+
*/
|
|
289
|
+
get performanceMeter(): boolean {
|
|
290
|
+
return this.#meterShown;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
set performanceMeter(on: boolean) {
|
|
294
|
+
this.#meterChosen = false;
|
|
295
|
+
this.#showMeter(Boolean(on));
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* The corner of the player element the meter sits in, which in a
|
|
300
|
+
* letterboxed or noScale player may be in the bars beside the stage:
|
|
301
|
+
* "top-left", the default, "top-right", "bottom-left" or "bottom-right";
|
|
302
|
+
* another value is ignored.
|
|
303
|
+
* The context menu's "Move stats" moves it to the next and
|
|
304
|
+
* keeps the viewer's choice; setting this moves it for the page alone,
|
|
305
|
+
* keeping nothing, and fires `performancemeterchange`.
|
|
306
|
+
*/
|
|
307
|
+
get performanceMeterCorner(): MeterCorner {
|
|
308
|
+
return this.#meterCorner;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
set performanceMeterCorner(corner: MeterCorner) {
|
|
312
|
+
if (isMeterCorner(corner)) {
|
|
313
|
+
this.#cornerSet = true;
|
|
314
|
+
this.#placeMeter(corner);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** The meter moved to `corner`, the page told where `tell` and it moved. */
|
|
319
|
+
#placeMeter(corner: MeterCorner, tell = true): void {
|
|
320
|
+
if (corner === this.#meterCorner) {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
this.#meterCorner = corner;
|
|
325
|
+
this.#meter?.place(corner);
|
|
326
|
+
if (tell) {
|
|
327
|
+
this.#changedMeter();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
#changedMeter(): void {
|
|
332
|
+
dispatch(
|
|
333
|
+
this,
|
|
334
|
+
new CustomEvent("performancemeterchange", {
|
|
335
|
+
detail: { shown: this.#meterShown, corner: this.#meterCorner },
|
|
336
|
+
}),
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* The viewer's kept choice applied where the menu offers the meter, as a
|
|
342
|
+
* SWF starts and as the offer changes: read then, not as the element is
|
|
343
|
+
* connected, so that a page's configure() after its markup holds. Not
|
|
344
|
+
* offered, a meter the viewer's choice showed goes; a script's stays.
|
|
345
|
+
*/
|
|
346
|
+
#applyChoice(): void {
|
|
347
|
+
const shown = this.#meterShown;
|
|
348
|
+
const corner = this.#meterCorner;
|
|
349
|
+
if (!this.#cornerSet) {
|
|
350
|
+
this.#placeMeter(this.#meterOffered() ? storedCorner() : "top-left", false);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (this.#meterOffered()) {
|
|
354
|
+
if (!this.#meterShown && storedMeter()) {
|
|
355
|
+
this.#meterChosen = true;
|
|
356
|
+
this.#showMeter(true, false);
|
|
357
|
+
}
|
|
358
|
+
} else if (this.#meterChosen && this.#meterShown) {
|
|
359
|
+
this.#meterChosen = false;
|
|
360
|
+
this.#showMeter(false, false);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Told once, and only of what shows differently: not of a hidden meter's corner.
|
|
364
|
+
if (this.#meterShown !== shown || (this.#meterShown && this.#meterCorner !== corner)) {
|
|
365
|
+
this.#changedMeter();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** The meter shown or hidden, the page told where `tell`. */
|
|
370
|
+
#showMeter(on: boolean, tell = true): void {
|
|
371
|
+
const parent = this.#box.parentNode;
|
|
372
|
+
if (on === this.#meterShown || !parent) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
this.#meterShown = on;
|
|
377
|
+
if (on) {
|
|
378
|
+
this.#meter ??= new PerformanceMeter(parent, () => this.wasmMemory);
|
|
379
|
+
this.#meter.place(this.#meterCorner);
|
|
380
|
+
const playback = this.#session?.playback;
|
|
381
|
+
this.#meter.attach(playback?.gl ?? null, !!playback);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
this.#meter?.show(on);
|
|
385
|
+
this.#listen();
|
|
386
|
+
if (tell) {
|
|
387
|
+
this.#changedMeter();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* The context menu's items for the meter, where it offers them: one to
|
|
393
|
+
* show or hide it and, while it shows, one to move it to the next corner.
|
|
394
|
+
* Flash's menus had no submenus, nor has this one. Each is the viewer's own
|
|
395
|
+
* choice, kept for the next time.
|
|
396
|
+
*/
|
|
397
|
+
#meterMenu(): MenuItem[] {
|
|
398
|
+
if (!this.#meterOffered()) {
|
|
399
|
+
return [];
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
const items: MenuItem[] = [
|
|
403
|
+
{
|
|
404
|
+
caption: this.#meterShown ? "Hide stats" : "Show stats",
|
|
405
|
+
enabled: true,
|
|
406
|
+
select: () => {
|
|
407
|
+
const on = !this.#meterShown;
|
|
408
|
+
storeMeter(on);
|
|
409
|
+
this.#meterChosen = on;
|
|
410
|
+
this.#showMeter(on);
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
];
|
|
414
|
+
if (this.#meterShown) {
|
|
415
|
+
items.push({
|
|
416
|
+
caption: "Move stats",
|
|
417
|
+
enabled: true,
|
|
418
|
+
select: () => {
|
|
419
|
+
const corner = nextCorner(this.#meterCorner);
|
|
420
|
+
storeCorner(corner);
|
|
421
|
+
this.#cornerSet = false;
|
|
422
|
+
this.#placeMeter(corner);
|
|
423
|
+
},
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
return items;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/** Whether the context menu offers the meter, by the element's attribute or the page's configuration. */
|
|
431
|
+
#meterOffered(): boolean {
|
|
432
|
+
const own = attribute(this, "performancemeter")?.trim().toLowerCase();
|
|
433
|
+
return own === "true" || (own !== "false" && configuration().performanceMeter !== false);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** The playback told of each frame by whichever listen, the page's listener and the meter's. */
|
|
437
|
+
#listen(): void {
|
|
438
|
+
const playback = this.#session?.playback;
|
|
439
|
+
if (playback) {
|
|
440
|
+
playback.onFrame = this.#frameHook();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
#frameHook(): FrameListener | null {
|
|
445
|
+
const meter = this.#meterShown ? this.#meter : null;
|
|
446
|
+
if (!meter) {
|
|
447
|
+
return this.#frameListener;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (!this.#frameListener) {
|
|
451
|
+
return meter.heard;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
this.#bothListeners ??= (stats) => {
|
|
455
|
+
this.#meter?.heard(stats);
|
|
456
|
+
this.#frameListener?.(stats);
|
|
457
|
+
};
|
|
458
|
+
return this.#bothListeners;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* The bytes of the WebAssembly memories behind the player: its compiler's
|
|
463
|
+
* (`codegen`, 0 for a SWF without code or before a load), and the native
|
|
464
|
+
* modules' (`native`: bitmap kernels, tessellators, decoders, zlib), which
|
|
465
|
+
* every player on the page shares, its Flash Workers' left out, as their
|
|
466
|
+
* own threads hold them. A memory grows and never shrinks.
|
|
467
|
+
*/
|
|
468
|
+
get wasmMemory(): { codegen: number; native: number } {
|
|
469
|
+
return { codegen: this.#session?.codegen?.memoryBytes() ?? 0, native: nativeMemory() };
|
|
470
|
+
}
|
|
471
|
+
|
|
222
472
|
get src(): string {
|
|
223
473
|
return attribute(this, "src") ?? "";
|
|
224
474
|
}
|
|
@@ -282,6 +532,13 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
282
532
|
return;
|
|
283
533
|
}
|
|
284
534
|
|
|
535
|
+
// Taken from the viewer, the meter they turned on goes too, their choice kept for elsewhere;
|
|
536
|
+
// given back, it shows again.
|
|
537
|
+
if (name === "performancemeter") {
|
|
538
|
+
this.#applyChoice();
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
|
|
285
542
|
this.#session?.playback?.changed();
|
|
286
543
|
}
|
|
287
544
|
|
|
@@ -319,6 +576,7 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
319
576
|
|
|
320
577
|
const ready = this.#readiness;
|
|
321
578
|
const session: Session = {
|
|
579
|
+
codegen: null,
|
|
322
580
|
scripting: null,
|
|
323
581
|
player: null,
|
|
324
582
|
playback: null,
|
|
@@ -457,6 +715,7 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
457
715
|
}
|
|
458
716
|
|
|
459
717
|
session.workers = host;
|
|
718
|
+
session.codegen = codegen;
|
|
460
719
|
session.scripting = this.#scripting(session, codegen, url, baseUrl, pageUrl, host);
|
|
461
720
|
if (stage3D && stage3DModule) {
|
|
462
721
|
session.stage3D = new stage3DModule.Stage3DSession(
|
|
@@ -484,6 +743,8 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
484
743
|
return;
|
|
485
744
|
}
|
|
486
745
|
|
|
746
|
+
session.codegen = codegen;
|
|
747
|
+
|
|
487
748
|
// Its URL keys its SharedObjects, as a page's AS3 SWFs' are. Its
|
|
488
749
|
// fscommand, getURL and ExternalInterface reach the page as an AS3
|
|
489
750
|
// SWF's do: "quit" goes to the page, as a plug-in's did, and stops
|
|
@@ -534,6 +795,7 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
534
795
|
session.player.quality = quality(attribute(this, "quality"));
|
|
535
796
|
session.player.showDefaultContextMenu = attribute(this, "menu")?.toLowerCase() !== "false";
|
|
536
797
|
session.player.build = configuration().build ?? null;
|
|
798
|
+
session.player.hostMenu = () => this.#meterMenu();
|
|
537
799
|
const playback = await Playback.create(
|
|
538
800
|
this.#box,
|
|
539
801
|
session.player,
|
|
@@ -548,6 +810,12 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
548
810
|
}
|
|
549
811
|
|
|
550
812
|
session.playback = playback;
|
|
813
|
+
playback.onFrame = this.#frameHook();
|
|
814
|
+
if (this.#meterShown) {
|
|
815
|
+
this.#meter?.attach(playback.gl, true);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
this.#applyChoice();
|
|
551
819
|
// The workers started ahead, loaded before a script may wait for one;
|
|
552
820
|
// a script that never says it loaded does not keep the SWF from playing.
|
|
553
821
|
if (session.workers) {
|
|
@@ -961,6 +1229,10 @@ export class Swf2esPlayerElement extends ElementBase {
|
|
|
961
1229
|
|
|
962
1230
|
session.callbacks.clear();
|
|
963
1231
|
session.abort.abort();
|
|
1232
|
+
if (session.playback) {
|
|
1233
|
+
this.#meter?.attach(null, false);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
964
1236
|
session.playback?.destroy();
|
|
965
1237
|
session.stage3D?.destroy();
|
|
966
1238
|
session.player?.destroy();
|
package/src/index.ts
CHANGED
|
@@ -21,6 +21,8 @@ export {
|
|
|
21
21
|
export { defineElement, Swf2esPlayerElement, type SwfSource, TAG } from "./element.js";
|
|
22
22
|
export { ExternalInterfaceError, type PageValue } from "./external.js";
|
|
23
23
|
export { type Placement, place, type ScaleMode, scaleMode } from "./layout.js";
|
|
24
|
+
export type { MeterCorner } from "./meter.js";
|
|
25
|
+
export type { FrameListener, FrameStats } from "./playback.js";
|
|
24
26
|
export { flashAttributes, isFlash, replaceFlash, watchFlash } from "./replace.js";
|
|
25
27
|
export type { Stage3DSurfaceFactory, Stage3DSurfaceLoader } from "./stage3d.js";
|
|
26
28
|
|