eyevinn-channel-engine 4.3.5 → 4.3.6

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.
@@ -32,6 +32,7 @@ export interface ChannelEngineOpts {
32
32
  autoCreateSession?: boolean;
33
33
  sessionResetKey?: string;
34
34
  keepAliveTimeout?: number;
35
+ sessionEventStream?: boolean;
35
36
  }
36
37
  export interface VodRequest {
37
38
  sessionId: string;
@@ -151,6 +152,7 @@ export declare class ChannelEngine {
151
152
  private adXchangeUri?;
152
153
  private autoCreateSession;
153
154
  private sessionResetKey;
155
+ private sessionEventStream;
154
156
  constructor(assetMgr: IAssetManager, options?: ChannelEngineOpts);
155
157
  updateStreamSwitchAsync(): Promise<void>;
156
158
  updateChannelsAsync(channelMgr: any, options: any): Promise<void>;
@@ -72,6 +72,7 @@ var ChannelEngine = /** @class */ (function () {
72
72
  var _this = this;
73
73
  this.autoCreateSession = false;
74
74
  this.sessionResetKey = "";
75
+ this.sessionEventStream = false;
75
76
  this.options = options;
76
77
  if (options && options.adCopyMgrUri) {
77
78
  this.adCopyMgrUri = options.adCopyMgrUri;
@@ -121,7 +122,6 @@ var ChannelEngine = /** @class */ (function () {
121
122
  this.server.server.keepAliveTimeout = options.keepAliveTimeout;
122
123
  this.server.server.headersTimeout = options.keepAliveTimeout + 1000;
123
124
  }
124
- console.log(this.server);
125
125
  this.server.use(restify.plugins.queryParser());
126
126
  this.serverStartTime = Date.now();
127
127
  this.instanceId = uuidv4();
@@ -474,6 +474,7 @@ var ChannelEngine = /** @class */ (function () {
474
474
  slateRepetitions: channel.slate && channel.slate.repetitions ? channel.slate.repetitions : this.slateRepetitions,
475
475
  slateDuration: channel.slate && channel.slate.duration ? channel.slate.duration : this.slateDuration,
476
476
  cloudWatchMetrics: this.logCloudWatchMetrics,
477
+ sessionEventStream: options.sessionEventStream
477
478
  }, this.sessionStore);
478
479
  sessionsLive[channel.id] = new SessionLive({
479
480
  sessionId: channel.id,
@@ -59,6 +59,7 @@ declare class Session {
59
59
  _subtitleTracks: any;
60
60
  _closedCaptions: any;
61
61
  _noSessionDataTags: any;
62
+ _sessionEventStream: any;
62
63
  slateUri: any;
63
64
  slateRepetitions: any;
64
65
  slateDuration: any;
@@ -56,6 +56,7 @@ var SessionState = require('./session_state.js').SessionState;
56
56
  var PlayheadState = require('./playhead_state.js').PlayheadState;
57
57
  var _a = require('./util.js'), applyFilter = _a.applyFilter, cloudWatchLog = _a.cloudWatchLog, m3u8Header = _a.m3u8Header, logerror = _a.logerror, codecsFromString = _a.codecsFromString;
58
58
  var ChaosMonkey = require('./chaos_monkey.js');
59
+ var EVENT_LIST_LIMIT = 100;
59
60
  var AVERAGE_SEGMENT_DURATION = 3000;
60
61
  var DEFAULT_PLAYHEAD_DIFF_THRESHOLD = 1000;
61
62
  var DEFAULT_MAX_TICK_INTERVAL = 10000;
@@ -164,6 +165,9 @@ var Session = /** @class */ (function () {
164
165
  if (config.noSessionDataTags) {
165
166
  this._noSessionDataTags = config.noSessionDataTags;
166
167
  }
168
+ if (config.sessionEventStream) {
169
+ this._sessionEventStream = config.sessionEventStream;
170
+ }
167
171
  if (config.slateUri) {
168
172
  this.slateUri = config.slateUri;
169
173
  this.slateRepetitions = config.slateRepetitions || 10;
@@ -1687,7 +1691,12 @@ var Session = /** @class */ (function () {
1687
1691
  return this._events.shift();
1688
1692
  };
1689
1693
  Session.prototype.produceEvent = function (event) {
1690
- this._events.push(event);
1694
+ if (this._sessionEventStream) {
1695
+ this._events.push(event);
1696
+ if (this._events.length > EVENT_LIST_LIMIT) {
1697
+ this.consumeEvent();
1698
+ }
1699
+ }
1691
1700
  };
1692
1701
  Session.prototype.hasPlayhead = function () {
1693
1702
  return !this.disabledPlayhead;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyevinn-channel-engine",
3
- "version": "4.3.5",
3
+ "version": "4.3.6",
4
4
  "description": "OTT TV Channel Engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@eyevinn/hls-repeat": "^0.2.0",
32
32
  "@eyevinn/hls-truncate": "^0.3.0",
33
- "@eyevinn/hls-vodtolive": "^4.0.1",
33
+ "@eyevinn/hls-vodtolive": "^4.1.0",
34
34
  "@eyevinn/m3u8": "^0.5.3",
35
35
  "abort-controller": "^3.0.0",
36
36
  "debug": "^3.2.7",
package/engine/server.ts CHANGED
@@ -61,6 +61,7 @@ export interface ChannelEngineOpts {
61
61
  autoCreateSession?: boolean;
62
62
  sessionResetKey?: string;
63
63
  keepAliveTimeout?: number;
64
+ sessionEventStream?: boolean;
64
65
  }
65
66
 
66
67
  interface StreamerOpts {
@@ -207,6 +208,7 @@ export class ChannelEngine {
207
208
  private adXchangeUri?: string;
208
209
  private autoCreateSession: boolean = false;
209
210
  private sessionResetKey: string = "";
211
+ private sessionEventStream: boolean = false;
210
212
 
211
213
  constructor(assetMgr: IAssetManager, options?: ChannelEngineOpts) {
212
214
  this.options = options;
@@ -260,7 +262,6 @@ export class ChannelEngine {
260
262
  this.server.server.keepAliveTimeout = options.keepAliveTimeout;
261
263
  this.server.server.headersTimeout = options.keepAliveTimeout + 1000;
262
264
  }
263
- console.log(this.server);
264
265
  this.server.use(restify.plugins.queryParser());
265
266
  this.serverStartTime = Date.now();
266
267
  this.instanceId = uuidv4();
@@ -498,6 +499,7 @@ export class ChannelEngine {
498
499
  slateRepetitions: channel.slate && channel.slate.repetitions ? channel.slate.repetitions : this.slateRepetitions,
499
500
  slateDuration: channel.slate && channel.slate.duration ? channel.slate.duration : this.slateDuration,
500
501
  cloudWatchMetrics: this.logCloudWatchMetrics,
502
+ sessionEventStream: options.sessionEventStream
501
503
  }, this.sessionStore);
502
504
 
503
505
  sessionsLive[channel.id] = new SessionLive({
package/engine/session.js CHANGED
@@ -12,6 +12,7 @@ const { PlayheadState } = require('./playhead_state.js');
12
12
  const { applyFilter, cloudWatchLog, m3u8Header, logerror, codecsFromString } = require('./util.js');
13
13
  const ChaosMonkey = require('./chaos_monkey.js');
14
14
 
15
+ const EVENT_LIST_LIMIT = 100;
15
16
  const AVERAGE_SEGMENT_DURATION = 3000;
16
17
  const DEFAULT_PLAYHEAD_DIFF_THRESHOLD = 1000;
17
18
  const DEFAULT_MAX_TICK_INTERVAL = 10000;
@@ -128,6 +129,9 @@ class Session {
128
129
  if (config.noSessionDataTags) {
129
130
  this._noSessionDataTags = config.noSessionDataTags;
130
131
  }
132
+ if (config.sessionEventStream) {
133
+ this._sessionEventStream = config.sessionEventStream;
134
+ }
131
135
  if (config.slateUri) {
132
136
  this.slateUri = config.slateUri;
133
137
  this.slateRepetitions = config.slateRepetitions || 10;
@@ -1246,7 +1250,12 @@ class Session {
1246
1250
  }
1247
1251
 
1248
1252
  produceEvent(event) {
1249
- this._events.push(event);
1253
+ if (this._sessionEventStream) {
1254
+ this._events.push(event);
1255
+ if (this._events.length > EVENT_LIST_LIMIT) {
1256
+ this.consumeEvent();
1257
+ }
1258
+ }
1250
1259
  }
1251
1260
 
1252
1261
  hasPlayhead() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyevinn-channel-engine",
3
- "version": "4.3.5",
3
+ "version": "4.3.6",
4
4
  "description": "OTT TV Channel Engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@eyevinn/hls-repeat": "^0.2.0",
32
32
  "@eyevinn/hls-truncate": "^0.3.0",
33
- "@eyevinn/hls-vodtolive": "^4.0.1",
33
+ "@eyevinn/hls-vodtolive": "^4.1.0",
34
34
  "@eyevinn/m3u8": "^0.5.3",
35
35
  "abort-controller": "^3.0.0",
36
36
  "debug": "^3.2.7",