@shotstack/shotstack-studio 2.30.1 → 2.31.1
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/index.d.ts +2 -0
- package/dist/internal.es.js +41 -34
- package/dist/internal.umd.js +2 -2
- package/dist/shotstack-studio.es.js +7005 -6985
- package/dist/shotstack-studio.umd.js +158 -158
- package/package.json +4 -4
- package/readme.md +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -150,8 +150,10 @@ export declare class Controls {
|
|
|
150
150
|
private seekDistanceLarge;
|
|
151
151
|
private frameTime;
|
|
152
152
|
private pendingPaste;
|
|
153
|
+
private disposed;
|
|
153
154
|
constructor(edit: Edit);
|
|
154
155
|
load(): Promise<void>;
|
|
156
|
+
dispose(): void;
|
|
155
157
|
private shouldIgnoreKeyboardEvent;
|
|
156
158
|
private handleKeyDown;
|
|
157
159
|
private handlePaste;
|
package/dist/internal.es.js
CHANGED
|
@@ -1174,10 +1174,11 @@ class nr extends e5 {
|
|
|
1174
1174
|
return this.edit.playbackTime >= this.getStart() && this.edit.playbackTime < this.getEnd();
|
|
1175
1175
|
}
|
|
1176
1176
|
/**
|
|
1177
|
-
* Project this player's current frame into the Pixi scene for a one-off static capture.
|
|
1177
|
+
* Project this player's current frame into the Pixi scene for a one-off static capture. `strict` rejects when the
|
|
1178
|
+
* frame can't be drawn, where a snapshot would leave the clip out.
|
|
1178
1179
|
* @internal
|
|
1179
1180
|
*/
|
|
1180
|
-
async prepareStaticRender() {
|
|
1181
|
+
async prepareStaticRender(e) {
|
|
1181
1182
|
}
|
|
1182
1183
|
/** @internal Undo any transient scene mutation made by prepareStaticRender(). Default: no-op. */
|
|
1183
1184
|
endStaticRender() {
|
|
@@ -39214,22 +39215,28 @@ ${e.stack}` : e), this.recordLoadError(e), this.emitCaptureFailed(e, "static-pla
|
|
|
39214
39215
|
* Project the current playhead's frame into the Pixi scene for an off-playback capture.
|
|
39215
39216
|
* @internal
|
|
39216
39217
|
*/
|
|
39217
|
-
async prepareStaticRender() {
|
|
39218
|
+
async prepareStaticRender({ strict: e = !1 } = {}) {
|
|
39218
39219
|
try {
|
|
39219
|
-
if (this.disposed || !this.iframe || this.mode === "failed") return;
|
|
39220
|
-
const e = this.getPlaybackTime(), r = this.capturedFrames && this.capturedHash === `${this.contentHash}@1` ? this.capturedFrames : null, n = r ? await this.getDecodedFrame(Math.min(Math.max(0, Math.floor(e * this.captureFps)), r.length - 1)) : await this.renderStill(e);
|
|
39221
39220
|
if (this.disposed) return;
|
|
39222
|
-
if (!
|
|
39221
|
+
if (!this.iframe || this.mode === "failed") {
|
|
39222
|
+
if (e) throw new Error("The HTML5 clip didn't load");
|
|
39223
|
+
return;
|
|
39224
|
+
}
|
|
39225
|
+
const r = this.getPlaybackTime(), n = this.capturedFrames && this.capturedHash === `${this.contentHash}@1` ? this.capturedFrames : null, i = n ? await this.getDecodedFrame(Math.min(Math.max(0, Math.floor(r * this.captureFps)), n.length - 1)) : await this.renderStill(r);
|
|
39226
|
+
if (this.disposed) return;
|
|
39227
|
+
if (!i) {
|
|
39228
|
+
if (e) throw new Error("The HTML5 clip's frame couldn't be drawn");
|
|
39223
39229
|
this.hideForCapture();
|
|
39224
39230
|
return;
|
|
39225
39231
|
}
|
|
39226
|
-
if (
|
|
39227
|
-
this.playbackSprite.texture =
|
|
39232
|
+
if (n && this.playbackSprite) {
|
|
39233
|
+
this.playbackSprite.texture = i;
|
|
39228
39234
|
return;
|
|
39229
39235
|
}
|
|
39230
|
-
this.stillTexture?.destroy(!0), this.stillTexture =
|
|
39231
|
-
} catch (
|
|
39232
|
-
this.hideForCapture(),
|
|
39236
|
+
this.stillTexture?.destroy(!0), this.stillTexture = n ? null : i, this.hideForCapture(), this.staticSprite ? this.staticSprite.texture = i : (this.staticSprite = new et.Sprite(i), this.contentContainer.addChildAt(this.staticSprite, 0), this.clipConfiguration.width && this.clipConfiguration.height && this.applyFixedDimensions());
|
|
39237
|
+
} catch (r) {
|
|
39238
|
+
if (this.hideForCapture(), e) throw r;
|
|
39239
|
+
console.warn("[Html5Player] prepareStaticRender failed:", r);
|
|
39233
39240
|
}
|
|
39234
39241
|
}
|
|
39235
39242
|
// The ticker draws while a still renders, so these hide only once it's ready or has failed. A transparent still
|
|
@@ -42111,10 +42118,10 @@ class Js extends nr {
|
|
|
42111
42118
|
super.dispose(), this.loadComplete = !1, this.texture && this.texture.destroy(), this.texture = null, this.sprite && (this.sprite.destroy(), this.sprite = null), this.cleanupResources();
|
|
42112
42119
|
}
|
|
42113
42120
|
getSize() {
|
|
42114
|
-
const e = this.edit.
|
|
42121
|
+
const e = this.edit.getDocument()?.getOutput().size;
|
|
42115
42122
|
return {
|
|
42116
|
-
width: this.clipConfiguration.width || e?.
|
|
42117
|
-
height: this.clipConfiguration.height || e?.
|
|
42123
|
+
width: this.clipConfiguration.width || e?.width || this.edit.size.width,
|
|
42124
|
+
height: this.clipConfiguration.height || e?.height || this.edit.size.height
|
|
42118
42125
|
};
|
|
42119
42126
|
}
|
|
42120
42127
|
getContentSize() {
|
|
@@ -42282,14 +42289,14 @@ class Vr extends nr {
|
|
|
42282
42289
|
const { baseFontFamily: n } = Fr(e), i = this.edit.getFontUrlByFamilyAndWeight(n, r);
|
|
42283
42290
|
if (i)
|
|
42284
42291
|
return { url: i, baseFontFamily: n, fontWeight: r };
|
|
42285
|
-
const
|
|
42286
|
-
const { full:
|
|
42287
|
-
return
|
|
42292
|
+
const s = this.edit.getTimelineFonts().find((u) => {
|
|
42293
|
+
const { full: l, base: c } = Pl(u.src), h = e.toLowerCase();
|
|
42294
|
+
return l.toLowerCase() === h || c.toLowerCase() === h;
|
|
42288
42295
|
});
|
|
42289
|
-
if (
|
|
42290
|
-
return { url:
|
|
42291
|
-
const
|
|
42292
|
-
return
|
|
42296
|
+
if (s)
|
|
42297
|
+
return { url: s.src, baseFontFamily: n, fontWeight: r };
|
|
42298
|
+
const o = as(e, r);
|
|
42299
|
+
return o ? { url: o, baseFontFamily: n, fontWeight: r } : null;
|
|
42293
42300
|
}
|
|
42294
42301
|
reconfigureAfterRestore() {
|
|
42295
42302
|
super.reconfigureAfterRestore(), this.reconfigure(this.clipConfiguration.asset);
|
|
@@ -42352,35 +42359,35 @@ class Vr extends nr {
|
|
|
42352
42359
|
}
|
|
42353
42360
|
}
|
|
42354
42361
|
createFallbackText(e) {
|
|
42355
|
-
const
|
|
42362
|
+
const { width: r, height: n } = this.getSize(), i = new et.TextStyle({
|
|
42356
42363
|
fontFamily: e.font?.family || "Arial",
|
|
42357
42364
|
fontSize: e.font?.size || 48,
|
|
42358
42365
|
fill: e.font?.color || "#ffffff",
|
|
42359
42366
|
align: e.align?.horizontal || "center",
|
|
42360
42367
|
wordWrap: !0,
|
|
42361
|
-
wordWrapWidth:
|
|
42362
|
-
}),
|
|
42368
|
+
wordWrapWidth: r
|
|
42369
|
+
}), a = new et.Text(e.text, i);
|
|
42363
42370
|
switch (e.align?.horizontal) {
|
|
42364
42371
|
case "left":
|
|
42365
|
-
|
|
42372
|
+
a.anchor.set(0, 0.5), a.x = 0;
|
|
42366
42373
|
break;
|
|
42367
42374
|
case "right":
|
|
42368
|
-
|
|
42375
|
+
a.anchor.set(1, 0.5), a.x = r;
|
|
42369
42376
|
break;
|
|
42370
42377
|
default:
|
|
42371
|
-
|
|
42378
|
+
a.anchor.set(0.5, 0.5), a.x = r / 2;
|
|
42372
42379
|
}
|
|
42373
42380
|
switch (e.align?.vertical) {
|
|
42374
42381
|
case "top":
|
|
42375
|
-
|
|
42382
|
+
a.anchor.set(a.anchor.x, 0), a.y = 0;
|
|
42376
42383
|
break;
|
|
42377
42384
|
case "bottom":
|
|
42378
|
-
|
|
42385
|
+
a.anchor.set(a.anchor.x, 1), a.y = n;
|
|
42379
42386
|
break;
|
|
42380
42387
|
default:
|
|
42381
|
-
|
|
42388
|
+
a.anchor.set(a.anchor.x, 0.5), a.y = n / 2;
|
|
42382
42389
|
}
|
|
42383
|
-
this.contentContainer.addChild(
|
|
42390
|
+
this.contentContainer.addChild(a), this.configureKeyframes();
|
|
42384
42391
|
}
|
|
42385
42392
|
renderFrameSafe(e) {
|
|
42386
42393
|
if (this.isRendering) {
|
|
@@ -42421,10 +42428,10 @@ class Vr extends nr {
|
|
|
42421
42428
|
super.dispose(), this.loadComplete = !1, this.texture?.destroy(), this.texture = null, this.sprite && (this.sprite.destroy(), this.sprite = null), this.canvas && (this.canvas = null), this.textEngine && (this.textEngine.destroy(), this.textEngine = null), this.renderer = null, this.validatedAsset = null;
|
|
42422
42429
|
}
|
|
42423
42430
|
getSize() {
|
|
42424
|
-
const e = this.edit.
|
|
42431
|
+
const e = this.edit.getDocument()?.getOutput().size;
|
|
42425
42432
|
return {
|
|
42426
|
-
width: this.clipConfiguration.width || e?.
|
|
42427
|
-
height: this.clipConfiguration.height || e?.
|
|
42433
|
+
width: this.clipConfiguration.width || e?.width || this.edit.size.width,
|
|
42434
|
+
height: this.clipConfiguration.height || e?.height || this.edit.size.height
|
|
42428
42435
|
};
|
|
42429
42436
|
}
|
|
42430
42437
|
getContentSize() {
|