saltfish 0.2.22 → 0.2.25
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/core/services/ManagerOrchestrator.d.ts.map +1 -1
- package/dist/managers/TranscriptManager.d.ts.map +1 -1
- package/dist/managers/TriggerManager.d.ts +5 -0
- package/dist/managers/TriggerManager.d.ts.map +1 -1
- package/dist/player.js +2 -2
- package/dist/player.min.js +2 -2
- package/dist/saltfish-playlist-player.es.js +18 -2
- package/dist/saltfish-playlist-player.umd.js +1 -1
- package/package.json +1 -1
|
@@ -2066,7 +2066,7 @@ class PlayerInitializationService {
|
|
|
2066
2066
|
return false;
|
|
2067
2067
|
}
|
|
2068
2068
|
const currentTime = Date.now();
|
|
2069
|
-
const MAX_AGE_MS =
|
|
2069
|
+
const MAX_AGE_MS = 4e3;
|
|
2070
2070
|
const inProgressEntry = Object.entries(watchedPlaylists).find(([playlistId, status]) => {
|
|
2071
2071
|
if ((status == null ? void 0 : status.status) !== "in_progress") {
|
|
2072
2072
|
return false;
|
|
@@ -3530,6 +3530,7 @@ const _ManagerOrchestrator = class _ManagerOrchestrator {
|
|
|
3530
3530
|
}
|
|
3531
3531
|
if (this.managers.videoManager) {
|
|
3532
3532
|
this.managers.videoManager.pause();
|
|
3533
|
+
this.managers.videoManager.reset();
|
|
3533
3534
|
}
|
|
3534
3535
|
if (this.managers.cursorManager) {
|
|
3535
3536
|
this.managers.cursorManager.stopAnimation();
|
|
@@ -4245,6 +4246,8 @@ const _TranscriptManager = class _TranscriptManager {
|
|
|
4245
4246
|
this.hideTranscript();
|
|
4246
4247
|
}
|
|
4247
4248
|
this.updateCCButtonState(false);
|
|
4249
|
+
this.transcriptContainer = null;
|
|
4250
|
+
this.transcriptContent = null;
|
|
4248
4251
|
}
|
|
4249
4252
|
/**
|
|
4250
4253
|
* Reset user caption preference (called when player is destroyed)
|
|
@@ -8401,6 +8404,16 @@ class TriggerManager {
|
|
|
8401
8404
|
const hasWatched = watchedPlaylists && watchedPlaylists[playlistId];
|
|
8402
8405
|
return !hasWatched;
|
|
8403
8406
|
}
|
|
8407
|
+
/**
|
|
8408
|
+
* Normalizes a URL by removing trailing slash (unless it's the root path)
|
|
8409
|
+
* @param url - The URL to normalize
|
|
8410
|
+
*/
|
|
8411
|
+
normalizeUrl(url) {
|
|
8412
|
+
if (url.endsWith("/") && url.lastIndexOf("/") > url.indexOf("://") + 2) {
|
|
8413
|
+
return url.slice(0, -1);
|
|
8414
|
+
}
|
|
8415
|
+
return url;
|
|
8416
|
+
}
|
|
8404
8417
|
/**
|
|
8405
8418
|
* Evaluates the URL condition for a playlist
|
|
8406
8419
|
* @param triggers - The trigger configuration containing URL pattern and match type
|
|
@@ -8410,7 +8423,7 @@ class TriggerManager {
|
|
|
8410
8423
|
if (!pattern) {
|
|
8411
8424
|
return true;
|
|
8412
8425
|
}
|
|
8413
|
-
const currentUrl = window.location.href.split("#")[0];
|
|
8426
|
+
const currentUrl = this.normalizeUrl(window.location.href.split("#")[0]);
|
|
8414
8427
|
const currentPath = window.location.pathname;
|
|
8415
8428
|
if (triggers.urlMatchType === "regex") {
|
|
8416
8429
|
try {
|
|
@@ -8427,6 +8440,9 @@ class TriggerManager {
|
|
|
8427
8440
|
pattern = "*" + pattern + "*";
|
|
8428
8441
|
}
|
|
8429
8442
|
const hasWildcards = pattern.includes("*");
|
|
8443
|
+
if (!hasWildcards && (!triggers.urlMatchType || triggers.urlMatchType === "exact" || triggers.urlMatchType === "contains")) {
|
|
8444
|
+
pattern = this.normalizeUrl(pattern);
|
|
8445
|
+
}
|
|
8430
8446
|
const escapedPattern = pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8431
8447
|
let regexPattern = escapedPattern.replace(/\\\*/g, ".*");
|
|
8432
8448
|
if (!hasWildcards) {
|