eyevinn-channel-engine 3.1.7 → 3.2.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/engine/server.js +7 -4
- package/engine/session.js +206 -90
- package/engine/session_live.js +86 -26
- package/engine/session_state.js +9 -2
- package/engine/stream_switcher.js +13 -6
- package/engine/util.js +30 -0
- package/package.json +1 -1
- package/spec/engine/init_switching_spec.js +118 -153
- package/spec/engine/stream_switcher_spec.js +91 -68
|
@@ -2,7 +2,7 @@ const SessionLive = require("../../engine/session_live.js");
|
|
|
2
2
|
const Session = require("../../engine/session.js");
|
|
3
3
|
const nock = require("nock");
|
|
4
4
|
const { v4: uuidv4 } = require("uuid");
|
|
5
|
-
const { SessionStateStore } = require("../../engine/session_state.js");
|
|
5
|
+
const { SessionStateStore, SessionState } = require("../../engine/session_state.js");
|
|
6
6
|
const { PlayheadStateStore } = require("../../engine/playhead_state.js");
|
|
7
7
|
const { SessionLiveStateStore } = require("../../engine/session_live_state.js");
|
|
8
8
|
|
|
@@ -331,19 +331,14 @@ describe("The initialize switching", () => {
|
|
|
331
331
|
timelinePosition: null,
|
|
332
332
|
cue: null,
|
|
333
333
|
});
|
|
334
|
-
expect(
|
|
335
|
-
currVodSegments[1313000][currVodSegments[1313000].length - 1]
|
|
336
|
-
).toEqual({
|
|
334
|
+
expect(currVodSegments[1313000][currVodSegments[1313000].length - 1]).toEqual({
|
|
337
335
|
duration: 7.5,
|
|
338
336
|
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-00008.ts",
|
|
339
337
|
timelinePosition: null,
|
|
340
338
|
cue: null,
|
|
341
339
|
});
|
|
342
340
|
|
|
343
|
-
await sessionLive.setCurrentMediaAndDiscSequenceCount(
|
|
344
|
-
currVodCounts.mediaSeq,
|
|
345
|
-
currVodCounts.discSeq
|
|
346
|
-
);
|
|
341
|
+
await sessionLive.setCurrentMediaAndDiscSequenceCount(currVodCounts.mediaSeq, currVodCounts.discSeq);
|
|
347
342
|
await sessionLive.setCurrentMediaSequenceSegments(currVodSegments);
|
|
348
343
|
await sessionLive.setLiveUri(mockLiveUri);
|
|
349
344
|
let counts = await sessionLive.getCurrentMediaAndDiscSequenceCount();
|
|
@@ -379,39 +374,49 @@ describe("The initialize switching", () => {
|
|
|
379
374
|
}
|
|
380
375
|
await sessionLive.initAsync();
|
|
381
376
|
|
|
382
|
-
spyOn(sessionLive, "resetLiveStoreAsync").and.callFake(
|
|
383
|
-
spyOn(sessionLive, "resetSession").and.callFake(
|
|
377
|
+
spyOn(sessionLive, "resetLiveStoreAsync").and.callFake(() => true);
|
|
378
|
+
spyOn(sessionLive, "resetSession").and.callFake(() => true);
|
|
384
379
|
spyOn(sessionLive, "getCurrentMediaSequenceSegments").and.returnValue({ currMseqSegs: mockLiveSegments, segCount: 8 });
|
|
385
380
|
|
|
386
381
|
await sessionLive.setCurrentMediaAndDiscSequenceCount(13, 1);
|
|
387
382
|
await sessionLive.setCurrentMediaSequenceSegments(mockLiveSegments);
|
|
388
383
|
await sessionLive.setLiveUri(mockLiveUri);
|
|
389
384
|
|
|
385
|
+
sessionLive.mediaSeqCount += 7;
|
|
386
|
+
|
|
390
387
|
const currCounts = await sessionLive.getCurrentMediaAndDiscSequenceCount();
|
|
391
388
|
const currSegments = await sessionLive.getCurrentMediaSequenceSegments();
|
|
392
389
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
);
|
|
397
|
-
await session.
|
|
398
|
-
|
|
399
|
-
await session.incrementAsync();
|
|
390
|
+
session.setCurrentMediaAndDiscSequenceCount(currCounts.mediaSeq, currCounts.discSeq);
|
|
391
|
+
session.setCurrentMediaSequenceSegments(currSegments.currMseqSegs, currSegments.segCount);
|
|
392
|
+
|
|
393
|
+
await session.incrementAsync(); // sets state to VOD_RELOAD_INIT
|
|
394
|
+
await session.incrementAsync(); // performs VOD_RELOAD_INIT
|
|
395
|
+
await session.incrementAsync(); // sets state to VOD_PLAYING and increments with 1
|
|
396
|
+
await session.incrementAsync(); // +1
|
|
397
|
+
await session.incrementAsync(); // +1
|
|
400
398
|
|
|
401
399
|
const sessionCounts = await session.getCurrentMediaAndDiscSequenceCount();
|
|
402
400
|
const sessionCurrentSegs = await session.getCurrentMediaSequenceSegments();
|
|
403
401
|
const size = sessionCurrentSegs["1313000"].length;
|
|
404
|
-
|
|
402
|
+
|
|
403
|
+
const expectedCounts = {
|
|
404
|
+
mediaSeq: 23,
|
|
405
|
+
discSeq: 1,
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
expect(expectedCounts).toEqual(sessionCounts);
|
|
405
409
|
expect(sessionCurrentSegs["1313000"][0]).toEqual({
|
|
406
410
|
duration: 7,
|
|
407
|
-
uri: "http://mock.mock.com/180000/
|
|
411
|
+
uri: "http://mock.mock.com/180000/seg12.ts",
|
|
408
412
|
});
|
|
409
|
-
expect(sessionCurrentSegs["1313000"][size - 1 -
|
|
410
|
-
discontinuity: true,
|
|
413
|
+
expect(sessionCurrentSegs["1313000"][size - 1 - 2]).toEqual({
|
|
414
|
+
discontinuity: true,
|
|
415
|
+
cue: { in: true },
|
|
411
416
|
});
|
|
412
417
|
expect(sessionCurrentSegs["1313000"][size - 1]).toEqual({
|
|
413
418
|
duration: 7.5,
|
|
414
|
-
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-
|
|
419
|
+
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-00016.ts",
|
|
415
420
|
timelinePosition: null,
|
|
416
421
|
cue: null,
|
|
417
422
|
});
|
|
@@ -421,8 +426,7 @@ describe("The initialize switching", () => {
|
|
|
421
426
|
it("should give correct segments and sequence counts from session back to session (case: V2L->VOD)", async () => {
|
|
422
427
|
const assetMgr = new TestAssetManager();
|
|
423
428
|
const session = new Session(assetMgr, { sessionId: "1" }, sessionStore);
|
|
424
|
-
const vodUri =
|
|
425
|
-
"https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/master.m3u8";
|
|
429
|
+
const vodUri = "https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/master.m3u8";
|
|
426
430
|
const vodEventDurationMs = 60 * 1000;
|
|
427
431
|
|
|
428
432
|
await session.initAsync();
|
|
@@ -430,21 +434,27 @@ describe("The initialize switching", () => {
|
|
|
430
434
|
await session.incrementAsync();
|
|
431
435
|
}
|
|
432
436
|
const currVodCounts = await session.getCurrentMediaAndDiscSequenceCount();
|
|
433
|
-
const eventSegments = await session.getTruncatedVodSegments(
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
);
|
|
437
|
-
|
|
438
|
-
await session.setCurrentMediaAndDiscSequenceCount(
|
|
439
|
-
currVodCounts.mediaSeq,
|
|
440
|
-
currVodCounts.discSeq
|
|
441
|
-
);
|
|
442
|
-
await session.setCurrentMediaSequenceSegments(eventSegments, 0, true);
|
|
437
|
+
const eventSegments = await session.getTruncatedVodSegments(vodUri, vodEventDurationMs / 1000);
|
|
438
|
+
|
|
439
|
+
session.setCurrentMediaAndDiscSequenceCount(currVodCounts.mediaSeq, currVodCounts.discSeq);
|
|
440
|
+
session.setCurrentMediaSequenceSegments(eventSegments, 0, true);
|
|
443
441
|
|
|
442
|
+
await session.incrementAsync(); // sets state to VOD_RELOAD_INIT
|
|
443
|
+
await session.incrementAsync(); // performs VOD_RELOAD_INIT
|
|
444
|
+
await session.incrementAsync(); // sets state to VOD_PLAYING and increments with 1
|
|
445
|
+
await session.incrementAsync(); // +1
|
|
444
446
|
const sessionCounts = await session.getCurrentMediaAndDiscSequenceCount();
|
|
445
|
-
expect(currVodCounts).toEqual(sessionCounts);
|
|
446
447
|
|
|
447
|
-
|
|
448
|
+
const expectedCounts = {
|
|
449
|
+
mediaSeq: 8,
|
|
450
|
+
discSeq: 0,
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
expect(expectedCounts).toEqual(sessionCounts);
|
|
454
|
+
|
|
455
|
+
await session.incrementAsync(); // +1
|
|
456
|
+
await session.incrementAsync(); // +1
|
|
457
|
+
|
|
448
458
|
const sessionCurrentSegs = await session.getCurrentMediaSequenceSegments();
|
|
449
459
|
let manifest = await session.getCurrentMediaManifestAsync(180000);
|
|
450
460
|
const m = manifest.match(/#EXT-X-MEDIA-SEQUENCE:(\d+)/);
|
|
@@ -452,35 +462,27 @@ describe("The initialize switching", () => {
|
|
|
452
462
|
if (m) {
|
|
453
463
|
mseqNo = Number(m[1]);
|
|
454
464
|
}
|
|
455
|
-
expect(mseqNo).toBe(
|
|
465
|
+
expect(mseqNo).toBe(10);
|
|
456
466
|
const size = sessionCurrentSegs["1313000"].length;
|
|
457
467
|
expect(sessionCurrentSegs["1313000"][0]).toEqual({
|
|
458
|
-
duration:
|
|
459
|
-
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-
|
|
468
|
+
duration: 7.5,
|
|
469
|
+
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/600/600-00011.ts",
|
|
460
470
|
timelinePosition: null,
|
|
461
471
|
cue: null,
|
|
462
472
|
});
|
|
463
|
-
expect(sessionCurrentSegs["1313000"][size - 1 -
|
|
473
|
+
expect(sessionCurrentSegs["1313000"][size - 1 - 4]).toEqual({
|
|
464
474
|
discontinuity: true,
|
|
465
|
-
cue: { in: true }
|
|
475
|
+
cue: { in: true },
|
|
466
476
|
});
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
).
|
|
470
|
-
expect(
|
|
471
|
-
|
|
472
|
-
).toBe(
|
|
473
|
-
expect(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
expect(sessionCurrentSegs["1313000"][size - 1].duration).toEqual(10.88);
|
|
477
|
-
expect(sessionCurrentSegs["1313000"][size - 1].timelinePosition).toEqual(
|
|
478
|
-
null
|
|
479
|
-
);
|
|
480
|
-
expect(sessionCurrentSegs["1313000"][size - 1].cue).toEqual(null);
|
|
481
|
-
expect(sessionCurrentSegs["1313000"][size - 1].uri).toEqual(
|
|
482
|
-
"https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/1000/1000-00000.ts"
|
|
483
|
-
);
|
|
477
|
+
const borderSegment = sessionCurrentSegs["1313000"][size - 1 - 3];
|
|
478
|
+
expect(borderSegment.duration).toBe(10.880);
|
|
479
|
+
expect(borderSegment.cue).toBe(null);
|
|
480
|
+
expect(borderSegment.timelinePosition).toBe(null);
|
|
481
|
+
expect(borderSegment.uri).toBe("https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/1000/1000-00000.ts");
|
|
482
|
+
expect(borderSegment.daterange["id"]).not.toBe(null);
|
|
483
|
+
expect(borderSegment.daterange["start-date"]).not.toBe(null);
|
|
484
|
+
expect(borderSegment.daterange["planned-duration"]).toBe(vodEventDurationMs/1000);
|
|
485
|
+
|
|
484
486
|
});
|
|
485
487
|
|
|
486
488
|
xit("should give correct segments and sequence counts from session to sessionLive (case: VOD->LIVE)", async () => {
|
|
@@ -532,20 +534,14 @@ describe("The initialize switching", () => {
|
|
|
532
534
|
for (let i = 0; i < 3; i++) {
|
|
533
535
|
await session.incrementAsync();
|
|
534
536
|
}
|
|
535
|
-
spyOn(sessionLive, "resetLiveStoreAsync").and.callFake(
|
|
536
|
-
spyOn(sessionLive, "resetSession").and.callFake(
|
|
537
|
+
spyOn(sessionLive, "resetLiveStoreAsync").and.callFake(() => true);
|
|
538
|
+
spyOn(sessionLive, "resetSession").and.callFake(() => true);
|
|
537
539
|
spyOn(sessionLive, "getCurrentMediaSequenceSegments").and.returnValue({ currMseqSegs: mockLiveSegments, segCount: 8 });
|
|
538
540
|
await sessionLive.initAsync();
|
|
539
541
|
sessionLive.startPlayheadAsync();
|
|
540
542
|
const currVodCounts = await session.getCurrentMediaAndDiscSequenceCount();
|
|
541
|
-
const eventSegments = await session.getTruncatedVodSegments(
|
|
542
|
-
|
|
543
|
-
vodEventDurationMs / 1000
|
|
544
|
-
);
|
|
545
|
-
await session.setCurrentMediaAndDiscSequenceCount(
|
|
546
|
-
currVodCounts.mediaSeq,
|
|
547
|
-
currVodCounts.discSeq
|
|
548
|
-
);
|
|
543
|
+
const eventSegments = await session.getTruncatedVodSegments(vodUri, vodEventDurationMs / 1000);
|
|
544
|
+
await session.setCurrentMediaAndDiscSequenceCount(currVodCounts.mediaSeq, currVodCounts.discSeq);
|
|
549
545
|
await session.setCurrentMediaSequenceSegments(eventSegments, 0, true);
|
|
550
546
|
for (let i = 0; i < 8; i++) {
|
|
551
547
|
await session.incrementAsync();
|
|
@@ -554,10 +550,7 @@ describe("The initialize switching", () => {
|
|
|
554
550
|
const newVodCounts = await session.getCurrentMediaAndDiscSequenceCount();
|
|
555
551
|
const newVodSegments = await session.getCurrentMediaSequenceSegments();
|
|
556
552
|
// Set to sessionLive
|
|
557
|
-
await sessionLive.setCurrentMediaAndDiscSequenceCount(
|
|
558
|
-
newVodCounts.mediaSeq,
|
|
559
|
-
newVodCounts.discSeq
|
|
560
|
-
);
|
|
553
|
+
await sessionLive.setCurrentMediaAndDiscSequenceCount(newVodCounts.mediaSeq, newVodCounts.discSeq);
|
|
561
554
|
await sessionLive.setCurrentMediaSequenceSegments(newVodSegments);
|
|
562
555
|
await sessionLive.setLiveUri(mockLiveUri);
|
|
563
556
|
// Get and inspect counts from sessionLive
|
|
@@ -644,8 +637,7 @@ describe("The initialize switching", () => {
|
|
|
644
637
|
const session = new Session(assetMgr, { sessionId: "1" }, sessionStore);
|
|
645
638
|
const sessionLive = new SessionLive({ sessionId: "1" }, sessionLiveStore);
|
|
646
639
|
|
|
647
|
-
const vodUri =
|
|
648
|
-
"https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/master.m3u8";
|
|
640
|
+
const vodUri = "https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/master.m3u8";
|
|
649
641
|
const vodEventDurationMs = 70 * 1000;
|
|
650
642
|
|
|
651
643
|
await session.initAsync();
|
|
@@ -665,16 +657,10 @@ describe("The initialize switching", () => {
|
|
|
665
657
|
const currSegments = await sessionLive.getCurrentMediaSequenceSegments();
|
|
666
658
|
await sessionLive.resetSessionAsync();
|
|
667
659
|
|
|
668
|
-
await session.setCurrentMediaAndDiscSequenceCount(
|
|
669
|
-
currCounts.mediaSeq,
|
|
670
|
-
currCounts.discSeq
|
|
671
|
-
);
|
|
660
|
+
await session.setCurrentMediaAndDiscSequenceCount(currCounts.mediaSeq, currCounts.discSeq);
|
|
672
661
|
await session.setCurrentMediaSequenceSegments(currSegments);
|
|
673
662
|
|
|
674
|
-
const eventSegments = await session.getTruncatedVodSegments(
|
|
675
|
-
vodUri,
|
|
676
|
-
vodEventDurationMs / 1000
|
|
677
|
-
);
|
|
663
|
+
const eventSegments = await session.getTruncatedVodSegments(vodUri, vodEventDurationMs / 1000);
|
|
678
664
|
await session.setCurrentMediaSequenceSegments(eventSegments, true);
|
|
679
665
|
|
|
680
666
|
await session.incrementAsync();
|
|
@@ -692,19 +678,13 @@ describe("The initialize switching", () => {
|
|
|
692
678
|
}
|
|
693
679
|
expect(mseqNo).toBe(14);
|
|
694
680
|
expect(dseqNo).toBe(1);
|
|
695
|
-
expect(
|
|
696
|
-
|
|
697
|
-
).toEqual(vodEventDurationMs / 1000);
|
|
698
|
-
expect("start-date" in newSegments["1313000"][size - 1].daterange).toBe(
|
|
699
|
-
true
|
|
700
|
-
);
|
|
681
|
+
expect(newSegments["1313000"][size - 1].daterange["planned-duration"]).toEqual(vodEventDurationMs / 1000);
|
|
682
|
+
expect("start-date" in newSegments["1313000"][size - 1].daterange).toBe(true);
|
|
701
683
|
expect("id" in newSegments["1313000"][size - 1].daterange).toBe(true);
|
|
702
684
|
expect(newSegments["1313000"][size - 1].duration).toEqual(10.88);
|
|
703
685
|
expect(newSegments["1313000"][size - 1].timelinePosition).toEqual(null);
|
|
704
686
|
expect(newSegments["1313000"][size - 1].cue).toEqual(null);
|
|
705
|
-
expect(newSegments["1313000"][size - 1].uri).toEqual(
|
|
706
|
-
"https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/1000/1000-00000.ts"
|
|
707
|
-
);
|
|
687
|
+
expect(newSegments["1313000"][size - 1].uri).toEqual("https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/1000/1000-00000.ts");
|
|
708
688
|
expect(newSegments["1313000"][size - 1 - 1]).toEqual({
|
|
709
689
|
discontinuity: true,
|
|
710
690
|
});
|
|
@@ -722,10 +702,8 @@ describe("The initialize switching", () => {
|
|
|
722
702
|
it("should give correct segments and sequence counts from session to session (case: VOD->VOD)", async () => {
|
|
723
703
|
const assetMgr = new TestAssetManager();
|
|
724
704
|
const session = new Session(assetMgr, { sessionId: "1" }, sessionStore);
|
|
725
|
-
const vodUri =
|
|
726
|
-
|
|
727
|
-
const vodUri2 =
|
|
728
|
-
"https://maitv-vod.lab.eyevinn.technology/BECKY_Trailer_2020.mp4/master.m3u8";
|
|
705
|
+
const vodUri = "https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/master.m3u8";
|
|
706
|
+
const vodUri2 = "https://maitv-vod.lab.eyevinn.technology/BECKY_Trailer_2020.mp4/master.m3u8";
|
|
729
707
|
const vodEventDurationMs = 70 * 1000;
|
|
730
708
|
const vodEventDurationMs2 = 70 * 1000;
|
|
731
709
|
|
|
@@ -734,79 +712,72 @@ describe("The initialize switching", () => {
|
|
|
734
712
|
await session.incrementAsync();
|
|
735
713
|
}
|
|
736
714
|
const currVodCounts = await session.getCurrentMediaAndDiscSequenceCount();
|
|
737
|
-
const eventSegments = await session.getTruncatedVodSegments(
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
await session.
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
await session.setCurrentMediaSequenceSegments(eventSegments, 0, true);
|
|
715
|
+
const eventSegments = await session.getTruncatedVodSegments(vodUri, vodEventDurationMs / 1000);
|
|
716
|
+
session.setCurrentMediaAndDiscSequenceCount(currVodCounts.mediaSeq, currVodCounts.discSeq);
|
|
717
|
+
session.setCurrentMediaSequenceSegments(eventSegments, 0, true);
|
|
718
|
+
|
|
719
|
+
await session.incrementAsync(); // sets state to VOD_RELOAD_INIT
|
|
720
|
+
await session.incrementAsync(); // performs VOD_RELOAD_INIT
|
|
721
|
+
await session.incrementAsync(); // sets state to VOD_PLAYING and increments with 1
|
|
722
|
+
|
|
746
723
|
for (let i = 0; i < 10; i++) {
|
|
747
724
|
await session.incrementAsync();
|
|
748
725
|
}
|
|
749
726
|
const newVodCounts = await session.getCurrentMediaAndDiscSequenceCount();
|
|
750
727
|
let newVodSegments = await session.getCurrentMediaSequenceSegments();
|
|
751
|
-
const eventSegments2 = await session.getTruncatedVodSegments(
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
);
|
|
755
|
-
|
|
756
|
-
await session.
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
await session.setCurrentMediaSequenceSegments(eventSegments2, 0, true);
|
|
728
|
+
const eventSegments2 = await session.getTruncatedVodSegments(vodUri2, vodEventDurationMs2 / 1000);
|
|
729
|
+
|
|
730
|
+
session.setCurrentMediaAndDiscSequenceCount(newVodCounts.mediaSeq, newVodCounts.discSeq);
|
|
731
|
+
session.setCurrentMediaSequenceSegments(eventSegments2, 0, true);
|
|
732
|
+
|
|
733
|
+
await session.incrementAsync(); // sets state to VOD_RELOAD_INIT
|
|
734
|
+
await session.incrementAsync(); // performs VOD_RELOAD_INIT
|
|
735
|
+
await session.incrementAsync(); // sets state to VOD_PLAYING and increments with 1
|
|
736
|
+
|
|
761
737
|
for (let i = 0; i < 2; i++) {
|
|
762
738
|
await session.incrementAsync();
|
|
763
739
|
}
|
|
764
740
|
|
|
765
741
|
newVodSegments = await session.getCurrentMediaSequenceSegments();
|
|
766
|
-
const
|
|
767
|
-
|
|
742
|
+
const borderSegment = newVodSegments["1313000"][6];
|
|
743
|
+
|
|
744
|
+
const expectedLastVODSegItem = {
|
|
768
745
|
duration: 7.2,
|
|
769
746
|
uri: "https://maitv-vod.lab.eyevinn.technology/MORBIUS_Trailer_2020.mp4/1000/1000-00008.ts",
|
|
770
747
|
timelinePosition: null,
|
|
771
748
|
cue: null,
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
discontinuity: true,
|
|
775
|
-
daterange: null,
|
|
776
|
-
});
|
|
777
|
-
expect(newVodSegments["1313000"][size - 1 - 1 - 1 - 1]).toEqual({
|
|
749
|
+
}
|
|
750
|
+
const expectedFirstV2LSegItem = {
|
|
778
751
|
duration: 10.846444,
|
|
779
752
|
uri: "https://maitv-vod.lab.eyevinn.technology/VINN.mp4/600/600-00000.ts",
|
|
780
753
|
timelinePosition: null,
|
|
781
754
|
cue: null,
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
discontinuity: true,
|
|
785
|
-
cue: { in: true }
|
|
786
|
-
});
|
|
787
|
-
expect(
|
|
788
|
-
newVodSegments["1313000"][size - 1 - 1].daterange["planned-duration"]
|
|
789
|
-
).toEqual(vodEventDurationMs2 / 1000);
|
|
790
|
-
expect(
|
|
791
|
-
"start-date" in newVodSegments["1313000"][size - 1 - 1].daterange
|
|
792
|
-
).toBe(true);
|
|
793
|
-
expect("id" in newVodSegments["1313000"][size - 1 - 1].daterange).toBe(
|
|
794
|
-
true
|
|
795
|
-
);
|
|
796
|
-
expect(newVodSegments["1313000"][size - 1 - 1].duration).toEqual(11.3077);
|
|
797
|
-
expect(newVodSegments["1313000"][size - 1 - 1].timelinePosition).toEqual(
|
|
798
|
-
null
|
|
799
|
-
);
|
|
800
|
-
expect(newVodSegments["1313000"][size - 1 - 1].cue).toEqual(null);
|
|
801
|
-
expect(newVodSegments["1313000"][size - 1 - 1].uri).toEqual(
|
|
802
|
-
"https://maitv-vod.lab.eyevinn.technology/BECKY_Trailer_2020.mp4/600/600-00000.ts"
|
|
803
|
-
);
|
|
804
|
-
expect(newVodSegments["1313000"][size - 1]).toEqual({
|
|
755
|
+
}
|
|
756
|
+
const expectedSecondVODSegItem = {
|
|
805
757
|
duration: 7.5075,
|
|
806
758
|
uri: "https://maitv-vod.lab.eyevinn.technology/BECKY_Trailer_2020.mp4/600/600-00001.ts",
|
|
807
759
|
timelinePosition: null,
|
|
808
760
|
cue: null,
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
expect(newVodSegments["1313000"][0]).toEqual(expectedLastVODSegItem);
|
|
764
|
+
expect(newVodSegments["1313000"][1]).toEqual({
|
|
765
|
+
discontinuity: true,
|
|
766
|
+
daterange: null,
|
|
767
|
+
});
|
|
768
|
+
expect(newVodSegments["1313000"][2]).toEqual(expectedFirstV2LSegItem);
|
|
769
|
+
expect(newVodSegments["1313000"][5]).toEqual({
|
|
770
|
+
discontinuity: true,
|
|
771
|
+
cue: { in: true },
|
|
809
772
|
});
|
|
773
|
+
expect(borderSegment.daterange["planned-duration"]).toEqual(vodEventDurationMs2 / 1000);
|
|
774
|
+
expect("start-date" in borderSegment.daterange).toBe(true);
|
|
775
|
+
expect("id" in borderSegment.daterange).toBe(true);
|
|
776
|
+
expect(borderSegment.duration).toEqual(11.3077);
|
|
777
|
+
expect(borderSegment.timelinePosition).toEqual(null);
|
|
778
|
+
expect(borderSegment.cue).toEqual(null);
|
|
779
|
+
expect(borderSegment.uri).toEqual("https://maitv-vod.lab.eyevinn.technology/BECKY_Trailer_2020.mp4/600/600-00000.ts");
|
|
780
|
+
expect(newVodSegments["1313000"][7]).toEqual(expectedSecondVODSegItem);
|
|
810
781
|
});
|
|
811
782
|
|
|
812
783
|
xit("should give correct segments and sequence counts from sessionLive to sessionLive (case: LIVE->LIVE)", async () => {
|
|
@@ -867,10 +838,7 @@ describe("The initialize switching", () => {
|
|
|
867
838
|
currVodSegments = await session.getCurrentMediaSequenceSegments();
|
|
868
839
|
currVodCounts = await session.getCurrentMediaAndDiscSequenceCount();
|
|
869
840
|
|
|
870
|
-
await sessionLive.setCurrentMediaAndDiscSequenceCount(
|
|
871
|
-
currVodCounts.mediaSeq,
|
|
872
|
-
currVodCounts.discSeq
|
|
873
|
-
);
|
|
841
|
+
await sessionLive.setCurrentMediaAndDiscSequenceCount(currVodCounts.mediaSeq, currVodCounts.discSeq);
|
|
874
842
|
await sessionLive.setCurrentMediaSequenceSegments(currVodSegments);
|
|
875
843
|
await sessionLive.setLiveUri(mockLiveUri);
|
|
876
844
|
|
|
@@ -882,10 +850,7 @@ describe("The initialize switching", () => {
|
|
|
882
850
|
let liveCounts = await sessionLive.getCurrentMediaAndDiscSequenceCount();
|
|
883
851
|
await sessionLive.resetSessionAsync();
|
|
884
852
|
|
|
885
|
-
await sessionLive.setCurrentMediaAndDiscSequenceCount(
|
|
886
|
-
liveCounts.mediaSeq,
|
|
887
|
-
liveCounts.discSeq
|
|
888
|
-
);
|
|
853
|
+
await sessionLive.setCurrentMediaAndDiscSequenceCount(liveCounts.mediaSeq, liveCounts.discSeq);
|
|
889
854
|
await sessionLive.setCurrentMediaSequenceSegments(liveSegs);
|
|
890
855
|
await sessionLive.setLiveUri(mockLiveUri);
|
|
891
856
|
|