@swf2es/web 0.1.14 → 0.1.16

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/playback.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // the element and the device's pixels, the pointer, the keys and the
3
3
  // focus, and the loop that plays and draws, all of which destroy lets go.
4
4
  import { bindActivation, bindKeyboard, bindTextInput, } from "@swf2es/player";
5
- import { place, viewport } from "./layout.js";
5
+ import { place, sourceViewport, viewport, } from "./layout.js";
6
6
  export class Playback {
7
7
  box;
8
8
  player;
@@ -221,15 +221,19 @@ export class Playback {
221
221
  scripting?.setStageDefaults(look.scale, look.salign ?? "");
222
222
  const mode = scripting?.stageScaleMode ?? look.scale;
223
223
  const align = scripting?.stageAlign ?? look.salign;
224
- // Live noScale makes the stage the box's size; every other mode keeps the SWF's.
224
+ // In full screen with a fullScreenSourceRect, that part of the stage alone is shown.
225
+ const rect = scripting?.fullScreen.rect ?? null;
226
+ // Live noScale makes the stage the box's size, or the source rect's; every other mode keeps the SWF's.
225
227
  const noScale = !!scripting && mode === "noScale";
226
- const stageWidth = noScale ? this.box.clientWidth : this.player.width;
227
- const stageHeight = noScale ? this.box.clientHeight : this.player.height;
228
+ const stageWidth = noScale ? (rect?.width ?? this.box.clientWidth) : this.player.width;
229
+ const stageHeight = noScale ? (rect?.height ?? this.box.clientHeight) : this.player.height;
228
230
  this.dpr = devicePixelRatio || 1;
229
231
  const placed = place(this.player.width || 1, this.player.height || 1, this.box.clientWidth, this.box.clientHeight, mode, align, this.dpr,
230
232
  // AIR's top and left edges win where both are named; checked with Stage3D only.
231
233
  !!this.stage3D);
232
- const view = viewport(this.player.width || 1, this.player.height || 1, this.box.clientWidth, this.box.clientHeight, mode, placed);
234
+ const view = rect
235
+ ? sourceViewport(rect, this.box.clientWidth, this.box.clientHeight, this.dpr)
236
+ : viewport(this.player.width || 1, this.player.height || 1, this.box.clientWidth, this.box.clientHeight, mode, placed);
233
237
  const canvas = this.view.canvas;
234
238
  canvas.style.left = `${view.css.x}px`;
235
239
  canvas.style.top = `${view.css.y}px`;
@@ -257,7 +261,7 @@ export class Playback {
257
261
  this.scripting.stageViewportHeight = screenHeight;
258
262
  }
259
263
  this.view.setViewport(view.x, view.y, screenWidth, screenHeight);
260
- this.stage3D?.layout(placed, this.player.width, this.player.height);
264
+ this.stage3D?.layout(rect ? stageAround(rect, view, this.player.width, this.player.height) : placed, this.player.width, this.player.height);
261
265
  this.dirty = true;
262
266
  // Dispatch only after placement is current: a resize listener may set
263
267
  // another layout or reconfigure its Stage3D back buffer synchronously.
@@ -287,6 +291,17 @@ export class Playback {
287
291
  this.view.canvas.remove();
288
292
  }
289
293
  }
294
+ /** Where the whole stage lies in the box when `view` shows `rect` of it: Stage3D's layers are placed by the stage. */
295
+ function stageAround(rect, view, stageWidth, stageHeight) {
296
+ const scale = view.css.width / rect.width;
297
+ return {
298
+ x: view.css.x - rect.x * scale,
299
+ y: view.css.y - rect.y * scale,
300
+ width: stageWidth * scale,
301
+ height: stageHeight * scale,
302
+ resolution: view.resolution,
303
+ };
304
+ }
290
305
  /** The most a canvas's multisampled buffers may take, colour and depth-stencil together. */
291
306
  const STAGE_BYTES = 256 * 1024 * 1024;
292
307
  /**
@@ -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,EAAE,KAAK,EAAkB,QAAQ,EAAE,MAAM,aAAa,CAAC;AAa9D,MAAM,OAAO,QAAQ;IAsBA,GAAG;IACH,MAAM;IACN,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,OAAO;IA3BlB,KAAK,GAAG,CAAC,CAAC;IACV,IAAI,GAAkB,IAAI,CAAC;IACnC;;;;OAIG;IACK,IAAI,GAA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D,OAAO,IAAI,CAAC,CAAC;IACf,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../src/replace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,mBAAmB,EAAO,MAAM,cAAc,CAAC;AAyC5E,iHAAiH;AACjH,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAiBjD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAyBnE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,UAAqB,GAAG,mBAAmB,EAAE,CAkC/E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,UAAU,GAAG,IAAe,GAAG,MAAM,IAAI,CAuBzE"}
1
+ {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../src/replace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,mBAAmB,EAAO,MAAM,cAAc,CAAC;AA2C5E,iHAAiH;AACjH,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAiBjD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAyBnE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,UAAqB,GAAG,mBAAmB,EAAE,CAkC/E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,UAAU,GAAG,IAAe,GAAG,MAAM,IAAI,CAuBzE"}
package/dist/replace.js CHANGED
@@ -17,6 +17,8 @@ const CARRIED = [
17
17
  "base",
18
18
  "allowscriptaccess",
19
19
  "allownetworking",
20
+ "allowfullscreen",
21
+ "allowfullscreeninteractive",
20
22
  "qu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M,GAAG,GACP,IAAI,YAAY,OAAO,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;gBACpF,IAAI,GAAG,YAAY,OAAO,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;oBAC9C,YAAY,CAAC,GAAG,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QACrB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;KAC7D,CAAC,CAAC;IACH,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;AACrC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare class UncaughtReports {
2
+ /** How often each error was reported, by its text and where it was thrown. */
3
+ private readonly counts;
4
+ /**
5
+ * The line to print for an error whose AS3 text is `text`, e.g.
6
+ * "TypeError: Error #1006": with `detail`, the message in full ("Error
7
+ * #1006: value is not a function."), and `stack`, where it was made, if
8
+ * the runtime has them. Null for a repeat that is not told.
9
+ */
10
+ line(text: string, detail: string | null, stack: string | null): string | null;
11
+ }
12
+ //# sourceMappingURL=uncaught.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uncaught.d.ts","sourceRoot":"","sources":["../src/uncaught.ts"],"names":[],"mappings":"AASA,qBAAa,eAAe;IAC1B,8EAA8E;IAC9E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAEpD;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAc7E;CACF"}
@@ -0,0 +1,31 @@
1
+ // What the element says of an error a SWF's code threw and nothing caught.
2
+ // The release player's message is the error's number alone, so the report
3
+ // adds what the number stands for and where it was thrown; and a SWF that
4
+ // throws the same error every frame is told of once, then at its 10th,
5
+ // 100th and so on, rather than filling the console.
6
+ /** How many stack lines a report shows: the method that threw and its callers. */
7
+ const FRAMES = 4;
8
+ export class UncaughtReports {
9
+ /** How often each error was reported, by its text and where it was thrown. */
10
+ counts = new Map();
11
+ /**
12
+ * The line to print for an error whose AS3 text is `text`, e.g.
13
+ * "TypeError: Error #1006": with `detail`, the message in full ("Error
14
+ * #1006: value is not a function."), and `stack`, where it was made, if
15
+ * the runtime has them. Null for a repeat that is not told.
16
+ */
17
+ line(text, detail, stack) {
18
+ const frames = stack ? stack.split("\n").slice(0, FRAMES) : [];
19
+ const key = `${text}\n${frames[0] ?? ""}`;
20
+ const count = (this.counts.get(key) ?? 0) + 1;
21
+ this.counts.set(key, count);
22
+ // The text ends in the number where the message is the release player's: its words follow.
23
+ const number = detail?.match(/^Error #\d+/)?.[0];
24
+ const full = detail && number && text.endsWith(number) ? text + detail.slice(number.length) : text;
25
+ if (count === 1) {
26
+ return [`swf2es: ${full}`, ...frames].join("\n");
27
+ }
28
+ return /^10*$/.test(String(count)) ? `swf2es: ${full} (${count} times)` : null;
29
+ }
30
+ }
31
+ //# sourceMappingURL=uncaught.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uncaught.js","sourceRoot":"","sources":["../src/uncaught.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,uEAAuE;AACvE,oDAAoD;AAEpD,kFAAkF;AAClF,MAAM,MAAM,GAAG,CAAC,CAAC;AAEjB,MAAM,OAAO,eAAe;IAC1B,8EAA8E;IAC7D,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEpD;;;;;OAKG;IACH,IAAI,CAAC,IAAY,EAAE,MAAqB,EAAE,KAAoB;QAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,MAAM,GAAG,GAAG,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,2FAA2F;QAC3F,MAAM,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,IAAI,GACR,MAAM,IAAI,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxF,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IACjF,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swf2es/web",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
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/codegen": "0.1.14",
36
- "@swf2es/player": "0.1.14",
37
- "@swf2es/player-hosts": "0.1.14",
38
- "@swf2es/format": "0.1.14"
35
+ "@swf2es/codegen": "0.1.16",
36
+ "@swf2es/format": "0.1.16",
37
+ "@swf2es/player": "0.1.16",
38
+ "@swf2es/player-hosts": "0.1.16"
39
39
  }
40
40
  }
package/src/air.ts CHANGED
@@ -19,6 +19,7 @@ import {
19
19
  import {
20
20
  AIR_DEFINITIONS,
21
21
  type AirApplication,
22
+ type AirScreen,
22
23
  type AirWindow,
23
24
  type FetchRequest,
24
25
  type FetchResult,
@@ -182,7 +183,8 @@ export class AirApp {
182
183
 
183
184
  /**
184
185
  * NativeApplication's view: the descriptor, `args` as the launch's
185
- * arguments, and `window`, the element playing it. Its exit is `exit`.
186
+ * arguments, `window`, the element playing it, and the page's screen.
187
+ * Its exit is `exit`.
186
188
  */
187
189
  application(
188
190
  window: AirWindow,
@@ -195,6 +197,7 @@ export class AirApp {
195
197
  arguments: args,
196
198
  currentDirectory: DIRECTORIES.application,
197
199
  window,
200
+ screens: pageScreens,
198
201
  exit,
199
202
  };
200
203
  }
@@ -495,3 +498,33 @@ export function elementWindow(element: HTMLElement, title: string | null): AirWi
495
498
  stageOffset: () => ({ x: 0, y: 0 }),
496
499
  };
497
500
  }
501
+
502
+ /**
503
+ * The screen the page is on, the one a page knows of, as Screen reads it:
504
+ * at the corner of its own desktop, as the element's window is placed in
505
+ * the page, and what the system's bars leave of it. A page is told the
506
+ * free part's place among all the screens and not its own screen's, so
507
+ * its corner is held to the room the bars take.
508
+ */
509
+ export function pageScreens(): AirScreen[] {
510
+ const { width, height, availWidth, availHeight, colorDepth } = screen;
511
+ // availLeft and availTop are not in every browser, nor in the standard.
512
+ const { availLeft = 0, availTop = 0 } = screen as Screen & {
513
+ availLeft?: number;
514
+ availTop?: number;
515
+ };
516
+ const within = (at: number, room: number) => Math.min(Math.max(at, 0), Math.max(room, 0));
517
+ return [
518
+ {
519
+ bounds: { x: 0, y: 0, width, height },
520
+ visibleBounds: {
521
+ x: within(availLeft, width - availWidth),
522
+ y: within(availTop, height - availHeight),
523
+ width: availWidth,
524
+ height: availHeight,
525
+ },
526
+ colorDepth,
527
+ main: true,
528
+ },
529
+ ];
530
+ }
package/src/config.ts CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  type ModuleCache,
15
15
  playerglobalLibrary,
16
16
  type SocketHost,
17
+ type WebSocketHost,
17
18
  } from "@swf2es/player";
18
19
  import { indexedDbModuleCache } from "@swf2es/player-hosts/indexeddb";
19
20
  import { webSocketSocketHost } from "@swf2es/player-hosts/websocket";
@@ -27,6 +28,17 @@ export interface SocketProxy {
27
28
  proxyUrl: string;
28
29
  }
29
30
 
31
+ /** An embedder's window that goes full screen: the element in it is to fill it. */
32
+ export interface WindowFullScreen {
33
+ /** Enters or leaves full screen. */
34
+ set(fullScreen: boolean): void;
35
+ /**
36
+ * Tells `listener` each time the window has entered or left, the user's
37
+ * doing or a script's; what it gives stops telling.
38
+ */
39
+ onChange(listener: (fullScreen: boolean) => void): () => void;
40
+ }
41
+
30
42
  export interface Configuration {
31
43
  /**
32
44
  * The ABCs a SWF's ActionScript 3 links against, by URL, each in place
@@ -47,6 +59,11 @@ export interface Configuration {
47
59
  * socketProxy's relays: a desktop app's, which reaches TCP itself.
48
60
  */
49
61
  sockets?: SocketHost;
62
+ /**
63
+ * A host of the embedder's own for air.net.WebSocket, in place of the
64
+ * page's WebSocket: a desktop app's, whose page has no network.
65
+ */
66
+ webSockets?: WebSocketHost;
50
67
  fileHost?: FileHost | null;
51
68
  /**
52
69
  * A fetch of the embedder's own for what the SWFs load, the SWF the
@@ -87,6 +104,13 @@ export interface Configuration {
87
104
  workerUrl?: string | URL;
88
105
  /** The page's build, a short commit or a version, which the context menu's About item names. */
89
106
  build?: string;
107
+ /**
108
+ * A full screen of the embedder's own for Stage.displayState, in place
109
+ * of the Fullscreen API on the element: a desktop app's, whose window
110
+ * covers its screen, asked by any SWF and with no user's gesture, as
111
+ * AIR and Flash's projector allow.
112
+ */
113
+ fullScreen?: WindowFullScreen | null;
90
114
  /**
91
115
  * Play the SWFs the element plays next as an AIR application's, as a
92
116
  * desktop app runs one: AIR's library loaded after playerglobal, its API
package/src/element.ts CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  type FetchRequest,
10
10
  type FetchResult,
11
11
  type FileSystemHost,
12
+ type FullScreenHost,
12
13
  Player,
13
14
  Scripting,
14
15
  type WorkerHost,
@@ -29,6 +30,7 @@ import { externalInterfaceHost, type PageBridge, type PageValue } from "./extern
29
30
  import { scaleMode } from "./layout.js";
30
31
  import { type Look, Playback } from "./playback.js";
31
32
  import type { Stage3DSession } from "./stage3d.js";
33
+ import { UncaughtReports } from "./uncaught.js";
32
34
 
33
35
  export const TAG = "swf2es-player";
34
36
 
@@ -50,6 +52,7 @@ const dom = globalThis.HTMLElement
50
52
  setAttribute: Element.prototype.setAttribute,
51
53
  dispatchEvent: EventTarget.prototype.dispatchEvent,
52
54
  focus: HTMLElement.prototype.focus,
55
+ requestFullscreen: Element.prototype.requestFullscreen,
53
56
  isConnected: Object.getOwnPropertyDescriptor(Node.prototype, "isConnected")?.get,
54
57
  id: Object.getOwnPropertyDescriptor(Element.prototype, "id")?.get,
55
58
  }
@@ -72,6 +75,8 @@ interface Session {
72
75
  stage3D: Stage3DSession | null;
73
76
  /** The ExternalInterface callbacks the SWF put on the element. */
74
77
  callbacks: Set<string>;
78
+ /** The uncaught errors told so far, so that one thrown every frame is not told every frame. */
79
+ uncaught: UncaughtReports;
75
80
  /** Aborts the fetch of the SWF itself, as a destroy comes before it arrives. */
76
81
  abort: AbortController;
77
82
  /** The Web Workers its SWF starts, let go of with it. */
@@ -472,6 +477,7 @@ export class Swf2esPlayerElement extends ElementBase {
472
477
  playback: null,
473
478
  stage3D: null,
474
479
  callbacks: new Set(),
480
+ uncaught: new UncaughtReports(),
475
481
  workers: null,
476
482
  abort: new AbortController(),
477
483
  air: null,
@@ -726,7 +732,7 @@ export class Swf2esPlayerElement extends ElementBase {
726
732
  fileSystem: session.air?.fileSystem ?? configuration().air?.fileSystem,
727
733
  encryptedStore: session.air?.items ?? configuration().air?.encryptedStore,
728
734
  socket: offline ? undefined : socketHost(),
729
- webSocket: offline ? null : undefined,
735
+ webSocket: offline ? null : configuration().webSockets,
730
736
  navigate: internal ? null : undefined,
731
737
  fileHost: configuration().fileHost,
732
738
  sendToUrl: !internal,
@@ -737,6 +743,7 @@ export class Swf2esPlayerElement extends ElementBase {
737
743
  }
738
744
  },
739
745
  onUncaught: (error) => this.#report(session, error),
746
+ fullScreen: this.#fullScreen(session),
740
747
  lazyCompilation: configuration().lazyCompilation,
741
748
  workerHost,
742
749
  ...moduleCacheOptions(),
@@ -744,6 +751,76 @@ export class Swf2esPlayerElement extends ElementBase {
744
751
  return scripting;
745
752
  }
746
753
 
754
+ /**
755
+ * Full screen for a load's Stage.displayState. The embedder's window
756
+ * where it gave one (`configure`'s fullScreen), which any SWF may ask
757
+ * for at any time. Else the Fullscreen API on the element, as Flash
758
+ * Player's plug-in had it: only with `allowfullscreen="true"`, and
759
+ * `allowfullscreeninteractive="true"` for the interactive kind, which an
760
+ * AIR application needs neither of; and only while the user's click or
761
+ * key is handled, which a browser asks too. Either way the player hears
762
+ * of what it did not ask for, as the user's Esc.
763
+ */
764
+ #fullScreen(session: Session): FullScreenHost {
765
+ const told = (fullScreen: boolean) => {
766
+ if (this.#session === session) {
767
+ session.scripting?.fullScreen.hostChanged(fullScreen);
768
+ }
769
+ };
770
+ const { signal } = session.abort;
771
+ // A load that goes while its SWF holds the screen gives it back.
772
+ const leave = (exit: () => void) =>
773
+ signal.addEventListener(
774
+ "abort",
775
+ () => {
776
+ if (session.scripting?.fullScreen.active) {
777
+ exit();
778
+ }
779
+ },
780
+ { once: true },
781
+ );
782
+ const own = configuration().fullScreen;
783
+ if (own) {
784
+ signal.addEventListener("abort", own.onChange(told), { once: true });
785
+ leave(() => own.set(false));
786
+ return {
787
+ allowed: () => true,
788
+ request: () => {
789
+ own.set(true);
790
+ return true;
791
+ },
792
+ exit: () => own.set(false),
793
+ };
794
+ }
795
+
796
+ const exit = () => {
797
+ if (document.fullscreenElement === this) {
798
+ document.exitFullscreen().catch(() => {});
799
+ }
800
+ };
801
+ document.addEventListener("fullscreenchange", () => told(document.fullscreenElement === this), {
802
+ signal,
803
+ });
804
+ leave(exit);
805
+ return {
806
+ allowed: (interactive) =>
807
+ session.air !== null ||
808
+ attribute(this, interactive ? "allowfullscreeninteractive" : "allowfullscreen")
809
+ ?.trim()
810
+ .toLowerCase() === "true",
811
+ request: () => {
812
+ if (!document.fullscreenEnabled || !navigator.userActivation?.isActive) {
813
+ return false;
814
+ }
815
+
816
+ // What the browser turns down after all leaves the stage as it was.
817
+ dom?.requestFullscreen.call(this).catch(() => told(false));
818
+ return true;
819
+ },
820
+ exit,
821
+ };
822
+ }
823
+
747
824
  /** Whether the SWFs the element plays next have workers: its `workers` attribute, else the page's configuration. */
748
825
  #workers(): boolean {
749
826
  switch (attribute(this, "workers")?.trim().toLowerCase()) {
@@ -842,7 +919,15 @@ export class Swf2esPlayerElement extends ElementBase {
842
919
  text = String(error);
843
920
  }
844
921
 
845
- console.error(`swf2es: ${text}`);
922
+ const rt = session.scripting?.rt;
923
+ const line = session.uncaught.line(
924
+ text,
925
+ rt?.detailOf(error as never) ?? null,
926
+ rt?.stackOf(error as never) ?? null,
927
+ );
928
+ if (line !== null) {
929
+ console.error(line);
930
+ }
846
931
  }
847
932
 
848
933
  #look(): Look {
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ export {
15
15
  configuration,
16
16
  configure,
17
17
  type SocketProxy,
18
+ type WindowFullScreen,
18
19
  } from "./config.js";
19
20
  export {
20
21
  defineElement,
package/src/layout.ts CHANGED
@@ -125,3 +125,27 @@ export function viewport(
125
125
  css: { x: 0, y: 0, width: boxWidth, height: boxHeight },
126
126
  };
127
127
  }
128
+
129
+ /**
130
+ * The viewport of a stage in full screen whose fullScreenSourceRect is
131
+ * `rect`, in a box of `boxWidth` by `boxHeight`, the screen: that part of
132
+ * the stage alone, scaled to fit the box whole and centred in it, whatever
133
+ * the stage's scale mode and alignment, as adl draws it; the box's margins
134
+ * are left to the stage's colour.
135
+ */
136
+ export function sourceViewport(
137
+ rect: { x: number; y: number; width: number; height: number },
138
+ boxWidth: number,
139
+ boxHeight: number,
140
+ dpr: number,
141
+ ): Viewport {
142
+ const placed = place(rect.width, rect.height, boxWidth, boxHeight, "showAll", null, dpr);
143
+ return {
144
+ x: rect.x,
145
+ y: rect.y,
146
+ width: rect.width,
147
+ height: rect.height,
148
+ resolution: placed.resolution,
149
+ css: { x: placed.x, y: placed.y, width: placed.width, height: placed.height },
150
+ };
151
+ }
package/src/playback.ts CHANGED
@@ -11,7 +11,14 @@ import {
11
11
  type TextInput,
12
12
  } from "@swf2es/player";
13
13
  import type { RenderView } from "@swf2es/player/scene";
14
- import { place, type ScaleMode, viewport } from "./layout.js";
14
+ import {
15
+ type Placement,
16
+ place,
17
+ type ScaleMode,
18
+ sourceViewport,
19
+ type Viewport,
20
+ viewport,
21
+ } from "./layout.js";
15
22
  import type { Stage3DSession } from "./stage3d.js";
16
23
 
17
24
  /** How the element shows its player, read again as the page changes them. */
@@ -273,10 +280,12 @@ export class Playback {
273
280
  scripting?.setStageDefaults(look.scale, look.salign ?? "");
274
281
  const mode = scripting?.stageScaleMode ?? look.scale;
275
282
  const align = scripting?.stageAlign ?? look.salign;
276
- // Live noScale makes the stage the box's size; every other mode keeps the SWF's.
283
+ // In full screen with a fullScreenSourceRect, that part of the stage alone is shown.
284
+ const rect = scripting?.fullScreen.rect ?? null;
285
+ // Live noScale makes the stage the box's size, or the source rect's; every other mode keeps the SWF's.
277
286
  const noScale = !!scripting && mode === "noScale";
278
- const stageWidth = noScale ? this.box.clientWidth : this.player.width;
279
- const stageHeight = noScale ? this.box.clientHeight : this.player.height;
287
+ const stageWidth = noScale ? (rect?.width ?? this.box.clientWidth) : this.player.width;
288
+ const stageHeight = noScale ? (rect?.height ?? this.box.clientHeight) : this.player.height;
280
289
  this.dpr = devicePixelRatio || 1;
281
290
  const placed = place(
282
291
  this.player.width || 1,
@@ -289,14 +298,16 @@ export class Playback {
289
298
  // AIR's top and left edges win where both are named; checked with Stage3D only.
290
299
  !!this.stage3D,
291
300
  );
292
- const view = viewport(
293
- this.player.width || 1,
294
- this.player.height || 1,
295
- this.box.clientWidth,
296
- this.box.clientHeight,
297
- mode,
298
- placed,
299
- );
301
+ const view = rect
302
+ ? sourceViewport(rect, this.box.clientWidth, this.box.clientHeight, this.dpr)
303
+ : viewport(
304
+ this.player.width || 1,
305
+ this.player.height || 1,
306
+ this.box.clientWidth,
307
+ this.box.clientHeight,
308
+ mode,
309
+ placed,
310
+ );
300
311
  const canvas = this.view.canvas;
301
312
  canvas.style.left = `${view.css.x}px`;
302
313
  canvas.style.top = `${view.css.y}px`;
@@ -329,7 +340,11 @@ export class Playback {
329
340
  }
330
341
 
331
342
  this.view.setViewport(view.x, view.y, screenWidth, screenHeight);
332
- this.stage3D?.layout(placed, this.player.width, this.player.height);
343
+ this.stage3D?.layout(
344
+ rect ? stageAround(rect, view, this.player.width, this.player.height) : placed,
345
+ this.player.width,
346
+ this.player.height,
347
+ );
333
348
  this.dirty = true;
334
349
  // Dispatch only after placement is current: a resize listener may set
335
350
  // another layout or reconfigure its Stage3D back buffer synchronously.
@@ -365,6 +380,23 @@ export class Playback {
365
380
  }
366
381
  }
367
382
 
383
+ /** Where the whole stage lies in the box when `view` shows `rect` of it: Stage3D's layers are placed by the stage. */
384
+ function stageAround(
385
+ rect: { x: number; y: number; width: number },
386
+ view: Viewport,
387
+ stageWidth: number,
388
+ stageHeight: number,
389
+ ): Placement {
390
+ const scale = view.css.width / rect.width;
391
+ return {
392
+ x: view.css.x - rect.x * scale,
393
+ y: view.css.y - rect.y * scale,
394
+ width: stageWidth * scale,
395
+ height: stageHeight * scale,
396
+ resolution: view.resolution,
397
+ };
398
+ }
399
+
368
400
  /** The most a canvas's multisampled buffers may take, colour and depth-stencil together. */
369
401
  const STAGE_BYTES = 256 * 1024 * 1024;
370
402
 
package/src/replace.ts CHANGED
@@ -19,6 +19,8 @@ const CARRIED = [
19
19
  "base",
20
20
  "allowscriptaccess",
21
21
  "allownetworking",
22
+ "allowfullscreen",
23
+ "allowfullscreeninteractive",
22
24
  "quality",
23
25
  "bgcolor",
24
26
  "menu",