eyevinn-channel-engine 3.2.3 → 3.2.4

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/session.js CHANGED
@@ -341,7 +341,7 @@ class Session {
341
341
  }
342
342
  }
343
343
 
344
- async getCurrentMediaSequenceSegments() {
344
+ async getCurrentMediaSequenceSegments(opts) {
345
345
  if (!this._sessionState) {
346
346
  throw new Error('Session not ready');
347
347
  }
@@ -361,7 +361,10 @@ class Session {
361
361
  state = await this.getSessionState();
362
362
  }
363
363
 
364
- const playheadState = await this._playheadState.getValues(["mediaSeq", "vodMediaSeqVideo"]);
364
+ const playheadState = await this._playheadState.getValues(["vodMediaSeqVideo"]);
365
+ if (opts && opts.targetMseq) {
366
+ playheadState.vodMediaSeqVideo = opts.targetMseq;
367
+ }
365
368
 
366
369
  // NOTE: Assume that VOD cache was already cleared in 'getCurrentMediaAndDiscSequenceCount()'
367
370
  // and that we now have access to the correct vod cache
@@ -426,6 +429,7 @@ class Session {
426
429
  return {
427
430
  'mediaSeq': (playheadState.mediaSeq + playheadState.vodMediaSeqVideo),
428
431
  'discSeq': discSeqCount,
432
+ 'vodMediaSeqVideo': playheadState.vodMediaSeqVideo,
429
433
  };
430
434
  } catch (err) {
431
435
  logerror(this._sessionId, err);
@@ -233,7 +233,7 @@ class StreamSwitcher {
233
233
  debug(`[${this.sessionId}]: [ INIT Switching from V2L->LIVE ]`);
234
234
  this.eventId = scheduleObj.eventId;
235
235
  currVodCounts = await session.getCurrentMediaAndDiscSequenceCount();
236
- currVodSegments = await session.getCurrentMediaSequenceSegments();
236
+ currVodSegments = await session.getCurrentMediaSequenceSegments({ targetMseq: currVodCounts.vodMediaSeqVideo });
237
237
 
238
238
  // Insert preroll if available for current channel
239
239
  if (this.prerollsCache[this.sessionId]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyevinn-channel-engine",
3
- "version": "3.2.3",
3
+ "version": "3.2.4",
4
4
  "description": "OTT TV Channel Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -324,6 +324,7 @@ describe("The initialize switching", () => {
324
324
  expect(currVodCounts).toEqual({
325
325
  mediaSeq: 2,
326
326
  discSeq: 0,
327
+ vodMediaSeqVideo: 2
327
328
  });
328
329
  expect(currVodSegments[1313000][0]).toEqual({
329
330
  duration: 7.5,
@@ -403,6 +404,7 @@ describe("The initialize switching", () => {
403
404
  const expectedCounts = {
404
405
  mediaSeq: 23,
405
406
  discSeq: 1,
407
+ vodMediaSeqVideo: 3
406
408
  };
407
409
 
408
410
  expect(expectedCounts).toEqual(sessionCounts);
@@ -448,6 +450,7 @@ describe("The initialize switching", () => {
448
450
  const expectedCounts = {
449
451
  mediaSeq: 8,
450
452
  discSeq: 0,
453
+ vodMediaSeqVideo: 2
451
454
  };
452
455
 
453
456
  expect(expectedCounts).toEqual(sessionCounts);