@afterswf/embed 0.0.0-stage → 0.1.4
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/LICENSE +21 -0
- package/README.md +142 -2
- package/dist/HISTORY.txt +2190 -0
- package/dist/VERSIONS.txt +16 -0
- package/dist/assets/builtins/avmplus.abc +0 -0
- package/dist/assets/builtins/builtin.abc +0 -0
- package/dist/assets/builtins/playerglobal.abcs +0 -0
- package/dist/assets/builtins/playerglobal.json +2753 -0
- package/dist/assets/fonts.swf +0 -0
- package/dist/assets/progressBg.jpg +0 -0
- package/dist/assets/progressLine.jpg +0 -0
- package/dist/assets/splash.jpg +0 -0
- package/dist/embed.js +2 -0
- package/dist/embed.js.map +1 -0
- package/dist/embed.mjs +2 -0
- package/dist/embed.mjs.map +1 -0
- package/dist/loader.js +2 -0
- package/dist/loader.js.map +1 -0
- package/dist/runtime.js +37 -0
- package/dist/runtime.js.map +1 -0
- package/dist/version.mjs +1 -0
- package/package.json +91 -3
- package/types/index.d.ts +145 -0
- package/types/version.d.ts +5 -0
package/dist/version.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = '0.1.4';
|
package/package.json
CHANGED
|
@@ -1,6 +1,94 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@afterswf/embed",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "AfterSWF: plays Flash content in the browser as a drop-in replacement for SWFObject, based on AwayFL",
|
|
5
|
+
"main": "dist/embed.js",
|
|
6
|
+
"module": "dist/embed.mjs",
|
|
7
|
+
"types": "types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
|
+
"import": "./dist/embed.mjs",
|
|
12
|
+
"default": "./dist/embed.js"
|
|
13
|
+
},
|
|
14
|
+
"./version": {
|
|
15
|
+
"types": "./types/version.d.ts",
|
|
16
|
+
"default": "./dist/version.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./dist/*": "./dist/*",
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"types"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"clean": "rimraf --glob ./dist/*",
|
|
27
|
+
"static": "copyfiles -u 1 './static/**/*' ./dist/assets/",
|
|
28
|
+
"prebuild": "npm run clean && npm run static",
|
|
29
|
+
"build": "rollup -c --bundleConfigAsCjs",
|
|
30
|
+
"version": " npm run build"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"Flash",
|
|
34
|
+
"SWF",
|
|
35
|
+
"SWFObject",
|
|
36
|
+
"AwayFL",
|
|
37
|
+
"AfterSWF"
|
|
38
|
+
],
|
|
39
|
+
"author": "eXponenta",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"homepage": "https://github.com/afterswf/embed#readme",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/afterswf/embed.git"
|
|
45
|
+
},
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/afterswf/embed/issues"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@awayfl/avm1": "file:../avm1",
|
|
54
|
+
"@awayfl/avm2": "file:../avm2",
|
|
55
|
+
"@awayfl/awayfl-player": "^0.2.40",
|
|
56
|
+
"@awayfl/playerglobal": "file:../playerglobal",
|
|
57
|
+
"@awayfl/swf-loader": "^0.4.121",
|
|
58
|
+
"@awayjs/core": "^0.9.44",
|
|
59
|
+
"@awayjs/graphics": "file:../graphics",
|
|
60
|
+
"@awayjs/materials": "^0.6.16",
|
|
61
|
+
"@awayjs/renderer": "file:../renderer",
|
|
62
|
+
"@awayjs/scene": "file:../scene",
|
|
63
|
+
"@awayjs/stage": "^0.11.138",
|
|
64
|
+
"@awayjs/view": "^0.6.61",
|
|
65
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
66
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
67
|
+
"@rollup/plugin-replace": "^5.0.5",
|
|
68
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
69
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
70
|
+
"@types/wicg-file-system-access": "^2023.10.7",
|
|
71
|
+
"copyfiles": "^2.4.1",
|
|
72
|
+
"random-seed": "^0.3.0",
|
|
73
|
+
"rimraf": "^5.0.5",
|
|
74
|
+
"rollup": "4.6.1",
|
|
75
|
+
"rollup-plugin-string": "^3.0.0",
|
|
76
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
77
|
+
"tslib": "^2.6.2",
|
|
78
|
+
"typescript": "5.3.3"
|
|
79
|
+
},
|
|
80
|
+
"lastUsedTags": {
|
|
81
|
+
"@awayfl/avm1": "v0.2.181",
|
|
82
|
+
"@awayfl/avm2": "v0.2.241",
|
|
83
|
+
"@awayfl/awayfl-player": "v0.1.4",
|
|
84
|
+
"@awayfl/playerglobal": "v0.2.460",
|
|
85
|
+
"@awayfl/swf-loader": "v0.1.4",
|
|
86
|
+
"@awayjs/core": "v0.1.4",
|
|
87
|
+
"@awayjs/graphics": "v0.5.101",
|
|
88
|
+
"@awayjs/materials": "v0.1.4",
|
|
89
|
+
"@awayjs/renderer": "v0.11.99",
|
|
90
|
+
"@awayjs/scene": "v0.13.325",
|
|
91
|
+
"@awayjs/stage": "v0.1.4",
|
|
92
|
+
"@awayjs/view": "v0.1.4"
|
|
93
|
+
}
|
|
6
94
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AfterSWF embed: a SWFObject-compatible API that embeds AwayFL players
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface IBindingConfig {
|
|
6
|
+
/** Where the player's loader.js, runtime.js and assets/ are (defaults to embed's own folder) */
|
|
7
|
+
runtimeBaseUrl?: string;
|
|
8
|
+
src?: string;
|
|
9
|
+
width?: string | number;
|
|
10
|
+
height?: string | number;
|
|
11
|
+
/** Name of a global function to call when the SWF has loaded */
|
|
12
|
+
onLoad?: string;
|
|
13
|
+
/** Name of a global function to call with loading progress */
|
|
14
|
+
onProgress?: string;
|
|
15
|
+
/** Name of a global function to call if loading fails */
|
|
16
|
+
onError?: string;
|
|
17
|
+
/** Flash `scale`: showAll (default), noScale, exactFit or noBorder */
|
|
18
|
+
scaleMode?: string;
|
|
19
|
+
/** Flash `salign`: T, B, L, R, TL, TR, BL or BR */
|
|
20
|
+
stageAlign?: string;
|
|
21
|
+
autoplay?: boolean;
|
|
22
|
+
/** Background colour of the player and its loading screen */
|
|
23
|
+
backgroundColor?: string;
|
|
24
|
+
/** Flash `bgcolor`: overrides the SWF's background colour, e.g. #ffffff */
|
|
25
|
+
bgcolor?: string;
|
|
26
|
+
/** Flash `flashvars`: a query string (a=1&b=2) or an object */
|
|
27
|
+
flashvars?: string | Record<string, any>;
|
|
28
|
+
/** URL of the loading screen's image, or false or '' for none */
|
|
29
|
+
splash?: string | boolean;
|
|
30
|
+
progress?: boolean | {
|
|
31
|
+
back: string;
|
|
32
|
+
rect: [number, number, number, number];
|
|
33
|
+
line: string;
|
|
34
|
+
direction?: 'lr' | 'tb';
|
|
35
|
+
};
|
|
36
|
+
/** Limits stage scale to improve performance, e.g. 0.5 for half resolution */
|
|
37
|
+
maxStageScale?: number;
|
|
38
|
+
/** Hide the player until the SWF has loaded */
|
|
39
|
+
hideBeforeLoad?: boolean;
|
|
40
|
+
/** Smooth bitmaps by default (Flash Player defaults to pixelated scaling) */
|
|
41
|
+
smoothBitmaps?: boolean;
|
|
42
|
+
/** Enable blend modes (experimental) */
|
|
43
|
+
enableBlends?: boolean;
|
|
44
|
+
/** Enable filters such as blur and glow (experimental) */
|
|
45
|
+
enableFilters?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface IEmbedConfig extends IBindingConfig {
|
|
49
|
+
/** Replace Flash <object> and <embed> markup with players (default true) */
|
|
50
|
+
autoUpgrade?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Sets options for players, the same as defining `window.AWAY_EMBED_CFG`
|
|
55
|
+
*/
|
|
56
|
+
export function configure(config: IEmbedConfig): void;
|
|
57
|
+
|
|
58
|
+
/** The version of @afterswf/embed */
|
|
59
|
+
export const VERSION: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The `<awayfl-player>` element. Functions a SWF adds with
|
|
63
|
+
* `ExternalInterface.addCallback()` become methods of it.
|
|
64
|
+
*/
|
|
65
|
+
export declare class AwayPlayerComponent extends HTMLElement {
|
|
66
|
+
readonly player: any;
|
|
67
|
+
config: IBindingConfig;
|
|
68
|
+
src: string;
|
|
69
|
+
width: string | number;
|
|
70
|
+
height: string | number;
|
|
71
|
+
runtimeBaseUrl: string;
|
|
72
|
+
[callback: string]: any;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SWFObjectCallbackEvent {
|
|
76
|
+
success: boolean;
|
|
77
|
+
id: string;
|
|
78
|
+
ref?: AwayPlayerComponent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type SWFObjectCallback = (event: SWFObjectCallbackEvent) => void;
|
|
82
|
+
|
|
83
|
+
export interface SWFObjectAPI {
|
|
84
|
+
ua: { w3: boolean; pv: number[]; wk: number | false; ie: boolean; win: boolean; mac: boolean };
|
|
85
|
+
embedSWF(
|
|
86
|
+
swfUrl: string,
|
|
87
|
+
replaceElemId: string | HTMLElement,
|
|
88
|
+
width: string | number,
|
|
89
|
+
height: string | number,
|
|
90
|
+
swfVersion?: string,
|
|
91
|
+
xiSwfUrl?: string | null,
|
|
92
|
+
flashvars?: Record<string, any> | null,
|
|
93
|
+
params?: Record<string, any> | null,
|
|
94
|
+
attributes?: Record<string, any> | null,
|
|
95
|
+
callback?: SWFObjectCallback
|
|
96
|
+
): void;
|
|
97
|
+
registerObject(objectId: string, swfVersion: string, xiSwfUrl?: string, callback?: SWFObjectCallback): void;
|
|
98
|
+
createSWF(attributes: Record<string, any>, params: Record<string, any>, replaceElemId: string): AwayPlayerComponent | undefined;
|
|
99
|
+
removeSWF(objectId: string): void;
|
|
100
|
+
getObjectById(objectId: string): AwayPlayerComponent | null;
|
|
101
|
+
/** Reports Flash Player 32.0.0 */
|
|
102
|
+
getFlashPlayerVersion(): { major: number; minor: number; release: number };
|
|
103
|
+
hasFlashPlayerVersion(version: string): boolean;
|
|
104
|
+
showExpressInstall(attributes: any, params: any, replaceElemId: string, callback?: SWFObjectCallback): void;
|
|
105
|
+
createCSS(selector: string, declaration: string, media?: string, newStyle?: boolean): void;
|
|
106
|
+
addDomLoadEvent(fn: () => void): void;
|
|
107
|
+
addLoadEvent(fn: () => void): void;
|
|
108
|
+
getQueryParamValue(param?: string): string;
|
|
109
|
+
switchOffAutoHideShow(): void;
|
|
110
|
+
enableUriEncoding(enable?: boolean): void;
|
|
111
|
+
expressInstallCallback(): void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** SWFObject 2.x */
|
|
115
|
+
export const swfobject: SWFObjectAPI;
|
|
116
|
+
export const swfObject: SWFObjectAPI;
|
|
117
|
+
|
|
118
|
+
/** SWFObject 1.5 */
|
|
119
|
+
export declare class SWFObject {
|
|
120
|
+
constructor(swf: string, id: string, width: string | number, height: string | number,
|
|
121
|
+
version?: string, bgcolor?: string, quality?: string);
|
|
122
|
+
setAttribute(name: string, value: string): void;
|
|
123
|
+
getAttribute(name: string): string;
|
|
124
|
+
addParam(name: string, value: string): void;
|
|
125
|
+
getParams(): Record<string, string>;
|
|
126
|
+
addVariable(name: string, value: string): void;
|
|
127
|
+
getVariable(name: string): string;
|
|
128
|
+
getVariables(): Record<string, string>;
|
|
129
|
+
getVariablePairs(): string[];
|
|
130
|
+
useExpressInstall(path: string): void;
|
|
131
|
+
write(elementId: string | HTMLElement): boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
declare global {
|
|
135
|
+
interface Window {
|
|
136
|
+
swfobject: SWFObjectAPI;
|
|
137
|
+
swfObject: SWFObjectAPI;
|
|
138
|
+
SWFObject: typeof SWFObject;
|
|
139
|
+
AWAY_EMBED_CFG?: IEmbedConfig;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
interface HTMLElementTagNameMap {
|
|
143
|
+
'awayfl-player': AwayPlayerComponent;
|
|
144
|
+
}
|
|
145
|
+
}
|