eyevinn-channel-engine 3.0.4 → 3.0.5
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_live.js +14 -10
- package/engine/stream_switcher.js +15 -0
- package/package.json +1 -1
package/engine/session_live.js
CHANGED
|
@@ -1018,16 +1018,17 @@ class SessionLive {
|
|
|
1018
1018
|
cueData["assetData"] = attributes["assetData"];
|
|
1019
1019
|
}
|
|
1020
1020
|
if ("daterange" in attributes) {
|
|
1021
|
-
if(!daterangeData) {
|
|
1022
|
-
daterangeData = {}
|
|
1021
|
+
if (!daterangeData) {
|
|
1022
|
+
daterangeData = {};
|
|
1023
1023
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1024
|
+
let allDaterangeAttributes = Object.keys(attributes["daterange"]);
|
|
1025
|
+
allDaterangeAttributes.forEach((attr) => {
|
|
1026
|
+
if (attr.match(/DURATION$/)) {
|
|
1027
|
+
daterangeData[attr.toLowerCase()] = parseFloat(attributes["daterange"][attr]);
|
|
1028
|
+
} else {
|
|
1029
|
+
daterangeData[attr.toLowerCase()] = attributes["daterange"][attr];
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1031
1032
|
}
|
|
1032
1033
|
if (playlistItem.properties.uri) {
|
|
1033
1034
|
if (playlistItem.properties.uri.match("^http")) {
|
|
@@ -1171,9 +1172,12 @@ class SessionLive {
|
|
|
1171
1172
|
}
|
|
1172
1173
|
}
|
|
1173
1174
|
}
|
|
1175
|
+
if (seg.datetime) {
|
|
1176
|
+
m3u8 += `#EXT-X-PROGRAM-DATE-TIME:${seg.datetime}\n`;
|
|
1177
|
+
}
|
|
1174
1178
|
if (seg.daterange) {
|
|
1175
1179
|
const dateRangeAttributes = Object.keys(seg.daterange).map(key => daterangeAttribute(key, seg.daterange[key])).join(',');
|
|
1176
|
-
if (seg.daterange['start-date']) {
|
|
1180
|
+
if (!seg.datetime && seg.daterange['start-date']) {
|
|
1177
1181
|
m3u8 += "#EXT-X-PROGRAM-DATE-TIME:" + seg.daterange['start-date'] + "\n";
|
|
1178
1182
|
}
|
|
1179
1183
|
m3u8 += "#EXT-X-DATERANGE:" + dateRangeAttributes + "\n";
|
|
@@ -278,6 +278,9 @@ class StreamSwitcher {
|
|
|
278
278
|
debug(`[${this.sessionId}]: [ Switched from V2L->LIVE ]`);
|
|
279
279
|
return true;
|
|
280
280
|
} catch (err) {
|
|
281
|
+
this.streamTypeLive = false;
|
|
282
|
+
this.working = false;
|
|
283
|
+
this.eventId = null;
|
|
281
284
|
debug(`[${this.sessionId}]: [ ERROR Switching from V2L->LIVE ]`);
|
|
282
285
|
throw new Error(err);
|
|
283
286
|
}
|
|
@@ -309,6 +312,9 @@ class StreamSwitcher {
|
|
|
309
312
|
debug(`[${this.sessionId}]: [ Switched from V2L->VOD ]`);
|
|
310
313
|
return false;
|
|
311
314
|
} catch (err) {
|
|
315
|
+
this.streamTypeLive = false;
|
|
316
|
+
this.working = false;
|
|
317
|
+
this.eventId = null;
|
|
312
318
|
debug(`[${this.sessionId}]: [ ERROR Switching from V2L->VOD ]`);
|
|
313
319
|
throw new Error(err);
|
|
314
320
|
}
|
|
@@ -349,6 +355,9 @@ class StreamSwitcher {
|
|
|
349
355
|
debug(`[${this.sessionId}]: [ Switched from LIVE->V2L ]`);
|
|
350
356
|
return false;
|
|
351
357
|
} catch (err) {
|
|
358
|
+
this.streamTypeLive = false;
|
|
359
|
+
this.working = false;
|
|
360
|
+
this.eventId = null;
|
|
352
361
|
debug(`[${this.sessionId}]: [ ERROR Switching from LIVE->V2L ]`);
|
|
353
362
|
throw new Error(err);
|
|
354
363
|
}
|
|
@@ -389,6 +398,9 @@ class StreamSwitcher {
|
|
|
389
398
|
debug(`[${this.sessionId}]: Switched from LIVE->VOD`);
|
|
390
399
|
return false;
|
|
391
400
|
} catch (err) {
|
|
401
|
+
this.streamTypeLive = false;
|
|
402
|
+
this.working = false;
|
|
403
|
+
this.eventId = null;
|
|
392
404
|
debug(`[${this.sessionId}]: [ ERROR Switching from LIVE->VOD ]`);
|
|
393
405
|
throw new Error(err);
|
|
394
406
|
}
|
|
@@ -425,6 +437,9 @@ class StreamSwitcher {
|
|
|
425
437
|
debug(`[${this.sessionId}]: Switched from LIVE->LIVE`);
|
|
426
438
|
return true;
|
|
427
439
|
} catch (err) {
|
|
440
|
+
this.streamTypeLive = false;
|
|
441
|
+
this.working = false;
|
|
442
|
+
this.eventId = null;
|
|
428
443
|
debug(`[${this.sessionId}]: [ ERROR Switching from LIVE->LIVE ]`);
|
|
429
444
|
throw new Error(err);
|
|
430
445
|
}
|