saltfish 0.3.29 → 0.3.31
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/managers/ABTestManager.d.ts +3 -8
- package/dist/managers/ABTestManager.d.ts.map +1 -1
- package/dist/managers/AnalyticsManager.d.ts +3 -8
- package/dist/managers/AnalyticsManager.d.ts.map +1 -1
- package/dist/managers/EventSubscriberManager.d.ts +40 -0
- package/dist/managers/EventSubscriberManager.d.ts.map +1 -0
- package/dist/managers/PlaylistManager.d.ts +3 -8
- package/dist/managers/PlaylistManager.d.ts.map +1 -1
- package/dist/managers/UIManager.d.ts +5 -0
- package/dist/managers/UIManager.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 +57 -85
- package/dist/saltfish-playlist-player.umd.js +1 -1
- package/package.json +1 -1
|
@@ -8206,21 +8206,13 @@ class InteractionManager {
|
|
|
8206
8206
|
this.container = null;
|
|
8207
8207
|
}
|
|
8208
8208
|
}
|
|
8209
|
-
class
|
|
8210
|
-
// Default to enabled
|
|
8209
|
+
class EventSubscriberManager {
|
|
8211
8210
|
/**
|
|
8212
|
-
* Creates a new
|
|
8211
|
+
* Creates a new event-subscribing manager instance
|
|
8213
8212
|
* @param eventManager - Optional event manager to subscribe to events
|
|
8214
8213
|
*/
|
|
8215
8214
|
constructor(eventManager) {
|
|
8216
|
-
__publicField(this, "config", null);
|
|
8217
|
-
__publicField(this, "user", null);
|
|
8218
|
-
__publicField(this, "eventQueue", []);
|
|
8219
|
-
__publicField(this, "isSending", false);
|
|
8220
|
-
__publicField(this, "flushInterval", null);
|
|
8221
8215
|
__publicField(this, "eventManager", null);
|
|
8222
|
-
__publicField(this, "sessionId", null);
|
|
8223
|
-
__publicField(this, "analyticsEnabled", true);
|
|
8224
8216
|
if (eventManager) {
|
|
8225
8217
|
this.setEventManager(eventManager);
|
|
8226
8218
|
}
|
|
@@ -8233,6 +8225,23 @@ class AnalyticsManager {
|
|
|
8233
8225
|
this.eventManager = eventManager;
|
|
8234
8226
|
this.subscribeToEvents();
|
|
8235
8227
|
}
|
|
8228
|
+
}
|
|
8229
|
+
class AnalyticsManager extends EventSubscriberManager {
|
|
8230
|
+
// Default to enabled
|
|
8231
|
+
/**
|
|
8232
|
+
* Creates a new AnalyticsManager
|
|
8233
|
+
* @param eventManager - Optional event manager to subscribe to events
|
|
8234
|
+
*/
|
|
8235
|
+
constructor(eventManager) {
|
|
8236
|
+
super(eventManager);
|
|
8237
|
+
__publicField(this, "config", null);
|
|
8238
|
+
__publicField(this, "user", null);
|
|
8239
|
+
__publicField(this, "eventQueue", []);
|
|
8240
|
+
__publicField(this, "isSending", false);
|
|
8241
|
+
__publicField(this, "flushInterval", null);
|
|
8242
|
+
__publicField(this, "sessionId", null);
|
|
8243
|
+
__publicField(this, "analyticsEnabled", true);
|
|
8244
|
+
}
|
|
8236
8245
|
/**
|
|
8237
8246
|
* Subscribe to relevant player events for analytics tracking
|
|
8238
8247
|
*/
|
|
@@ -9792,24 +9801,13 @@ class TriggerManager {
|
|
|
9792
9801
|
this.visibleElements.clear();
|
|
9793
9802
|
}
|
|
9794
9803
|
}
|
|
9795
|
-
class ABTestManager {
|
|
9804
|
+
class ABTestManager extends EventSubscriberManager {
|
|
9796
9805
|
/**
|
|
9797
9806
|
* Creates a new ABTestManager
|
|
9798
9807
|
* @param eventManager - Optional event manager to subscribe to events
|
|
9799
9808
|
*/
|
|
9800
9809
|
constructor(eventManager) {
|
|
9801
|
-
|
|
9802
|
-
if (eventManager) {
|
|
9803
|
-
this.setEventManager(eventManager);
|
|
9804
|
-
}
|
|
9805
|
-
}
|
|
9806
|
-
/**
|
|
9807
|
-
* Sets the event manager and subscribes to relevant events
|
|
9808
|
-
* @param eventManager - Event manager instance
|
|
9809
|
-
*/
|
|
9810
|
-
setEventManager(eventManager) {
|
|
9811
|
-
this.eventManager = eventManager;
|
|
9812
|
-
this.subscribeToEvents();
|
|
9810
|
+
super(eventManager);
|
|
9813
9811
|
}
|
|
9814
9812
|
/**
|
|
9815
9813
|
* Subscribe to relevant events for A/B testing
|
|
@@ -10189,30 +10187,19 @@ class PlaylistLoader {
|
|
|
10189
10187
|
return startStepId;
|
|
10190
10188
|
}
|
|
10191
10189
|
}
|
|
10192
|
-
class PlaylistManager {
|
|
10190
|
+
class PlaylistManager extends EventSubscriberManager {
|
|
10193
10191
|
/**
|
|
10194
10192
|
* Creates a new PlaylistManager
|
|
10195
10193
|
* @param eventManager - Optional event manager to subscribe to events
|
|
10196
10194
|
* @param storageManager - Optional storage manager for localStorage operations
|
|
10197
10195
|
*/
|
|
10198
10196
|
constructor(eventManager, storageManager2) {
|
|
10199
|
-
|
|
10197
|
+
super(eventManager);
|
|
10200
10198
|
__publicField(this, "isUpdatingWatchedPlaylists", false);
|
|
10201
10199
|
__publicField(this, "playlistLoader");
|
|
10202
10200
|
__publicField(this, "storageManager");
|
|
10203
10201
|
this.playlistLoader = new PlaylistLoader();
|
|
10204
10202
|
this.storageManager = storageManager2 || StorageManager.getInstance();
|
|
10205
|
-
if (eventManager) {
|
|
10206
|
-
this.setEventManager(eventManager);
|
|
10207
|
-
}
|
|
10208
|
-
}
|
|
10209
|
-
/**
|
|
10210
|
-
* Sets the event manager and subscribes to relevant events
|
|
10211
|
-
* @param eventManager - Event manager instance
|
|
10212
|
-
*/
|
|
10213
|
-
setEventManager(eventManager) {
|
|
10214
|
-
this.eventManager = eventManager;
|
|
10215
|
-
this.subscribeToEvents();
|
|
10216
10203
|
}
|
|
10217
10204
|
/**
|
|
10218
10205
|
* Subscribe to relevant player events for playlist tracking
|
|
@@ -11062,6 +11049,37 @@ class UIManager {
|
|
|
11062
11049
|
}
|
|
11063
11050
|
}
|
|
11064
11051
|
}
|
|
11052
|
+
/**
|
|
11053
|
+
* Handles autoplay fallback and idle mode interaction by unmuting and resetting video
|
|
11054
|
+
* @param source - The UI element that triggered the interaction (for logging)
|
|
11055
|
+
*/
|
|
11056
|
+
handleAutoplayFallbackInteraction(source) {
|
|
11057
|
+
var _a;
|
|
11058
|
+
const store = getSaltfishStore();
|
|
11059
|
+
if (store.currentState !== "autoplayBlocked" && store.currentState !== "idleMode") {
|
|
11060
|
+
if (this.videoManager) {
|
|
11061
|
+
this.videoManager.markUserInteraction();
|
|
11062
|
+
}
|
|
11063
|
+
return;
|
|
11064
|
+
}
|
|
11065
|
+
store.currentState === "autoplayBlocked" ? "autoplay fallback" : "idle";
|
|
11066
|
+
if (this.videoManager) {
|
|
11067
|
+
this.videoManager.markUserInteraction();
|
|
11068
|
+
this.videoManager.setMuted(false);
|
|
11069
|
+
const videoElement = this.videoManager.getVideoElement();
|
|
11070
|
+
if (videoElement) {
|
|
11071
|
+
videoElement.loop = false;
|
|
11072
|
+
videoElement.currentTime = 0;
|
|
11073
|
+
}
|
|
11074
|
+
} else {
|
|
11075
|
+
const videoElement = (_a = this.playerElement) == null ? void 0 : _a.querySelector(".sf-video-container__video");
|
|
11076
|
+
if (videoElement) {
|
|
11077
|
+
videoElement.muted = false;
|
|
11078
|
+
videoElement.loop = false;
|
|
11079
|
+
videoElement.currentTime = 0;
|
|
11080
|
+
}
|
|
11081
|
+
}
|
|
11082
|
+
}
|
|
11065
11083
|
/**
|
|
11066
11084
|
* Creates the center play button with proper click handler
|
|
11067
11085
|
*/
|
|
@@ -11084,33 +11102,10 @@ class UIManager {
|
|
|
11084
11102
|
`;
|
|
11085
11103
|
this.playerElement.appendChild(this.centerPlayButton);
|
|
11086
11104
|
this.centerPlayButton.addEventListener("click", (e) => {
|
|
11087
|
-
var _a;
|
|
11088
11105
|
e.stopPropagation();
|
|
11089
11106
|
e.preventDefault();
|
|
11090
11107
|
const store = getSaltfishStore();
|
|
11091
|
-
|
|
11092
|
-
store.currentState === "autoplayBlocked" ? "autoplay fallback" : "idle";
|
|
11093
|
-
if (this.videoManager) {
|
|
11094
|
-
this.videoManager.markUserInteraction();
|
|
11095
|
-
this.videoManager.setMuted(false);
|
|
11096
|
-
const videoElement = this.videoManager.getVideoElement();
|
|
11097
|
-
if (videoElement) {
|
|
11098
|
-
videoElement.loop = false;
|
|
11099
|
-
videoElement.currentTime = 0;
|
|
11100
|
-
}
|
|
11101
|
-
} else {
|
|
11102
|
-
const videoElement = (_a = this.playerElement) == null ? void 0 : _a.querySelector(".sf-video-container__video");
|
|
11103
|
-
if (videoElement) {
|
|
11104
|
-
videoElement.muted = false;
|
|
11105
|
-
videoElement.loop = false;
|
|
11106
|
-
videoElement.currentTime = 0;
|
|
11107
|
-
}
|
|
11108
|
-
}
|
|
11109
|
-
} else {
|
|
11110
|
-
if (this.videoManager) {
|
|
11111
|
-
this.videoManager.markUserInteraction();
|
|
11112
|
-
}
|
|
11113
|
-
}
|
|
11108
|
+
this.handleAutoplayFallbackInteraction("center play button");
|
|
11114
11109
|
if (store.currentState === "paused" || store.currentState === "waitingForInteraction" || store.currentState === "completedWaitingForInteraction" || store.currentState === "autoplayBlocked" || store.currentState === "idleMode" || store.currentState === "error") {
|
|
11115
11110
|
store.play();
|
|
11116
11111
|
} else if (store.currentState === "playing") {
|
|
@@ -11143,33 +11138,10 @@ class UIManager {
|
|
|
11143
11138
|
this.compactLabel.style.cursor = "pointer";
|
|
11144
11139
|
this.compactLabel.style.pointerEvents = "auto";
|
|
11145
11140
|
this.compactLabel.addEventListener("click", (e) => {
|
|
11146
|
-
var _a2;
|
|
11147
11141
|
e.stopPropagation();
|
|
11148
11142
|
e.preventDefault();
|
|
11149
11143
|
const currentStore = getSaltfishStore();
|
|
11150
|
-
|
|
11151
|
-
currentStore.currentState === "autoplayBlocked" ? "autoplay fallback" : "idle";
|
|
11152
|
-
if (this.videoManager) {
|
|
11153
|
-
this.videoManager.markUserInteraction();
|
|
11154
|
-
this.videoManager.setMuted(false);
|
|
11155
|
-
const videoElement = this.videoManager.getVideoElement();
|
|
11156
|
-
if (videoElement) {
|
|
11157
|
-
videoElement.loop = false;
|
|
11158
|
-
videoElement.currentTime = 0;
|
|
11159
|
-
}
|
|
11160
|
-
} else {
|
|
11161
|
-
const videoElement = (_a2 = this.playerElement) == null ? void 0 : _a2.querySelector(".sf-video-container__video");
|
|
11162
|
-
if (videoElement) {
|
|
11163
|
-
videoElement.muted = false;
|
|
11164
|
-
videoElement.loop = false;
|
|
11165
|
-
videoElement.currentTime = 0;
|
|
11166
|
-
}
|
|
11167
|
-
}
|
|
11168
|
-
} else {
|
|
11169
|
-
if (this.videoManager) {
|
|
11170
|
-
this.videoManager.markUserInteraction();
|
|
11171
|
-
}
|
|
11172
|
-
}
|
|
11144
|
+
this.handleAutoplayFallbackInteraction("compact label");
|
|
11173
11145
|
if (currentStore.currentState === "paused" || currentStore.currentState === "waitingForInteraction" || currentStore.currentState === "completedWaitingForInteraction" || currentStore.currentState === "autoplayBlocked" || currentStore.currentState === "idleMode" || currentStore.currentState === "error") {
|
|
11174
11146
|
currentStore.play();
|
|
11175
11147
|
}
|
|
@@ -11612,7 +11584,7 @@ const SaltfishPlayer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
11612
11584
|
__proto__: null,
|
|
11613
11585
|
SaltfishPlayer
|
|
11614
11586
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11615
|
-
const version = "0.3.
|
|
11587
|
+
const version = "0.3.31";
|
|
11616
11588
|
const packageJson = {
|
|
11617
11589
|
version
|
|
11618
11590
|
};
|