eyevinn-channel-engine 4.0.0 → 4.0.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/engine/session.d.ts
CHANGED
|
@@ -106,5 +106,5 @@ declare class Session {
|
|
|
106
106
|
_getCurrentPlayheadPosition(): Promise<any>;
|
|
107
107
|
_getAudioPlayheadPosition(seqIdx: any): Promise<any>;
|
|
108
108
|
_getLastDuration(manifest: any): Promise<any>;
|
|
109
|
-
|
|
109
|
+
_getPlayheadDiffCompensationValue(diffMs: any, thresholdMs: any): number;
|
|
110
110
|
}
|
package/dist/engine/session.js
CHANGED
|
@@ -327,12 +327,12 @@ var Session = /** @class */ (function () {
|
|
|
327
327
|
if (this.alwaysNewSegments) {
|
|
328
328
|
// Apply Playhead diff compensation, only after external diff compensation has concluded.
|
|
329
329
|
if (this.diffCompensation <= 0) {
|
|
330
|
-
timeToAdd = this.
|
|
330
|
+
timeToAdd = this._getPlayheadDiffCompensationValue(diff, this.playheadDiffThreshold);
|
|
331
331
|
tickInterval += timeToAdd;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
else {
|
|
335
|
-
timeToAdd = this.
|
|
335
|
+
timeToAdd = this._getPlayheadDiffCompensationValue(diff, this.playheadDiffThreshold);
|
|
336
336
|
tickInterval += timeToAdd;
|
|
337
337
|
}
|
|
338
338
|
// Apply external diff compensation if available.
|
|
@@ -2303,7 +2303,7 @@ var Session = /** @class */ (function () {
|
|
|
2303
2303
|
}
|
|
2304
2304
|
});
|
|
2305
2305
|
};
|
|
2306
|
-
Session.prototype.
|
|
2306
|
+
Session.prototype._getPlayheadDiffCompensationValue = function (diffMs, thresholdMs) {
|
|
2307
2307
|
var compensationSec = 0;
|
|
2308
2308
|
if (diffMs > thresholdMs) {
|
|
2309
2309
|
compensationSec = (diffMs / 1000) - (thresholdMs / 1000);
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eyevinn-channel-engine",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "OTT TV Channel Engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@eyevinn/hls-repeat": "^0.2.0",
|
|
28
28
|
"@eyevinn/hls-truncate": "^0.2.0",
|
|
29
|
-
"@eyevinn/hls-vodtolive": "^2.
|
|
29
|
+
"@eyevinn/hls-vodtolive": "^2.2.1",
|
|
30
30
|
"@eyevinn/m3u8": "^0.5.3",
|
|
31
31
|
"abort-controller": "^3.0.0",
|
|
32
32
|
"debug": "^3.2.7",
|
package/engine/session.js
CHANGED
|
@@ -245,12 +245,12 @@ class Session {
|
|
|
245
245
|
if (this.alwaysNewSegments) {
|
|
246
246
|
// Apply Playhead diff compensation, only after external diff compensation has concluded.
|
|
247
247
|
if (this.diffCompensation <= 0) {
|
|
248
|
-
const timeToAdd = this.
|
|
248
|
+
const timeToAdd = this._getPlayheadDiffCompensationValue(diff, this.playheadDiffThreshold);
|
|
249
249
|
tickInterval += timeToAdd;
|
|
250
250
|
}
|
|
251
251
|
} else {
|
|
252
252
|
// Apply Playhead diff compensation, always.
|
|
253
|
-
const timeToAdd = this.
|
|
253
|
+
const timeToAdd = this._getPlayheadDiffCompensationValue(diff, this.playheadDiffThreshold);
|
|
254
254
|
tickInterval += timeToAdd;
|
|
255
255
|
}
|
|
256
256
|
// Apply external diff compensation if available.
|
|
@@ -1657,7 +1657,7 @@ class Session {
|
|
|
1657
1657
|
});
|
|
1658
1658
|
}
|
|
1659
1659
|
|
|
1660
|
-
|
|
1660
|
+
_getPlayheadDiffCompensationValue(diffMs, thresholdMs) {
|
|
1661
1661
|
let compensationSec = 0;
|
|
1662
1662
|
if (diffMs > thresholdMs) {
|
|
1663
1663
|
compensationSec = (diffMs / 1000) - (thresholdMs / 1000);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eyevinn-channel-engine",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "OTT TV Channel Engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@eyevinn/hls-repeat": "^0.2.0",
|
|
28
28
|
"@eyevinn/hls-truncate": "^0.2.0",
|
|
29
|
-
"@eyevinn/hls-vodtolive": "^2.
|
|
29
|
+
"@eyevinn/hls-vodtolive": "^2.2.1",
|
|
30
30
|
"@eyevinn/m3u8": "^0.5.3",
|
|
31
31
|
"abort-controller": "^3.0.0",
|
|
32
32
|
"debug": "^3.2.7",
|
|
@@ -331,12 +331,14 @@ describe("The initialize switching", () => {
|
|
|
331
331
|
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-00002.ts",
|
|
332
332
|
timelinePosition: null,
|
|
333
333
|
cue: null,
|
|
334
|
+
byteRange: undefined,
|
|
334
335
|
});
|
|
335
336
|
expect(currVodSegments[1313000][currVodSegments[1313000].length - 1]).toEqual({
|
|
336
337
|
duration: 7.5,
|
|
337
338
|
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-00008.ts",
|
|
338
339
|
timelinePosition: null,
|
|
339
340
|
cue: null,
|
|
341
|
+
byteRange: undefined,
|
|
340
342
|
});
|
|
341
343
|
|
|
342
344
|
await sessionLive.setCurrentMediaAndDiscSequenceCount(currVodCounts.mediaSeq, currVodCounts.discSeq);
|
|
@@ -421,6 +423,7 @@ describe("The initialize switching", () => {
|
|
|
421
423
|
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-00015.ts",
|
|
422
424
|
timelinePosition: null,
|
|
423
425
|
cue: null,
|
|
426
|
+
byteRange: undefined,
|
|
424
427
|
});
|
|
425
428
|
nock.cleanAll();
|
|
426
429
|
});
|
|
@@ -472,6 +475,7 @@ describe("The initialize switching", () => {
|
|
|
472
475
|
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-00012.ts",
|
|
473
476
|
timelinePosition: null,
|
|
474
477
|
cue: null,
|
|
478
|
+
byteRange: undefined,
|
|
475
479
|
});
|
|
476
480
|
expect(sessionCurrentSegs["1313000"][size - 1 - 4]).toEqual({
|
|
477
481
|
discontinuity: true,
|
|
@@ -752,13 +756,15 @@ describe("The initialize switching", () => {
|
|
|
752
756
|
duration: 7.2,
|
|
753
757
|
timelinePosition: null,
|
|
754
758
|
cue: null,
|
|
755
|
-
uri: 'https://maitv-vod.lab.eyevinn.technology/VINN.mp4/600/600-00001.ts'
|
|
759
|
+
uri: 'https://maitv-vod.lab.eyevinn.technology/VINN.mp4/600/600-00001.ts',
|
|
760
|
+
byteRange: undefined,
|
|
756
761
|
}
|
|
757
762
|
const expectedSecondVODSegItem = {
|
|
758
763
|
duration: 7.5075,
|
|
759
764
|
uri: "https://maitv-vod.lab.eyevinn.technology/BECKY_Trailer_2020.mp4/1000/1000-00001.ts",
|
|
760
765
|
timelinePosition: null,
|
|
761
766
|
cue: null,
|
|
767
|
+
byteRange: undefined,
|
|
762
768
|
}
|
|
763
769
|
|
|
764
770
|
expect(newVodSegments["1313000"][0]).toEqual(expectedLastVODSegItem);
|
|
@@ -766,7 +772,8 @@ describe("The initialize switching", () => {
|
|
|
766
772
|
duration: 10.846444,
|
|
767
773
|
timelinePosition: null,
|
|
768
774
|
cue: null,
|
|
769
|
-
uri: 'https://maitv-vod.lab.eyevinn.technology/VINN.mp4/600/600-00000.ts'
|
|
775
|
+
uri: 'https://maitv-vod.lab.eyevinn.technology/VINN.mp4/600/600-00000.ts',
|
|
776
|
+
byteRange: undefined,
|
|
770
777
|
});
|
|
771
778
|
expect(newVodSegments["1313000"][2]).toEqual(expectedFirstV2LSegItem);
|
|
772
779
|
// expect(newVodSegments["1313000"][5]).toEqual({
|