@algorisys/tinyfly 0.64.0 → 0.65.0
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/README.md +59 -11
- package/lib/browser/tinyfly.iife.js +2 -2
- package/lib/browser/tinyfly.js +18 -4
- package/lib/browser/tinyfly.umd.js +2 -2
- package/lib/cli/tools.js +20 -3
- package/lib/embed/tinyfly-embed.iife.js +6 -3
- package/lib/embed/tinyfly-embed.js +437 -408
- package/lib/engine/tinyfly-engine.js +69 -55
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/player/tinyfly-player.es.js +86 -72
- package/lib/player/tinyfly-player.iife.js +2 -2
- package/lib/player/tinyfly-player.umd.js +2 -2
- package/lib/types/embed/controls.d.ts +5 -0
- package/lib/types/embed/mount.d.ts +2 -1
- package/lib/types/engine/core/timeline.d.ts +7 -2
- package/lib/types/player/player.d.ts +2 -1
- package/package.json +1 -1
package/lib/browser/tinyfly.js
CHANGED
|
@@ -1075,8 +1075,7 @@ function Ws(i, t, e = 0) {
|
|
|
1075
1075
|
class yi {
|
|
1076
1076
|
id;
|
|
1077
1077
|
name;
|
|
1078
|
-
|
|
1079
|
-
captions;
|
|
1078
|
+
_captions;
|
|
1080
1079
|
_tracks = [];
|
|
1081
1080
|
_trackPlayers = /* @__PURE__ */ new Map();
|
|
1082
1081
|
_motionPathTracks = /* @__PURE__ */ new Map();
|
|
@@ -1098,7 +1097,7 @@ class yi {
|
|
|
1098
1097
|
onUpdate = null;
|
|
1099
1098
|
onComplete = null;
|
|
1100
1099
|
constructor(t) {
|
|
1101
|
-
if (this.id = t.id, this.name = t.name, this.
|
|
1100
|
+
if (this.id = t.id, this.name = t.name, this._captions = t.captions, this._config = t.config ?? {}, this._explicitDuration = t.config?.duration, t.tracks)
|
|
1102
1101
|
for (const e of t.tracks)
|
|
1103
1102
|
this.addTrack(e);
|
|
1104
1103
|
}
|
|
@@ -1445,6 +1444,21 @@ class yi {
|
|
|
1445
1444
|
get markers() {
|
|
1446
1445
|
return [...this._config.markers ?? []].sort((t, e) => t.time - e.time);
|
|
1447
1446
|
}
|
|
1447
|
+
/** Replace the markers (kept in time order); an empty list removes them. */
|
|
1448
|
+
setMarkers(t) {
|
|
1449
|
+
const e = t && t.length > 0 ? [...t].sort((n, r) => n.time - r.time).map((n) => ({ ...n })) : void 0, s = { ...this._config };
|
|
1450
|
+
e ? s.markers = e : delete s.markers, this._config = s;
|
|
1451
|
+
}
|
|
1452
|
+
/** Caption text per language, per marker id */
|
|
1453
|
+
get captions() {
|
|
1454
|
+
return this._captions;
|
|
1455
|
+
}
|
|
1456
|
+
/** Replace the captions; languages with no captions are dropped. */
|
|
1457
|
+
setCaptions(t) {
|
|
1458
|
+
const e = {};
|
|
1459
|
+
for (const [s, n] of Object.entries(t ?? {})) e[s] = { ...n };
|
|
1460
|
+
this._captions = Object.keys(e).length > 0 ? e : void 0;
|
|
1461
|
+
}
|
|
1448
1462
|
/** Start the between-iterations pause, if the timeline configures one. */
|
|
1449
1463
|
_armRepeatDelay() {
|
|
1450
1464
|
this._repeatDelayRemaining = this._config.repeatDelay ?? 0;
|
|
@@ -1614,7 +1628,7 @@ function Hs(i) {
|
|
|
1614
1628
|
...t && { markers: t.map((e) => ({ ...e })) }
|
|
1615
1629
|
},
|
|
1616
1630
|
tracks: i.tracks.map(Us),
|
|
1617
|
-
...i.captions && { captions: i.captions }
|
|
1631
|
+
...i.captions && { captions: JSON.parse(JSON.stringify(i.captions)) }
|
|
1618
1632
|
};
|
|
1619
1633
|
}
|
|
1620
1634
|
function pt(i) {
|