@vvfx/sdk 0.2.8 → 0.2.9
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.js +231 -0
- package/dist/exporter/config.js +18 -0
- package/dist/exporter/const.js +71 -0
- package/dist/exporter/export-media.js +878 -0
- package/dist/exporter/exporter.js +121 -0
- package/dist/exporter/index.js +1 -0
- package/dist/exporter/types.js +1 -0
- package/dist/exporter/utils.js +190 -0
- package/dist/exporter/wav-audio.js +50 -0
- package/dist/gesture-handler/gizmo/adsorption-gizmo.js +227 -0
- package/dist/gesture-handler/gizmo/control-gizmo.js +149 -0
- package/dist/gesture-handler/gizmo/gizmo.js +17 -0
- package/dist/gesture-handler/gizmo/icon-gizmo.js +189 -0
- package/dist/gesture-handler/gizmo/index.js +6 -0
- package/dist/gesture-handler/gizmo/item-create-gizmo.js +256 -0
- package/dist/gesture-handler/gizmo/loading-gizmo.js +320 -0
- package/dist/gesture-handler/gizmo/mask-gizmo.js +648 -0
- package/dist/gesture-handler/gizmo/picture-cut-gizmo.js +550 -0
- package/dist/gesture-handler/gizmo/picture-expand-gizmo.js +491 -0
- package/dist/gesture-handler/gizmo/preference-gizmo.js +148 -0
- package/dist/gesture-handler/gizmo/selector-gizmo.d.ts +1 -1
- package/dist/gesture-handler/gizmo/selector-gizmo.js +468 -0
- package/dist/gesture-handler/gizmo/sprite-text-edit-gizmo.js +247 -0
- package/dist/gesture-handler/gizmo/text-gizmo.js +1033 -0
- package/dist/gesture-handler/gizmo/transform-gizmo.js +1199 -0
- package/dist/gesture-handler/gizmo/type.js +18 -0
- package/dist/gesture-handler/index.js +3 -0
- package/dist/gesture-handler/src/gesture-handler.js +770 -0
- package/dist/gesture-handler/src/icons.js +24 -0
- package/dist/gesture-handler/utils.js +40 -0
- package/dist/html-overlay/anchor-navigation-runtime.js +27 -0
- package/dist/html-overlay/auto-height-runtime.js +132 -0
- package/dist/html-overlay/document-runtime.js +71 -0
- package/dist/html-overlay/document-transform.js +96 -0
- package/dist/html-overlay/dom-order.js +8 -0
- package/dist/html-overlay/host-message-runtime.js +24 -0
- package/dist/html-overlay/html-capture-runtime.js +282 -0
- package/dist/html-overlay/html-viewport-style.js +10 -0
- package/dist/html-overlay/index.js +1 -0
- package/dist/html-overlay/manager.js +1663 -0
- package/dist/html-overlay/mime-utils.js +21 -0
- package/dist/html-overlay/overlay-transform.js +57 -0
- package/dist/html-overlay/path-utils.js +35 -0
- package/dist/html-overlay/shell-runtime.js +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -75311
- package/dist/index.mjs +75311 -0
- package/dist/{index.js.map → index.mjs.map} +1 -1
- package/dist/layer-order.js +8 -0
- package/dist/math/box2.js +396 -0
- package/dist/math/circle.js +131 -0
- package/dist/math/euler.js +35 -0
- package/dist/math/index.js +13 -0
- package/dist/math/line2.js +153 -0
- package/dist/math/line3.js +36 -0
- package/dist/math/matrix4.js +207 -0
- package/dist/math/plane.js +52 -0
- package/dist/math/quaternion.js +3 -0
- package/dist/math/ray-caster.js +25 -0
- package/dist/math/ray.js +47 -0
- package/dist/math/type.js +1 -0
- package/dist/math/utils.js +77 -0
- package/dist/math/vector2.js +70 -0
- package/dist/math/vector3.js +60 -0
- package/dist/screen-shot/index.js +1 -0
- package/dist/screen-shot/screen-shot.js +113 -0
- package/dist/sdk-item/base-item.js +160 -0
- package/dist/sdk-item/card-item.js +131 -0
- package/dist/sdk-item/effects-item.js +144 -0
- package/dist/sdk-item/frame-item.js +217 -0
- package/dist/sdk-item/generator-item.js +188 -0
- package/dist/sdk-item/group-item.js +116 -0
- package/dist/sdk-item/index.js +39 -0
- package/dist/sdk-item/sprite-item.js +147 -0
- package/dist/sdk-item/text-item.js +223 -0
- package/dist/sdk-item/types.d.ts +1 -1
- package/dist/sdk-item/types.js +15 -0
- package/dist/sdk-item/video-item.js +174 -0
- package/dist/sdk.js +1903 -0
- package/dist/service/UndoRedo.js +79 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +2 -0
- package/dist/shared/player.d.ts +1 -1
- package/dist/shared/player.js +9 -0
- package/dist/shared/spec.d.ts +1 -0
- package/dist/shared/spec.js +1 -0
- package/dist/size-adapte/index.js +1 -0
- package/dist/size-adapte/size-adapt.js +395 -0
- package/dist/types.d.ts +5 -1
- package/dist/types.js +17 -0
- package/dist/utils/background-manager.js +189 -0
- package/dist/utils/common-utils.js +183 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/interaction-utils.js +205 -0
- package/dist/utils/json-data-utils.js +1529 -0
- package/dist/utils/layout-utils.js +1217 -0
- package/dist/utils/page-data-utils.js +5397 -0
- package/dist/utils/player-data-utils.js +48 -0
- package/dist/utils/types.js +8 -0
- package/dist/wireframe/common/box.js +18 -0
- package/dist/wireframe/common/dashed-line.js +21 -0
- package/dist/wireframe/common/line.js +17 -0
- package/dist/wireframe/common/pixi-ext.js +1 -0
- package/dist/wireframe/common/pixi.js +31 -0
- package/dist/wireframe/index.js +4 -0
- package/package.json +10 -3
package/dist/config.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
export const BaseConfig = {
|
|
2
|
+
mode: 'template',
|
|
3
|
+
pageConfig: {
|
|
4
|
+
asncMode: false,
|
|
5
|
+
minZoom: 0.01,
|
|
6
|
+
maxZoom: 20,
|
|
7
|
+
staticPreview: true,
|
|
8
|
+
staticPreviewName: '标准模板',
|
|
9
|
+
filterItemNames: ['ModelPluginItem', 'LoadingVFXItem'],
|
|
10
|
+
groupVisible: true,
|
|
11
|
+
autoLayoutDefaultGap: 20,
|
|
12
|
+
autoLayoutDefaultMode: 'ordered',
|
|
13
|
+
},
|
|
14
|
+
asyncLoadConfig: {
|
|
15
|
+
enabled: true,
|
|
16
|
+
loadingTextureUrl: 'https://mdn.alipayobjects.com/huamei_ixsp8m/afts/img/A*BzgbTb8dBhoAAAAARwAAAAgAev-aAQ/original',
|
|
17
|
+
},
|
|
18
|
+
screenShotConfig: {
|
|
19
|
+
enabled: true,
|
|
20
|
+
defaultBackgroundColor: [255, 255, 255, 0]
|
|
21
|
+
},
|
|
22
|
+
exportConfig: {
|
|
23
|
+
enabled: true,
|
|
24
|
+
mediaType: 'MP4',
|
|
25
|
+
loggerInTranscoding: false,
|
|
26
|
+
},
|
|
27
|
+
sizeAdaptConfig: {
|
|
28
|
+
enabled: true,
|
|
29
|
+
},
|
|
30
|
+
gestureHandlerConfig: {
|
|
31
|
+
enabled: true,
|
|
32
|
+
adsorptionGizmoEnabled: true,
|
|
33
|
+
adsorptionGizmoConfig: {
|
|
34
|
+
lineWidth: 0.8,
|
|
35
|
+
lineColor: 0x0BD6FF,
|
|
36
|
+
distance: 6,
|
|
37
|
+
},
|
|
38
|
+
controlGizmoEnabled: true,
|
|
39
|
+
controlGizmoConfig: {
|
|
40
|
+
zoomStep: 0.01,
|
|
41
|
+
},
|
|
42
|
+
preferenceGizmoEnabled: true,
|
|
43
|
+
preferenceGizmoConfig: {
|
|
44
|
+
boxColor: 0xFF0000,
|
|
45
|
+
boxWidth: 1,
|
|
46
|
+
markColor: 0x000000,
|
|
47
|
+
markAlpha: 0.17,
|
|
48
|
+
safeAreaEnabled: true,
|
|
49
|
+
safeAreaBoxColor: 0x00FF00,
|
|
50
|
+
safeAreaBoxAlpha: 0.3,
|
|
51
|
+
},
|
|
52
|
+
selectorGizmoEnabled: true,
|
|
53
|
+
selectorGizmoConfig: {
|
|
54
|
+
videoPreSelectedPlay: true,
|
|
55
|
+
preSelectedWidth: 3,
|
|
56
|
+
preSelectedColor: 0xEB5E00,
|
|
57
|
+
regionBoxColor: 0xFFFFFF,
|
|
58
|
+
regionBoxAlpha: 0.17,
|
|
59
|
+
regionWireframeColor: 0xFFFFFF,
|
|
60
|
+
regionWireframeAlpha: 0.78,
|
|
61
|
+
regionWireframeWidth: 1,
|
|
62
|
+
},
|
|
63
|
+
transformGizmoEnabled: true,
|
|
64
|
+
transformGizmoConfig: {
|
|
65
|
+
wireframeColor: 0xFF0000,
|
|
66
|
+
wireframeAlpha: 1,
|
|
67
|
+
wireframeWidth: 1.5,
|
|
68
|
+
cornerFillColor: 0xFFFFFF,
|
|
69
|
+
cornerLineColor: 0x000000,
|
|
70
|
+
cornerLineWidth: 1,
|
|
71
|
+
cornerLineAlpha: 0.3,
|
|
72
|
+
scaleCircleSize: 4,
|
|
73
|
+
rotationCircleSize: 8,
|
|
74
|
+
pictureLogoUrl: 'https://mdn.alipayobjects.com/huamei_ixsp8m/afts/img/A*F2wVS7x0MfIAAAAAQBAAAAgAev-aAQ/original',
|
|
75
|
+
groupLogoUrl: 'https://mdn.alipayobjects.com/huamei_ppzin5/afts/img/Yo69Sr7boqYAAAAAH3AAAAgADjdkAQFr/original',
|
|
76
|
+
textLogoUrl: 'https://mdn.alipayobjects.com/huamei_ppzin5/afts/img/Yo69Sr7boqYAAAAAH3AAAAgADjdkAQFr/original',
|
|
77
|
+
videoLogoUrl: 'https://mdn.alipayobjects.com/huamei_ixsp8m/afts/img/A*w1fnS4mq0VgAAAAAQCAAAAgAev-aAQ/original',
|
|
78
|
+
frameLogoUrl: 'https://mdn.alipayobjects.com/huamei_ixsp8m/afts/img/A*DRF_RpndkjUAAAAAQDAAAAgAev-aAQ/original',
|
|
79
|
+
effectsLogoUrl: 'https://mdn.alipayobjects.com/huamei_ixsp8m/afts/img/A*RMewR4ruUnYAAAAAQGAAAAgAev-aAQ/original',
|
|
80
|
+
sizeTextColor: 0x666666,
|
|
81
|
+
nameTextColor: 0x666666,
|
|
82
|
+
infoShowEnabled: true,
|
|
83
|
+
},
|
|
84
|
+
pictureCutGizmoEnabled: false,
|
|
85
|
+
pictureCutGizmoConfig: {
|
|
86
|
+
maskColor: 0xFFFFFF,
|
|
87
|
+
maskAlpha: 0.5,
|
|
88
|
+
cutBoxLineWidth: 2,
|
|
89
|
+
cutBoxLineColor: 0x6A34FF,
|
|
90
|
+
cutBoxLineAlpha: 1,
|
|
91
|
+
itemBoxLineWidth: 1,
|
|
92
|
+
itemBoxLineColor: 0x6A34FF,
|
|
93
|
+
itemBoxLineAlpha: 1,
|
|
94
|
+
cutBoxCornerRadius: 5,
|
|
95
|
+
cutBoxCornerLineWidth: 2,
|
|
96
|
+
cutBoxCornerLineColor: 0x6A34FF,
|
|
97
|
+
cutBoxCornerLineAlpha: 1,
|
|
98
|
+
cutBoxCornerFillColor: 0xFFFFFF,
|
|
99
|
+
scaleInteractionDistance: 8,
|
|
100
|
+
directionScaleInteractionDistance: 5,
|
|
101
|
+
gridLineWidth: 1,
|
|
102
|
+
gridLineColor: 0xFFFFFF,
|
|
103
|
+
gridLineAlpha: 1,
|
|
104
|
+
gridCount: 2,
|
|
105
|
+
},
|
|
106
|
+
pictureExpandGizmoEnabled: false,
|
|
107
|
+
pictureExpandGizmoConfig: {
|
|
108
|
+
maskColor: 0x6a34ff,
|
|
109
|
+
maskAlpha: 0.2,
|
|
110
|
+
expandBoxLineWidth: 2,
|
|
111
|
+
expandBoxLineColor: 0x6A34FF,
|
|
112
|
+
expandBoxLineAlpha: 1,
|
|
113
|
+
expandBoxCornerRadius: 5,
|
|
114
|
+
expandBoxCornerLineWidth: 2,
|
|
115
|
+
expandBoxCornerLineColor: 0x6A34FF,
|
|
116
|
+
expandBoxCornerLineAlpha: 1,
|
|
117
|
+
expandBoxCornerFillColor: 0xFFFFFF,
|
|
118
|
+
scaleInteractionDistance: 8,
|
|
119
|
+
directionScaleInteractionDistance: 5,
|
|
120
|
+
gridLineWidth: 1,
|
|
121
|
+
gridLineColor: 0xFFFFFF,
|
|
122
|
+
gridLineAlpha: 1,
|
|
123
|
+
gridCount: 2,
|
|
124
|
+
},
|
|
125
|
+
textGizmoEnbaled: true,
|
|
126
|
+
textGizmoConfig: {
|
|
127
|
+
rotateInteractMode: 'corner',
|
|
128
|
+
boxLineWidth: 2,
|
|
129
|
+
boxLineColor: 0x6B35FF,
|
|
130
|
+
rotationCornerWidth: 30,
|
|
131
|
+
rotationCornerTexture: 'https://mdn.alipayobjects.com/huamei_ppzin5/afts/img/Zc9ZSqNEjnQAAAAAQBAAAAgADjdkAQFr/original',
|
|
132
|
+
rotationTopCenterInteractionDistance: 14,
|
|
133
|
+
rotationCornerRadius: 5,
|
|
134
|
+
rotationCornerFillColor: 0xFFFFFF,
|
|
135
|
+
rotationCornerStrokeWidth: 2,
|
|
136
|
+
rotationCornerStrokeColor: 0x6B35FF,
|
|
137
|
+
rotationCornerInteractionDistance: 14,
|
|
138
|
+
scaleCornerRadius: 5,
|
|
139
|
+
scaleCornerFillColor: 0xFFFFFF,
|
|
140
|
+
scaleCornerStrokeWidth: 2,
|
|
141
|
+
scaleCornerStrokeColor: 0x6B35FF,
|
|
142
|
+
scaleInteractionDistance: 7,
|
|
143
|
+
widthScaleInteractionDistance: 4,
|
|
144
|
+
wireframeColor: 0xFF0000,
|
|
145
|
+
wireframeAlpha: 1,
|
|
146
|
+
wireframeWidth: 1.5,
|
|
147
|
+
},
|
|
148
|
+
maskGizmoEnabled: false,
|
|
149
|
+
maskGizmoConfig: {
|
|
150
|
+
brushSize: 20,
|
|
151
|
+
brushColor: 0x6a34ff,
|
|
152
|
+
brushAlpha: 0.5,
|
|
153
|
+
maskColor: 0x00ff00,
|
|
154
|
+
maskBackgroundColor: 0xffffff,
|
|
155
|
+
maskAlpha: 1,
|
|
156
|
+
boxLineWidth: 1,
|
|
157
|
+
boxLineColor: 0x6A34FF,
|
|
158
|
+
boxLineAlpha: 1,
|
|
159
|
+
},
|
|
160
|
+
spriteTextEditGizmoEnabled: false,
|
|
161
|
+
spriteTextEditGizmoConfig: {
|
|
162
|
+
textColor: 0xFFFFFF,
|
|
163
|
+
preSelectedTextColor: 0xFFFFFF,
|
|
164
|
+
boxLineWidth: 3,
|
|
165
|
+
dashLineDash: 8,
|
|
166
|
+
dashLineGap: 8,
|
|
167
|
+
editBoxAlpha: 0.15,
|
|
168
|
+
editBoxColor: 0x3B82F6,
|
|
169
|
+
editBoxLineAlpha: 1,
|
|
170
|
+
editBoxLineColor: 0x3B82F6,
|
|
171
|
+
editBoxPreSelectedAlpha: 0.25,
|
|
172
|
+
editBoxPreSelectedColor: 0x3B82F6,
|
|
173
|
+
editBoxLinePreSelectedAlpha: 1,
|
|
174
|
+
editBoxLinePreSelectedColor: 0x3B82F6,
|
|
175
|
+
hasChangedEditBoxAlpha: 0.2,
|
|
176
|
+
hasChangedEditBoxColor: 0x22C55E,
|
|
177
|
+
hasChangedEditBoxLineAlpha: 1,
|
|
178
|
+
hasChangedEditBoxLineColor: 0x22C55E,
|
|
179
|
+
hasChangedEditBoxPreSelectedAlpha: 0.3,
|
|
180
|
+
hasChangedEditBoxPreSelectedColor: 0x22C55E,
|
|
181
|
+
hasChangedEditBoxLinePreSelectedAlpha: 1,
|
|
182
|
+
hasChangedEditBoxLinePreSelectedColor: 0x22C55E,
|
|
183
|
+
editBoxSelectedAlpha: 0.6,
|
|
184
|
+
editBoxSelectedColor: 0xFFFF00,
|
|
185
|
+
},
|
|
186
|
+
iconGizmoEnabled: true,
|
|
187
|
+
iconGizmoConfig: {
|
|
188
|
+
autoShow: true,
|
|
189
|
+
videoPlayUrl: 'https://mdn.alipayobjects.com/huamei_ixsp8m/afts/img/A*ORMmSYYHIHUAAAAAJbAAAAgAev-aAQ/original',
|
|
190
|
+
videoPlayShift: [20, 20],
|
|
191
|
+
videoPlayWidth: 20,
|
|
192
|
+
videoPlayHeight: 20,
|
|
193
|
+
imageGeneratorUrl: 'https://mdn.alipayobjects.com/huamei_ixsp8m/afts/img/A*bYB-TIEWLBkAAAAAQGAAAAgAev-aAQ/original',
|
|
194
|
+
videoGeneratorUrl: 'https://mdn.alipayobjects.com/huamei_ixsp8m/afts/img/A*6cTFT44CuKEAAAAAQCAAAAgAev-aAQ/original',
|
|
195
|
+
generatorWidth: 200,
|
|
196
|
+
generatorHeight: 200,
|
|
197
|
+
},
|
|
198
|
+
itemCreateGizmoEnabled: false,
|
|
199
|
+
itemCreateGizmoConfig: {
|
|
200
|
+
frameBorderColor: 0x2178FF,
|
|
201
|
+
frameBorderWidth: 1,
|
|
202
|
+
frameBorderAlpha: 0.8,
|
|
203
|
+
frameFillColor: 0x2178FF,
|
|
204
|
+
frameFillAlpha: 0.15,
|
|
205
|
+
frameChildBoxAlpha: 0.35,
|
|
206
|
+
frameChildBoxColor: 0x2178FF,
|
|
207
|
+
},
|
|
208
|
+
autoLayoutIndicatorConfig: {
|
|
209
|
+
lineWidth: 2,
|
|
210
|
+
lineColor: 0x3b82f6,
|
|
211
|
+
},
|
|
212
|
+
loadingGizmoConfig: {}
|
|
213
|
+
},
|
|
214
|
+
itemConfig: {
|
|
215
|
+
frameConfig: {
|
|
216
|
+
layoutGap: 20,
|
|
217
|
+
layoutPadding: 100,
|
|
218
|
+
defaultWidth: 1024,
|
|
219
|
+
defaultHeight: 1024,
|
|
220
|
+
autoLayoutBackgroundColor: [0.7, 0.7, 0.7, 1],
|
|
221
|
+
freeLayoutBackgroundColor: [1, 1, 1, 1],
|
|
222
|
+
},
|
|
223
|
+
generatorConfig: {
|
|
224
|
+
backgroundColor: [0.41568, 0.2039, 1, 0.08],
|
|
225
|
+
},
|
|
226
|
+
cardConfig: {
|
|
227
|
+
backgroundColor: [1, 1, 1, 0],
|
|
228
|
+
cardTypes: [],
|
|
229
|
+
},
|
|
230
|
+
}
|
|
231
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const HELPER_CONFIG = {
|
|
2
|
+
WEBP: {
|
|
3
|
+
SCRIPT: 'https://gw.alipayobjects.com/os/gltf-asset/99531561844014/img2webp.js',
|
|
4
|
+
WASM: 'https://mdn.alipayobjects.com/mars/uri/file/as/0.0.4/wasm/img2webp/img2webp.wasm',
|
|
5
|
+
},
|
|
6
|
+
FFMPEG: {
|
|
7
|
+
CLASSWORKER: 'https://mdn.alipayobjects.com/rms/uri/file/as/ffmpeg/core/0.12.10/dist/worker.js',
|
|
8
|
+
DEFAULT: {
|
|
9
|
+
CORE: 'https://gw.alipayobjects.com/os/lib/ffmpeg/core/0.12.10/dist/esm/ffmpeg-core.js',
|
|
10
|
+
WASM: 'https://gw.alipayobjects.com/os/lib/ffmpeg/core/0.12.10/dist/esm/ffmpeg-core.wasm'
|
|
11
|
+
},
|
|
12
|
+
MT: {
|
|
13
|
+
CORE: 'https://gw.alipayobjects.com/os/lib/ffmpeg/core-mt/0.12.10/dist/esm/ffmpeg-core.js',
|
|
14
|
+
WASM: 'https://gw.alipayobjects.com/os/lib/ffmpeg/core-mt/0.12.10/dist/esm/ffmpeg-core.wasm',
|
|
15
|
+
WORKER: 'https://gw.alipayobjects.com/os/lib/ffmpeg/core-mt/0.12.10/dist/esm/ffmpeg-core.worker.js',
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export const STATUS_MAP = {
|
|
2
|
+
READY: 'ready',
|
|
3
|
+
EXECUTABLE: 'executable',
|
|
4
|
+
DISPOSE: 'dispose'
|
|
5
|
+
};
|
|
6
|
+
export const MEDIA_TYPE = {
|
|
7
|
+
APNG: 'APNG',
|
|
8
|
+
MP4: 'MP4',
|
|
9
|
+
WebM: 'WebM',
|
|
10
|
+
Images: 'Images',
|
|
11
|
+
WebP: 'WebP',
|
|
12
|
+
GIF: 'GIF',
|
|
13
|
+
AlphaMaskVideo: 'AlphaMaskVideo',
|
|
14
|
+
};
|
|
15
|
+
export const STAGE_MAP = {
|
|
16
|
+
IDLE: 'idle',
|
|
17
|
+
CONVERT_IMAGE: 'convertImage',
|
|
18
|
+
TRANSCODING: 'transcoding',
|
|
19
|
+
AUDIO: 'audio'
|
|
20
|
+
};
|
|
21
|
+
export const EXPORT_NEED_TRANS_IMAGES_MAP = {
|
|
22
|
+
JPEG: 'jpeg',
|
|
23
|
+
WEBP: 'webp',
|
|
24
|
+
PNG: 'png'
|
|
25
|
+
};
|
|
26
|
+
export const FORMAT_BUFFER_DOWNLOAD_SUFFIX = {
|
|
27
|
+
[MEDIA_TYPE.MP4]: 'mp4',
|
|
28
|
+
[MEDIA_TYPE.WebP]: 'webp',
|
|
29
|
+
[MEDIA_TYPE.APNG]: 'apng',
|
|
30
|
+
[MEDIA_TYPE.GIF]: 'gif',
|
|
31
|
+
[MEDIA_TYPE.AlphaMaskVideo]: 'mp4',
|
|
32
|
+
[MEDIA_TYPE.Images]: 'zip'
|
|
33
|
+
};
|
|
34
|
+
export const FORMAT_BUFFER_DOWNLOAD_MIMETYPE = {
|
|
35
|
+
[MEDIA_TYPE.MP4]: 'video/mp4',
|
|
36
|
+
[MEDIA_TYPE.WebP]: 'video/webp',
|
|
37
|
+
[MEDIA_TYPE.APNG]: 'image/png',
|
|
38
|
+
[MEDIA_TYPE.GIF]: 'video/gif',
|
|
39
|
+
[MEDIA_TYPE.AlphaMaskVideo]: 'video/mp4',
|
|
40
|
+
[MEDIA_TYPE.Images]: 'application/zip'
|
|
41
|
+
};
|
|
42
|
+
export const EXPORT_STATUS_MAP = {
|
|
43
|
+
DEFAULT: 'default',
|
|
44
|
+
EXPORTING: 'exporting',
|
|
45
|
+
SUCCESS: 'success',
|
|
46
|
+
ERROR: 'error',
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* GIF 压缩参数
|
|
50
|
+
* 核心通过参数 flags + palettegen + paletteuse 实现
|
|
51
|
+
* highest: lanczos + max_colors=256 + dither=bayer
|
|
52
|
+
* high: bicubic + max_colors=200 + dither=bayer
|
|
53
|
+
* medium: bilinear + max_colors=64 + dither=bayer
|
|
54
|
+
* low: neighbor + max_colors=32 + dither=none
|
|
55
|
+
*/
|
|
56
|
+
export const GIF_QUALITY_TO_FFMPEG_ARGS = {
|
|
57
|
+
highest: 'flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=256[p];[s1][p]paletteuse',
|
|
58
|
+
high: 'flags=bicubic,split[s0][s1];[s0]palettegen=max_colors=200[p];[s1][p]paletteuse',
|
|
59
|
+
medium: 'flags=bilinear,split[s0][s1];[s0]palettegen=max_colors=64[p];[s1][p]paletteuse=dither=bayer',
|
|
60
|
+
low: 'flags=neighbor,split[s0][s1];[s0]palettegen=max_colors=32[p];[s1][p]paletteuse=dither=none'
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* APNG 压缩参数
|
|
64
|
+
* 核心通过参数 compression_level 实现,压缩等级分为 1/3/6/9
|
|
65
|
+
*/
|
|
66
|
+
export const APNG_QUALITY_TO_FFMPEG_ARGS = {
|
|
67
|
+
highest: '1',
|
|
68
|
+
high: '3',
|
|
69
|
+
medium: '6',
|
|
70
|
+
low: '9'
|
|
71
|
+
};
|