eyevinn-channel-engine 4.2.5 → 4.2.7
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/engine/server.js +2 -2
- package/dist/engine/session.js +1 -1
- package/dist/engine/session_state.js +15 -10
- package/dist/package.json +1 -1
- package/engine/server.ts +2 -2
- package/engine/session.js +1 -1
- package/engine/session_state.js +4 -2
- package/package.json +1 -1
package/dist/engine/server.js
CHANGED
|
@@ -255,8 +255,8 @@ var ChannelEngine = /** @class */ (function () {
|
|
|
255
255
|
this.server.get('/health', this._handleAggregatedSessionHealth.bind(this));
|
|
256
256
|
this.server.get('/health/:sessionId', this._handleSessionHealth.bind(this));
|
|
257
257
|
this.server.get('/reset', this._handleSessionReset.bind(this));
|
|
258
|
-
this.server.get(
|
|
259
|
-
this.server.get(
|
|
258
|
+
this.server.get(DefaultDummySubtitleEndpointPath, this._handleDummySubtitleEndpoint.bind(this));
|
|
259
|
+
this.server.get(DefaultSubtitleSpliceEndpointPath, this._handleSubtitleSliceEndpoint.bind(this));
|
|
260
260
|
this.server.on('NotFound', function (req, res, err, next) {
|
|
261
261
|
res.header("X-Instance-Id", _this.instanceId + "<".concat(version, ">"));
|
|
262
262
|
return next();
|
package/dist/engine/session.js
CHANGED
|
@@ -1161,7 +1161,7 @@ var Session = /** @class */ (function () {
|
|
|
1161
1161
|
audioPosition = (_s.sent()) * 1000;
|
|
1162
1162
|
positionA = audioPosition / 1000;
|
|
1163
1163
|
posDiff = position - audioPosition;
|
|
1164
|
-
if (posDiff <= 0) {
|
|
1164
|
+
if (posDiff <= 0.001) {
|
|
1165
1165
|
return [3 /*break*/, 22];
|
|
1166
1166
|
}
|
|
1167
1167
|
if (posDiff > thresh) {
|
|
@@ -126,14 +126,14 @@ var SharedSessionState = /** @class */ (function () {
|
|
|
126
126
|
};
|
|
127
127
|
SharedSessionState.prototype.setCurrentVod = function (hlsVod, opts) {
|
|
128
128
|
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
-
var isLeader;
|
|
129
|
+
var isLeader, currentVod;
|
|
130
130
|
return __generator(this, function (_a) {
|
|
131
131
|
switch (_a.label) {
|
|
132
132
|
case 0:
|
|
133
133
|
if (!this.sessionId) {
|
|
134
134
|
throw new Error("shared session state store has not been initialized");
|
|
135
135
|
}
|
|
136
|
-
if (!this.store.isShared()) return [3 /*break*/,
|
|
136
|
+
if (!this.store.isShared()) return [3 /*break*/, 7];
|
|
137
137
|
return [4 /*yield*/, this.store.clearLeaderCache()];
|
|
138
138
|
case 1:
|
|
139
139
|
_a.sent();
|
|
@@ -144,16 +144,21 @@ var SharedSessionState = /** @class */ (function () {
|
|
|
144
144
|
return [4 /*yield*/, this.set("currentVod", hlsVod.toJSON())];
|
|
145
145
|
case 3:
|
|
146
146
|
_a.sent();
|
|
147
|
-
return [3 /*break*/,
|
|
147
|
+
return [3 /*break*/, 6];
|
|
148
148
|
case 4:
|
|
149
|
-
debug("[".concat(this.sessionId, "]:
|
|
150
|
-
|
|
151
|
-
case 5:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
_a.label =
|
|
149
|
+
debug("[".concat(this.sessionId, "]: Not a leader. Will not overwrite. Getting currentVod in shared store"));
|
|
150
|
+
return [4 /*yield*/, this.get("currentVod")];
|
|
151
|
+
case 5:
|
|
152
|
+
currentVod = _a.sent();
|
|
153
|
+
hlsVod = new HLSVod();
|
|
154
|
+
hlsVod.fromJSON(currentVod);
|
|
155
|
+
_a.label = 6;
|
|
156
|
+
case 6: return [3 /*break*/, 9];
|
|
157
|
+
case 7: return [4 /*yield*/, this.set("currentVod", hlsVod)];
|
|
156
158
|
case 8:
|
|
159
|
+
_a.sent();
|
|
160
|
+
_a.label = 9;
|
|
161
|
+
case 9:
|
|
157
162
|
if (this.cache.currentVod) {
|
|
158
163
|
this.cache.currentVod.ts = Date.now();
|
|
159
164
|
this.cache.currentVod.ttl = CURRENTVOD_CACHE_TTL;
|
package/dist/package.json
CHANGED
package/engine/server.ts
CHANGED
|
@@ -349,8 +349,8 @@ export class ChannelEngine {
|
|
|
349
349
|
this.server.get('/health', this._handleAggregatedSessionHealth.bind(this));
|
|
350
350
|
this.server.get('/health/:sessionId', this._handleSessionHealth.bind(this));
|
|
351
351
|
this.server.get('/reset', this._handleSessionReset.bind(this));
|
|
352
|
-
this.server.get(
|
|
353
|
-
this.server.get(
|
|
352
|
+
this.server.get(DefaultDummySubtitleEndpointPath, this._handleDummySubtitleEndpoint.bind(this));
|
|
353
|
+
this.server.get(DefaultSubtitleSpliceEndpointPath, this._handleSubtitleSliceEndpoint.bind(this));
|
|
354
354
|
|
|
355
355
|
this.server.on('NotFound', (req, res, err, next) => {
|
|
356
356
|
res.header("X-Instance-Id", this.instanceId + `<${version}>`);
|
package/engine/session.js
CHANGED
|
@@ -841,7 +841,7 @@ class Session {
|
|
|
841
841
|
const audioPosition = (await this._getAudioPlayheadPosition(sessionState.vodMediaSeqAudio + index)) * 1000;
|
|
842
842
|
positionA = audioPosition / 1000;
|
|
843
843
|
posDiff = position - audioPosition;
|
|
844
|
-
if (posDiff <= 0) {
|
|
844
|
+
if (posDiff <= 0.001) {
|
|
845
845
|
break;
|
|
846
846
|
}
|
|
847
847
|
if (posDiff > thresh) {
|
package/engine/session_state.js
CHANGED
|
@@ -73,14 +73,16 @@ class SharedSessionState {
|
|
|
73
73
|
if (!this.sessionId) {
|
|
74
74
|
throw new Error("shared session state store has not been initialized");
|
|
75
75
|
}
|
|
76
|
-
|
|
77
76
|
if (this.store.isShared()) {
|
|
78
77
|
await this.store.clearLeaderCache();
|
|
79
78
|
const isLeader = await this.store.isLeader(this.instanceId);
|
|
80
79
|
if (isLeader) {
|
|
81
80
|
await this.set("currentVod", hlsVod.toJSON());
|
|
82
81
|
} else {
|
|
83
|
-
debug(`[${this.sessionId}]:
|
|
82
|
+
debug(`[${this.sessionId}]: Not a leader. Will not overwrite. Getting currentVod in shared store`);
|
|
83
|
+
const currentVod = await this.get("currentVod");
|
|
84
|
+
hlsVod = new HLSVod();
|
|
85
|
+
hlsVod.fromJSON(currentVod);
|
|
84
86
|
}
|
|
85
87
|
} else {
|
|
86
88
|
await this.set("currentVod", hlsVod);
|