@eluvio/elv-client-js 4.0.147 → 4.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/dist/ElvClient-min.js +2 -67
- package/dist/ElvClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvClient-node-min.js +2 -66
- package/dist/ElvClient-node-min.js.LICENSE.txt +72 -0
- package/dist/ElvFrameClient-min.js +2 -60
- package/dist/ElvFrameClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvPermissionsClient-min.js +2 -60
- package/dist/ElvPermissionsClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-min.js +2 -67
- package/dist/ElvWalletClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-node-min.js +2 -66
- package/dist/ElvWalletClient-node-min.js.LICENSE.txt +72 -0
- package/dist/src/AuthorizationClient.js +713 -715
- package/dist/src/ContentObjectAudit.js +59 -59
- package/dist/src/Crypto.js +85 -86
- package/dist/src/ElvClient.js +532 -501
- package/dist/src/ElvWallet.js +30 -28
- package/dist/src/EthClient.js +316 -316
- package/dist/src/FrameClient.js +70 -71
- package/dist/src/HttpClient.js +60 -60
- package/dist/src/Id.js +1 -2
- package/dist/src/PermissionsClient.js +501 -489
- package/dist/src/RemoteSigner.js +83 -84
- package/dist/src/UserProfileClient.js +392 -374
- package/dist/src/Utils.js +67 -67
- package/dist/src/Validation.js +20 -12
- package/dist/src/client/ABRPublishing.js +412 -356
- package/dist/src/client/AccessGroups.js +479 -476
- package/dist/src/client/ContentAccess.js +1750 -1804
- package/dist/src/client/ContentManagement.js +874 -874
- package/dist/src/client/Contracts.js +586 -590
- package/dist/src/client/Files.js +702 -686
- package/dist/src/client/LiveConf.js +3 -5
- package/dist/src/client/LiveStream.js +659 -652
- package/dist/src/client/NFT.js +16 -16
- package/dist/src/client/NTP.js +84 -84
- package/dist/src/client/Shares.js +51 -51
- package/dist/src/walletClient/ClientMethods.js +979 -953
- package/dist/src/walletClient/Notifications.js +14 -14
- package/dist/src/walletClient/Profile.js +68 -68
- package/dist/src/walletClient/Utils.js +17 -17
- package/dist/src/walletClient/index.js +574 -564
- package/package.json +17 -16
- package/src/client/AccessGroups.js +1 -1
- package/testScripts/Test.js +5 -1
- package/webpack.config.js +10 -13
- package/dist/src/ContentObjectVerification.js +0 -281
|
@@ -22,13 +22,13 @@ var _require2 = require("../Validation"),
|
|
|
22
22
|
ValidatePresence = _require2.ValidatePresence;
|
|
23
23
|
var ContentObjectAudit = require("../ContentObjectAudit");
|
|
24
24
|
var MakeTxLessToken = /*#__PURE__*/function () {
|
|
25
|
-
var _ref2 = _asyncToGenerator(
|
|
25
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
26
26
|
var client, libraryId, objectId, versionHash, tok;
|
|
27
|
-
return _regeneratorRuntime.wrap(function
|
|
27
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
30
30
|
client = _ref.client, libraryId = _ref.libraryId, objectId = _ref.objectId, versionHash = _ref.versionHash;
|
|
31
|
-
_context.next =
|
|
31
|
+
_context.next = 1;
|
|
32
32
|
return client.authClient.AuthorizationToken({
|
|
33
33
|
libraryId: libraryId,
|
|
34
34
|
objectId: objectId,
|
|
@@ -37,10 +37,10 @@ var MakeTxLessToken = /*#__PURE__*/function () {
|
|
|
37
37
|
noCache: true,
|
|
38
38
|
noAuth: true
|
|
39
39
|
});
|
|
40
|
-
case
|
|
40
|
+
case 1:
|
|
41
41
|
tok = _context.sent;
|
|
42
42
|
return _context.abrupt("return", tok);
|
|
43
|
-
case
|
|
43
|
+
case 2:
|
|
44
44
|
case "end":
|
|
45
45
|
return _context.stop();
|
|
46
46
|
}
|
|
@@ -56,81 +56,81 @@ var Sleep = function Sleep(ms) {
|
|
|
56
56
|
});
|
|
57
57
|
};
|
|
58
58
|
var CueInfo = /*#__PURE__*/function () {
|
|
59
|
-
var _ref4 = _asyncToGenerator(
|
|
60
|
-
var eventId, status, cues, lroStatusResponse, eventStart, eventEnd, _i, _Object$values, value, _i2, _Object$values2, event;
|
|
61
|
-
return _regeneratorRuntime.wrap(function
|
|
59
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
60
|
+
var eventId, status, cues, lroStatusResponse, eventStart, eventEnd, _i, _Object$values, value, _i2, _Object$values2, event, _t, _t2, _t3, _t4;
|
|
61
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
62
62
|
while (1) switch (_context2.prev = _context2.next) {
|
|
63
63
|
case 0:
|
|
64
64
|
eventId = _ref3.eventId, status = _ref3.status;
|
|
65
65
|
_context2.prev = 1;
|
|
66
|
-
|
|
67
|
-
_context2.next =
|
|
66
|
+
_t = _this.utils;
|
|
67
|
+
_context2.next = 2;
|
|
68
68
|
return HttpClient.Fetch(status.lro_status_url);
|
|
69
|
-
case
|
|
70
|
-
|
|
71
|
-
_context2.next =
|
|
72
|
-
return
|
|
73
|
-
case
|
|
69
|
+
case 2:
|
|
70
|
+
_t2 = _context2.sent;
|
|
71
|
+
_context2.next = 3;
|
|
72
|
+
return _t.ResponseToJson.call(_t, _t2);
|
|
73
|
+
case 3:
|
|
74
74
|
lroStatusResponse = _context2.sent;
|
|
75
75
|
console.log("lroStatusResponse", lroStatusResponse);
|
|
76
76
|
cues = lroStatusResponse.custom.cues;
|
|
77
|
-
_context2.next =
|
|
77
|
+
_context2.next = 5;
|
|
78
78
|
break;
|
|
79
|
-
case
|
|
80
|
-
_context2.prev =
|
|
81
|
-
|
|
82
|
-
console.log("LRO status failed",
|
|
79
|
+
case 4:
|
|
80
|
+
_context2.prev = 4;
|
|
81
|
+
_t3 = _context2["catch"](1);
|
|
82
|
+
console.log("LRO status failed", _t3);
|
|
83
83
|
return _context2.abrupt("return", {
|
|
84
84
|
error: "failed to retrieve status",
|
|
85
85
|
eventId: eventId
|
|
86
86
|
});
|
|
87
|
-
case
|
|
87
|
+
case 5:
|
|
88
88
|
_i = 0, _Object$values = Object.values(cues);
|
|
89
|
-
case
|
|
89
|
+
case 6:
|
|
90
90
|
if (!(_i < _Object$values.length)) {
|
|
91
|
-
_context2.next =
|
|
91
|
+
_context2.next = 12;
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
94
|
value = _Object$values[_i];
|
|
95
95
|
_i2 = 0, _Object$values2 = Object.values(value.descriptors);
|
|
96
|
-
case
|
|
96
|
+
case 7:
|
|
97
97
|
if (!(_i2 < _Object$values2.length)) {
|
|
98
|
-
_context2.next =
|
|
98
|
+
_context2.next = 11;
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
101
101
|
event = _Object$values2[_i2];
|
|
102
102
|
if (!(event.id == eventId)) {
|
|
103
|
-
_context2.next =
|
|
103
|
+
_context2.next = 10;
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
_context2.next =
|
|
106
|
+
_t4 = event.type_id;
|
|
107
|
+
_context2.next = _t4 === 32 ? 8 : _t4 === 16 ? 8 : _t4 === 33 ? 9 : _t4 === 17 ? 9 : 10;
|
|
108
108
|
break;
|
|
109
|
-
case
|
|
109
|
+
case 8:
|
|
110
110
|
eventStart = value.insertion_time;
|
|
111
|
-
return _context2.abrupt("
|
|
112
|
-
case
|
|
111
|
+
return _context2.abrupt("continue", 10);
|
|
112
|
+
case 9:
|
|
113
113
|
eventEnd = value.insertion_time;
|
|
114
|
-
return _context2.abrupt("
|
|
115
|
-
case
|
|
114
|
+
return _context2.abrupt("continue", 10);
|
|
115
|
+
case 10:
|
|
116
116
|
_i2++;
|
|
117
|
-
_context2.next =
|
|
117
|
+
_context2.next = 7;
|
|
118
118
|
break;
|
|
119
|
-
case
|
|
119
|
+
case 11:
|
|
120
120
|
_i++;
|
|
121
|
-
_context2.next =
|
|
121
|
+
_context2.next = 6;
|
|
122
122
|
break;
|
|
123
|
-
case
|
|
123
|
+
case 12:
|
|
124
124
|
return _context2.abrupt("return", {
|
|
125
125
|
eventStart: eventStart,
|
|
126
126
|
eventEnd: eventEnd,
|
|
127
127
|
eventId: eventId
|
|
128
128
|
});
|
|
129
|
-
case
|
|
129
|
+
case 13:
|
|
130
130
|
case "end":
|
|
131
131
|
return _context2.stop();
|
|
132
132
|
}
|
|
133
|
-
}, _callee2, null, [[1,
|
|
133
|
+
}, _callee2, null, [[1, 4]]);
|
|
134
134
|
}));
|
|
135
135
|
return function CueInfo(_x2) {
|
|
136
136
|
return _ref4.apply(this, arguments);
|
|
@@ -166,9 +166,9 @@ var CueInfo = /*#__PURE__*/function () {
|
|
|
166
166
|
* @return {Promise<string>} - Final hash of the live stream object
|
|
167
167
|
*/
|
|
168
168
|
var StreamGenerateOffering = /*#__PURE__*/function () {
|
|
169
|
-
var _ref6 = _asyncToGenerator(
|
|
169
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
170
170
|
var client, libraryId, objectId, typeAbrMaster, typeLiveStream, streamUrl, abrProfile, aBitRate, aChannels, aSampleRate, aStreamIndex, aTimeBase, aChannelLayout, vBitRate, vHeight, vStreamIndex, vWidth, vDisplayAspectRatio, vFrameRate, vTimeBase, DUMMY_DURATION, aDurationTs, vDurationTs, sourceAudioStream, sourceVideoStream, DUMMY_STREAM, sourceStreams, maxStreamIndex, i, sources, variants, production_master, metadata, editResponse, writeToken, finalizeResponse, masterVersionHash, createResponse, versionHash, finalHash;
|
|
171
|
-
return _regeneratorRuntime.wrap(function
|
|
171
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
172
172
|
while (1) switch (_context3.prev = _context3.next) {
|
|
173
173
|
case 0:
|
|
174
174
|
client = _ref5.client, libraryId = _ref5.libraryId, objectId = _ref5.objectId, typeAbrMaster = _ref5.typeAbrMaster, typeLiveStream = _ref5.typeLiveStream, streamUrl = _ref5.streamUrl, abrProfile = _ref5.abrProfile, aBitRate = _ref5.aBitRate, aChannels = _ref5.aChannels, aSampleRate = _ref5.aSampleRate, aStreamIndex = _ref5.aStreamIndex, aTimeBase = _ref5.aTimeBase, aChannelLayout = _ref5.aChannelLayout, vBitRate = _ref5.vBitRate, vHeight = _ref5.vHeight, vStreamIndex = _ref5.vStreamIndex, vWidth = _ref5.vWidth, vDisplayAspectRatio = _ref5.vDisplayAspectRatio, vFrameRate = _ref5.vFrameRate, vTimeBase = _ref5.vTimeBase;
|
|
@@ -278,19 +278,19 @@ var StreamGenerateOffering = /*#__PURE__*/function () {
|
|
|
278
278
|
variants: variants
|
|
279
279
|
}; // get existing metadata
|
|
280
280
|
console.log("Retrieving current metadata...");
|
|
281
|
-
_context3.next =
|
|
281
|
+
_context3.next = 1;
|
|
282
282
|
return client.ContentObjectMetadata({
|
|
283
283
|
libraryId: libraryId,
|
|
284
284
|
objectId: objectId
|
|
285
285
|
});
|
|
286
|
-
case
|
|
286
|
+
case 1:
|
|
287
287
|
metadata = _context3.sent;
|
|
288
288
|
// add /production_master to metadata
|
|
289
289
|
metadata.production_master = production_master;
|
|
290
290
|
|
|
291
291
|
// write back to object
|
|
292
292
|
console.log("Getting write token...");
|
|
293
|
-
_context3.next =
|
|
293
|
+
_context3.next = 2;
|
|
294
294
|
return client.EditContentObject({
|
|
295
295
|
libraryId: libraryId,
|
|
296
296
|
objectId: objectId,
|
|
@@ -298,33 +298,33 @@ var StreamGenerateOffering = /*#__PURE__*/function () {
|
|
|
298
298
|
type: typeAbrMaster
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
|
-
case
|
|
301
|
+
case 2:
|
|
302
302
|
editResponse = _context3.sent;
|
|
303
303
|
writeToken = editResponse.write_token;
|
|
304
304
|
console.log("New write token: ".concat(writeToken));
|
|
305
305
|
console.log("Writing back metadata with /production_master added...");
|
|
306
|
-
_context3.next =
|
|
306
|
+
_context3.next = 3;
|
|
307
307
|
return client.ReplaceMetadata({
|
|
308
308
|
libraryId: libraryId,
|
|
309
309
|
metadata: metadata,
|
|
310
310
|
objectId: objectId,
|
|
311
311
|
writeToken: writeToken
|
|
312
312
|
});
|
|
313
|
-
case
|
|
313
|
+
case 3:
|
|
314
314
|
console.log("Finalizing...");
|
|
315
|
-
_context3.next =
|
|
315
|
+
_context3.next = 4;
|
|
316
316
|
return client.FinalizeContentObject({
|
|
317
317
|
libraryId: libraryId,
|
|
318
318
|
objectId: objectId,
|
|
319
319
|
writeToken: writeToken
|
|
320
320
|
});
|
|
321
|
-
case
|
|
321
|
+
case 4:
|
|
322
322
|
finalizeResponse = _context3.sent;
|
|
323
323
|
masterVersionHash = finalizeResponse.hash;
|
|
324
324
|
console.log("Finalized, new version hash: ".concat(masterVersionHash));
|
|
325
325
|
|
|
326
326
|
// Generate offering
|
|
327
|
-
_context3.next =
|
|
327
|
+
_context3.next = 5;
|
|
328
328
|
return client.CreateABRMezzanine({
|
|
329
329
|
libraryId: libraryId,
|
|
330
330
|
objectId: objectId,
|
|
@@ -333,7 +333,7 @@ var StreamGenerateOffering = /*#__PURE__*/function () {
|
|
|
333
333
|
offeringKey: "default",
|
|
334
334
|
abrProfile: abrProfile
|
|
335
335
|
});
|
|
336
|
-
case
|
|
336
|
+
case 5:
|
|
337
337
|
createResponse = _context3.sent;
|
|
338
338
|
if (createResponse.warnings.length > 0) {
|
|
339
339
|
console.log("WARNINGS:");
|
|
@@ -348,12 +348,12 @@ var StreamGenerateOffering = /*#__PURE__*/function () {
|
|
|
348
348
|
|
|
349
349
|
// get new metadata
|
|
350
350
|
console.log("Retrieving revised metadata with offering...");
|
|
351
|
-
_context3.next =
|
|
351
|
+
_context3.next = 6;
|
|
352
352
|
return client.ContentObjectMetadata({
|
|
353
353
|
libraryId: libraryId,
|
|
354
354
|
versionHash: versionHash
|
|
355
355
|
});
|
|
356
|
-
case
|
|
356
|
+
case 6:
|
|
357
357
|
metadata = _context3.sent;
|
|
358
358
|
console.log("Moving /abr_mezzanine/offerings to /offerings and removing /abr_mezzanine...");
|
|
359
359
|
metadata.offerings = metadata.abr_mezzanine.offerings;
|
|
@@ -364,7 +364,7 @@ var StreamGenerateOffering = /*#__PURE__*/function () {
|
|
|
364
364
|
|
|
365
365
|
// write back to object
|
|
366
366
|
console.log("Getting write token...");
|
|
367
|
-
_context3.next =
|
|
367
|
+
_context3.next = 7;
|
|
368
368
|
return client.EditContentObject({
|
|
369
369
|
libraryId: libraryId,
|
|
370
370
|
objectId: objectId,
|
|
@@ -372,32 +372,32 @@ var StreamGenerateOffering = /*#__PURE__*/function () {
|
|
|
372
372
|
type: typeLiveStream
|
|
373
373
|
}
|
|
374
374
|
});
|
|
375
|
-
case
|
|
375
|
+
case 7:
|
|
376
376
|
editResponse = _context3.sent;
|
|
377
377
|
writeToken = editResponse.write_token;
|
|
378
378
|
console.log("New write token: ".concat(writeToken));
|
|
379
379
|
console.log("Writing back metadata with /offerings...");
|
|
380
|
-
_context3.next =
|
|
380
|
+
_context3.next = 8;
|
|
381
381
|
return client.ReplaceMetadata({
|
|
382
382
|
libraryId: libraryId,
|
|
383
383
|
metadata: metadata,
|
|
384
384
|
objectId: objectId,
|
|
385
385
|
writeToken: writeToken
|
|
386
386
|
});
|
|
387
|
-
case
|
|
387
|
+
case 8:
|
|
388
388
|
console.log("Finalizing...");
|
|
389
|
-
_context3.next =
|
|
389
|
+
_context3.next = 9;
|
|
390
390
|
return client.FinalizeContentObject({
|
|
391
391
|
libraryId: libraryId,
|
|
392
392
|
objectId: objectId,
|
|
393
393
|
writeToken: writeToken
|
|
394
394
|
});
|
|
395
|
-
case
|
|
395
|
+
case 9:
|
|
396
396
|
finalizeResponse = _context3.sent;
|
|
397
397
|
finalHash = finalizeResponse.hash;
|
|
398
398
|
console.log("Finalized, new version hash: ".concat(finalHash));
|
|
399
399
|
return _context3.abrupt("return", finalHash);
|
|
400
|
-
case
|
|
400
|
+
case 10:
|
|
401
401
|
case "end":
|
|
402
402
|
return _context3.stop();
|
|
403
403
|
}
|
|
@@ -428,9 +428,9 @@ var StreamGenerateOffering = /*#__PURE__*/function () {
|
|
|
428
428
|
* @return {Promise<Object>} - The status response for the object, as well as logs, warnings and errors from the master initialization
|
|
429
429
|
*/
|
|
430
430
|
exports.StreamStatus = /*#__PURE__*/function () {
|
|
431
|
-
var _ref8 = _asyncToGenerator(
|
|
432
|
-
var name, _ref7$stopLro, stopLro, _ref7$showParams, showParams, objectId, status, libraryId, mainMeta, fabURI, edgeWriteToken, edgeMeta, recordings, sequence, period, tlro, videoLastFinalizationTimeEpochSec, videoFinalizedParts, sinceLastFinalize, recording_period, insertions, i, insertionTimeSinceEpoch, state, lroStatus, segDurationMeta, playout_urls, playout_options, hls_clear_enabled, hls_aes128_enabled, hls_sample_aes_enabled, networkInfo, token, embed_net, embed_url;
|
|
433
|
-
return _regeneratorRuntime.wrap(function
|
|
431
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
|
|
432
|
+
var name, _ref7$stopLro, stopLro, _ref7$showParams, showParams, objectId, status, libraryId, mainMeta, fabURI, edgeWriteToken, edgeMeta, recordings, sequence, period, tlro, videoLastFinalizationTimeEpochSec, videoFinalizedParts, sinceLastFinalize, recording_period, insertions, i, insertionTimeSinceEpoch, state, lroStatus, segDurationMeta, playout_urls, playout_options, hls_clear_enabled, hls_aes128_enabled, hls_sample_aes_enabled, networkInfo, token, embed_net, embed_url, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10;
|
|
433
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
434
434
|
while (1) switch (_context4.prev = _context4.next) {
|
|
435
435
|
case 0:
|
|
436
436
|
name = _ref7.name, _ref7$stopLro = _ref7.stopLro, stopLro = _ref7$stopLro === void 0 ? false : _ref7$stopLro, _ref7$showParams = _ref7.showParams, showParams = _ref7$showParams === void 0 ? false : _ref7$showParams;
|
|
@@ -438,47 +438,47 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
438
438
|
status = {
|
|
439
439
|
name: name
|
|
440
440
|
};
|
|
441
|
-
_context4.prev =
|
|
442
|
-
_context4.next =
|
|
441
|
+
_context4.prev = 1;
|
|
442
|
+
_context4.next = 2;
|
|
443
443
|
return this.ContentObjectLibraryId({
|
|
444
444
|
objectId: objectId
|
|
445
445
|
});
|
|
446
|
-
case
|
|
446
|
+
case 2:
|
|
447
447
|
libraryId = _context4.sent;
|
|
448
448
|
status.library_id = libraryId;
|
|
449
449
|
status.object_id = objectId;
|
|
450
|
-
_context4.next =
|
|
450
|
+
_context4.next = 3;
|
|
451
451
|
return this.ContentObjectMetadata({
|
|
452
452
|
libraryId: libraryId,
|
|
453
453
|
objectId: objectId,
|
|
454
454
|
select: ["live_recording_config", "live_recording"]
|
|
455
455
|
});
|
|
456
|
-
case
|
|
456
|
+
case 3:
|
|
457
457
|
mainMeta = _context4.sent;
|
|
458
458
|
status.reference_url = mainMeta.live_recording_config.reference_url;
|
|
459
459
|
if (!(mainMeta.live_recording_config == undefined || mainMeta.live_recording_config.url == undefined)) {
|
|
460
|
-
_context4.next =
|
|
460
|
+
_context4.next = 4;
|
|
461
461
|
break;
|
|
462
462
|
}
|
|
463
463
|
status.state = "unconfigured";
|
|
464
464
|
return _context4.abrupt("return", status);
|
|
465
|
-
case
|
|
465
|
+
case 4:
|
|
466
466
|
if (!(mainMeta.live_recording == undefined || mainMeta.live_recording.fabric_config == undefined || mainMeta.live_recording.playout_config == undefined || mainMeta.live_recording.recording_config == undefined)) {
|
|
467
|
-
_context4.next =
|
|
467
|
+
_context4.next = 5;
|
|
468
468
|
break;
|
|
469
469
|
}
|
|
470
470
|
status.state = "uninitialized";
|
|
471
471
|
return _context4.abrupt("return", status);
|
|
472
|
-
case
|
|
472
|
+
case 5:
|
|
473
473
|
fabURI = mainMeta.live_recording.fabric_config.ingress_node_api;
|
|
474
474
|
if (!(fabURI === undefined)) {
|
|
475
|
-
_context4.next =
|
|
475
|
+
_context4.next = 6;
|
|
476
476
|
break;
|
|
477
477
|
}
|
|
478
478
|
console.log("bad fabric config - missing ingress node API");
|
|
479
479
|
status.state = "uninitialized";
|
|
480
480
|
return _context4.abrupt("return", status);
|
|
481
|
-
case
|
|
481
|
+
case 6:
|
|
482
482
|
// Support both hostname and URL ingress_node_api
|
|
483
483
|
if (!fabURI.startsWith("http")) {
|
|
484
484
|
// Assume https
|
|
@@ -488,52 +488,52 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
488
488
|
status.url = mainMeta.live_recording.recording_config.recording_params.origin_url;
|
|
489
489
|
edgeWriteToken = mainMeta.live_recording.fabric_config.edge_write_token;
|
|
490
490
|
if (edgeWriteToken) {
|
|
491
|
-
_context4.next =
|
|
491
|
+
_context4.next = 7;
|
|
492
492
|
break;
|
|
493
493
|
}
|
|
494
494
|
status.state = "inactive";
|
|
495
495
|
return _context4.abrupt("return", status);
|
|
496
|
-
case
|
|
496
|
+
case 7:
|
|
497
497
|
this.RecordWriteToken({
|
|
498
498
|
writeToken: edgeWriteToken,
|
|
499
499
|
fabricNodeUrl: fabURI
|
|
500
500
|
});
|
|
501
501
|
status.edge_write_token = edgeWriteToken;
|
|
502
502
|
status.stream_id = edgeWriteToken; // By convention the stream ID is its write token
|
|
503
|
-
_context4.prev =
|
|
504
|
-
_context4.next =
|
|
503
|
+
_context4.prev = 8;
|
|
504
|
+
_context4.next = 9;
|
|
505
505
|
return this.ContentObjectMetadata({
|
|
506
506
|
libraryId: libraryId,
|
|
507
507
|
objectId: objectId,
|
|
508
508
|
writeToken: edgeWriteToken,
|
|
509
509
|
select: ["live_recording"]
|
|
510
510
|
});
|
|
511
|
-
case
|
|
511
|
+
case 9:
|
|
512
512
|
edgeMeta = _context4.sent;
|
|
513
|
-
_context4.next =
|
|
513
|
+
_context4.next = 11;
|
|
514
514
|
break;
|
|
515
|
-
case
|
|
516
|
-
_context4.prev =
|
|
517
|
-
|
|
518
|
-
if (
|
|
515
|
+
case 10:
|
|
516
|
+
_context4.prev = 10;
|
|
517
|
+
_t5 = _context4["catch"](8);
|
|
518
|
+
if (_t5.message && _t5.message.includes("ERR_TOO_MANY_REDIRECTS")) {
|
|
519
519
|
console.error("Redirect loop detected when trying to read metadata.");
|
|
520
520
|
status.state = "unavailable";
|
|
521
521
|
} else {
|
|
522
|
-
console.error("Unable to read edge write token metadata. Has token been deleted?",
|
|
522
|
+
console.error("Unable to read edge write token metadata. Has token been deleted?", _t5);
|
|
523
523
|
status.state = "inactive";
|
|
524
524
|
}
|
|
525
525
|
return _context4.abrupt("return", status);
|
|
526
|
-
case
|
|
526
|
+
case 11:
|
|
527
527
|
status.edge_meta_size = JSON.stringify(edgeMeta || "").length;
|
|
528
528
|
|
|
529
529
|
// If a stream has never been started return state 'inactive'
|
|
530
530
|
if (!(edgeMeta.live_recording === undefined || edgeMeta.live_recording.recordings === undefined || edgeMeta.live_recording.recordings.recording_sequence === undefined)) {
|
|
531
|
-
_context4.next =
|
|
531
|
+
_context4.next = 12;
|
|
532
532
|
break;
|
|
533
533
|
}
|
|
534
534
|
status.state = "stopped";
|
|
535
535
|
return _context4.abrupt("return", status);
|
|
536
|
-
case
|
|
536
|
+
case 12:
|
|
537
537
|
recordings = edgeMeta.live_recording.recordings;
|
|
538
538
|
status.recording_period_sequence = recordings.recording_sequence;
|
|
539
539
|
sequence = recordings.recording_sequence;
|
|
@@ -559,14 +559,14 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
559
559
|
video_since_last_finalize_sec: sinceLastFinalize
|
|
560
560
|
};
|
|
561
561
|
status.recording_period = recording_period;
|
|
562
|
-
_context4.next =
|
|
562
|
+
_context4.next = 13;
|
|
563
563
|
return this.FabricUrl({
|
|
564
564
|
libraryId: libraryId,
|
|
565
565
|
objectId: objectId,
|
|
566
566
|
writeToken: edgeWriteToken,
|
|
567
567
|
call: "live/status/" + tlro
|
|
568
568
|
});
|
|
569
|
-
case
|
|
569
|
+
case 13:
|
|
570
570
|
status.lro_status_url = _context4.sent;
|
|
571
571
|
status.insertions = [];
|
|
572
572
|
if (edgeMeta.live_recording.playout_config.interleaves != undefined && edgeMeta.live_recording.playout_config.interleaves[sequence] != undefined) {
|
|
@@ -586,15 +586,15 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
586
586
|
}
|
|
587
587
|
state = "stopped";
|
|
588
588
|
lroStatus = "";
|
|
589
|
-
_context4.prev =
|
|
590
|
-
|
|
591
|
-
_context4.next =
|
|
589
|
+
_context4.prev = 14;
|
|
590
|
+
_t6 = this.utils;
|
|
591
|
+
_context4.next = 15;
|
|
592
592
|
return HttpClient.Fetch(status.lro_status_url);
|
|
593
|
-
case
|
|
594
|
-
|
|
595
|
-
_context4.next =
|
|
596
|
-
return
|
|
597
|
-
case
|
|
593
|
+
case 15:
|
|
594
|
+
_t7 = _context4.sent;
|
|
595
|
+
_context4.next = 16;
|
|
596
|
+
return _t6.ResponseToJson.call(_t6, _t7);
|
|
597
|
+
case 16:
|
|
598
598
|
lroStatus = _context4.sent;
|
|
599
599
|
state = lroStatus.state;
|
|
600
600
|
status.warnings = lroStatus.custom && lroStatus.custom.warnings;
|
|
@@ -602,16 +602,16 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
602
602
|
if (lroStatus.custom && lroStatus.custom.status) {
|
|
603
603
|
status.recording_status = lroStatus.custom.status;
|
|
604
604
|
}
|
|
605
|
-
_context4.next =
|
|
605
|
+
_context4.next = 18;
|
|
606
606
|
break;
|
|
607
|
-
case
|
|
608
|
-
_context4.prev =
|
|
609
|
-
|
|
610
|
-
console.log("LRO Status (failed): ",
|
|
607
|
+
case 17:
|
|
608
|
+
_context4.prev = 17;
|
|
609
|
+
_t8 = _context4["catch"](14);
|
|
610
|
+
console.log("LRO Status (failed): ", _t8.response.statusCode);
|
|
611
611
|
status.state = "stopped";
|
|
612
|
-
status.error =
|
|
612
|
+
status.error = _t8.response;
|
|
613
613
|
return _context4.abrupt("return", status);
|
|
614
|
-
case
|
|
614
|
+
case 18:
|
|
615
615
|
segDurationMeta = edgeMeta.live_recording.recording_config.recording_params.xc_params.seg_duration; // Convert LRO 'state' to desired 'state'
|
|
616
616
|
if (state === "running" && videoLastFinalizationTimeEpochSec <= 0) {
|
|
617
617
|
state = "starting";
|
|
@@ -622,97 +622,97 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
622
622
|
}
|
|
623
623
|
status.state = state;
|
|
624
624
|
if (!((state === "running" || state === "stalled" || state === "starting") && stopLro)) {
|
|
625
|
-
_context4.next =
|
|
625
|
+
_context4.next = 25;
|
|
626
626
|
break;
|
|
627
627
|
}
|
|
628
|
-
_context4.next =
|
|
628
|
+
_context4.next = 19;
|
|
629
629
|
return this.FabricUrl({
|
|
630
630
|
libraryId: libraryId,
|
|
631
631
|
objectId: objectId,
|
|
632
632
|
writeToken: edgeWriteToken,
|
|
633
633
|
call: "live/stop/" + tlro
|
|
634
634
|
});
|
|
635
|
-
case
|
|
635
|
+
case 19:
|
|
636
636
|
lroStopUrl = _context4.sent;
|
|
637
|
-
_context4.prev =
|
|
638
|
-
|
|
639
|
-
_context4.next =
|
|
637
|
+
_context4.prev = 20;
|
|
638
|
+
_t9 = this.utils;
|
|
639
|
+
_context4.next = 21;
|
|
640
640
|
return HttpClient.Fetch(lroStopUrl);
|
|
641
|
-
case
|
|
642
|
-
|
|
643
|
-
_context4.next =
|
|
644
|
-
return
|
|
645
|
-
case
|
|
641
|
+
case 21:
|
|
642
|
+
_t0 = _context4.sent;
|
|
643
|
+
_context4.next = 22;
|
|
644
|
+
return _t9.ResponseToJson.call(_t9, _t0);
|
|
645
|
+
case 22:
|
|
646
646
|
console.log("LRO Stop: ", lroStatus.body);
|
|
647
|
-
_context4.next =
|
|
647
|
+
_context4.next = 24;
|
|
648
648
|
break;
|
|
649
|
-
case
|
|
650
|
-
_context4.prev =
|
|
651
|
-
|
|
652
|
-
console.log("LRO Stop (failed): ",
|
|
653
|
-
case
|
|
649
|
+
case 23:
|
|
650
|
+
_context4.prev = 23;
|
|
651
|
+
_t1 = _context4["catch"](20);
|
|
652
|
+
console.log("LRO Stop (failed): ", _t1.response.statusCode);
|
|
653
|
+
case 24:
|
|
654
654
|
state = "stopped";
|
|
655
655
|
status.state = state;
|
|
656
|
-
case
|
|
656
|
+
case 25:
|
|
657
657
|
if (!(state === "running")) {
|
|
658
|
-
_context4.next =
|
|
658
|
+
_context4.next = 35;
|
|
659
659
|
break;
|
|
660
660
|
}
|
|
661
661
|
playout_urls = {};
|
|
662
|
-
_context4.next =
|
|
662
|
+
_context4.next = 26;
|
|
663
663
|
return this.PlayoutOptions({
|
|
664
664
|
objectId: objectId,
|
|
665
665
|
linkPath: "public/asset_metadata/sources/default"
|
|
666
666
|
});
|
|
667
|
-
case
|
|
667
|
+
case 26:
|
|
668
668
|
playout_options = _context4.sent;
|
|
669
669
|
hls_clear_enabled = playout_options && playout_options.hls && playout_options.hls.playoutMethods && playout_options.hls.playoutMethods.clear !== undefined;
|
|
670
670
|
if (!hls_clear_enabled) {
|
|
671
|
-
_context4.next =
|
|
671
|
+
_context4.next = 28;
|
|
672
672
|
break;
|
|
673
673
|
}
|
|
674
|
-
_context4.next =
|
|
674
|
+
_context4.next = 27;
|
|
675
675
|
return this.FabricUrl({
|
|
676
676
|
libraryId: libraryId,
|
|
677
677
|
objectId: objectId,
|
|
678
678
|
rep: "playout/default/hls-clear/playlist.m3u8"
|
|
679
679
|
});
|
|
680
|
-
case
|
|
680
|
+
case 27:
|
|
681
681
|
playout_urls.hls_clear = _context4.sent;
|
|
682
|
-
case
|
|
682
|
+
case 28:
|
|
683
683
|
hls_aes128_enabled = playout_options && playout_options.hls && playout_options.hls.playoutMethods && playout_options.hls.playoutMethods["aes-128"] !== undefined;
|
|
684
684
|
if (!hls_aes128_enabled) {
|
|
685
|
-
_context4.next =
|
|
685
|
+
_context4.next = 30;
|
|
686
686
|
break;
|
|
687
687
|
}
|
|
688
|
-
_context4.next =
|
|
688
|
+
_context4.next = 29;
|
|
689
689
|
return this.FabricUrl({
|
|
690
690
|
libraryId: libraryId,
|
|
691
691
|
objectId: objectId,
|
|
692
692
|
rep: "playout/default/hls-aes128/playlist.m3u8"
|
|
693
693
|
});
|
|
694
|
-
case
|
|
694
|
+
case 29:
|
|
695
695
|
playout_urls.hls_aes128 = _context4.sent;
|
|
696
|
-
case
|
|
696
|
+
case 30:
|
|
697
697
|
hls_sample_aes_enabled = playout_options && playout_options.hls && playout_options.hls.playoutMethods && playout_options.hls.playoutMethods["sample-aes"] !== undefined;
|
|
698
698
|
if (!hls_sample_aes_enabled) {
|
|
699
|
-
_context4.next =
|
|
699
|
+
_context4.next = 32;
|
|
700
700
|
break;
|
|
701
701
|
}
|
|
702
|
-
_context4.next =
|
|
702
|
+
_context4.next = 31;
|
|
703
703
|
return this.FabricUrl({
|
|
704
704
|
libraryId: libraryId,
|
|
705
705
|
objectId: objectId,
|
|
706
706
|
rep: "playout/default/hls-sample-aes/playlist.m3u8"
|
|
707
707
|
});
|
|
708
|
-
case
|
|
708
|
+
case 31:
|
|
709
709
|
playout_urls.hls_sample_aes = _context4.sent;
|
|
710
|
-
case
|
|
711
|
-
_context4.next =
|
|
710
|
+
case 32:
|
|
711
|
+
_context4.next = 33;
|
|
712
712
|
return this.NetworkInfo();
|
|
713
|
-
case
|
|
713
|
+
case 33:
|
|
714
714
|
networkInfo = _context4.sent;
|
|
715
|
-
_context4.next =
|
|
715
|
+
_context4.next = 34;
|
|
716
716
|
return this.authClient.AuthorizationToken({
|
|
717
717
|
libraryId: libraryId,
|
|
718
718
|
objectId: objectId,
|
|
@@ -720,7 +720,7 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
720
720
|
noCache: true,
|
|
721
721
|
noAuth: true
|
|
722
722
|
});
|
|
723
|
-
case
|
|
723
|
+
case 34:
|
|
724
724
|
token = _context4.sent;
|
|
725
725
|
embed_net = "main";
|
|
726
726
|
if (networkInfo.name.includes("demo")) {
|
|
@@ -729,20 +729,20 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
729
729
|
embed_url = "https://embed.v3.contentfabric.io/?net=".concat(embed_net, "&p&ct=h&oid=").concat(objectId, "&mt=lv&ath=").concat(token);
|
|
730
730
|
playout_urls.embed_url = embed_url;
|
|
731
731
|
status.playout_urls = playout_urls;
|
|
732
|
-
case
|
|
733
|
-
_context4.next =
|
|
732
|
+
case 35:
|
|
733
|
+
_context4.next = 37;
|
|
734
734
|
break;
|
|
735
|
-
case
|
|
736
|
-
_context4.prev =
|
|
737
|
-
|
|
738
|
-
console.error(
|
|
739
|
-
case
|
|
735
|
+
case 36:
|
|
736
|
+
_context4.prev = 36;
|
|
737
|
+
_t10 = _context4["catch"](1);
|
|
738
|
+
console.error(_t10);
|
|
739
|
+
case 37:
|
|
740
740
|
return _context4.abrupt("return", status);
|
|
741
|
-
case
|
|
741
|
+
case 38:
|
|
742
742
|
case "end":
|
|
743
743
|
return _context4.stop();
|
|
744
744
|
}
|
|
745
|
-
}, _callee4, this, [[
|
|
745
|
+
}, _callee4, this, [[1, 36], [8, 10], [14, 17], [20, 23]]);
|
|
746
746
|
}));
|
|
747
747
|
return function (_x4) {
|
|
748
748
|
return _ref8.apply(this, arguments);
|
|
@@ -761,42 +761,42 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
761
761
|
*
|
|
762
762
|
*/
|
|
763
763
|
exports.StreamCreate = /*#__PURE__*/function () {
|
|
764
|
-
var
|
|
764
|
+
var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
|
|
765
765
|
var name, _ref9$start, start, status, objectId, libraryId, liveRecording, fabURI, response, edgeToken, writeToken, objectHash;
|
|
766
|
-
return _regeneratorRuntime.wrap(function
|
|
766
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
767
767
|
while (1) switch (_context5.prev = _context5.next) {
|
|
768
768
|
case 0:
|
|
769
769
|
name = _ref9.name, _ref9$start = _ref9.start, start = _ref9$start === void 0 ? false : _ref9$start;
|
|
770
|
-
_context5.next =
|
|
770
|
+
_context5.next = 1;
|
|
771
771
|
return this.StreamStatus({
|
|
772
772
|
name: name
|
|
773
773
|
});
|
|
774
|
-
case
|
|
774
|
+
case 1:
|
|
775
775
|
status = _context5.sent;
|
|
776
776
|
if (!(status.state != "uninitialized" && status.state !== "inactive" && status.state !== "terminated" && status.state !== "stopped")) {
|
|
777
|
-
_context5.next =
|
|
777
|
+
_context5.next = 2;
|
|
778
778
|
break;
|
|
779
779
|
}
|
|
780
780
|
return _context5.abrupt("return", {
|
|
781
781
|
state: status.state,
|
|
782
782
|
error: "stream still active - must terminate first"
|
|
783
783
|
});
|
|
784
|
-
case
|
|
784
|
+
case 2:
|
|
785
785
|
objectId = status.object_id;
|
|
786
786
|
console.log("START: ", name, "start", start);
|
|
787
|
-
_context5.next =
|
|
787
|
+
_context5.next = 3;
|
|
788
788
|
return this.ContentObjectLibraryId({
|
|
789
789
|
objectId: objectId
|
|
790
790
|
});
|
|
791
|
-
case
|
|
791
|
+
case 3:
|
|
792
792
|
libraryId = _context5.sent;
|
|
793
|
-
_context5.next =
|
|
793
|
+
_context5.next = 4;
|
|
794
794
|
return this.ContentObjectMetadata({
|
|
795
795
|
libraryId: libraryId,
|
|
796
796
|
objectId: objectId,
|
|
797
797
|
metadataSubtree: "/live_recording"
|
|
798
798
|
});
|
|
799
|
-
case
|
|
799
|
+
case 4:
|
|
800
800
|
liveRecording = _context5.sent;
|
|
801
801
|
fabURI = liveRecording.fabric_config.ingress_node_api; // Support both hostname and URL ingress_node_api
|
|
802
802
|
if (!fabURI.startsWith("http")) {
|
|
@@ -807,12 +807,12 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
807
807
|
fabricURIs: [fabURI]
|
|
808
808
|
});
|
|
809
809
|
console.log("Node URI", fabURI, "ID", liveRecording.fabric_config.ingress_node_id);
|
|
810
|
-
_context5.next =
|
|
810
|
+
_context5.next = 5;
|
|
811
811
|
return this.EditContentObject({
|
|
812
812
|
libraryId: libraryId,
|
|
813
813
|
objectId: objectId
|
|
814
814
|
});
|
|
815
|
-
case
|
|
815
|
+
case 5:
|
|
816
816
|
response = _context5.sent;
|
|
817
817
|
edgeToken = response.write_token;
|
|
818
818
|
console.log("Edge token:", edgeToken);
|
|
@@ -820,16 +820,16 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
820
820
|
/*
|
|
821
821
|
* Set the metadata, including the edge token.
|
|
822
822
|
*/
|
|
823
|
-
_context5.next =
|
|
823
|
+
_context5.next = 6;
|
|
824
824
|
return this.EditContentObject({
|
|
825
825
|
libraryId: libraryId,
|
|
826
826
|
objectId: objectId
|
|
827
827
|
});
|
|
828
|
-
case
|
|
828
|
+
case 6:
|
|
829
829
|
response = _context5.sent;
|
|
830
830
|
writeToken = response.write_token;
|
|
831
831
|
this.Log("Merging metadata: ", libraryId, objectId, writeToken);
|
|
832
|
-
_context5.next =
|
|
832
|
+
_context5.next = 7;
|
|
833
833
|
return this.MergeMetadata({
|
|
834
834
|
libraryId: libraryId,
|
|
835
835
|
objectId: objectId,
|
|
@@ -840,23 +840,22 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
840
840
|
edge_write_token: edgeToken,
|
|
841
841
|
state: "active" // indicates there is an active session (set to 'closed' when done)
|
|
842
842
|
},
|
|
843
|
-
|
|
844
843
|
fabric_config: {
|
|
845
844
|
edge_write_token: edgeToken
|
|
846
845
|
}
|
|
847
846
|
}
|
|
848
847
|
}
|
|
849
848
|
});
|
|
850
|
-
case
|
|
849
|
+
case 7:
|
|
851
850
|
this.Log("Finalizing content draft: ", libraryId, objectId, writeToken);
|
|
852
|
-
_context5.next =
|
|
851
|
+
_context5.next = 8;
|
|
853
852
|
return this.FinalizeContentObject({
|
|
854
853
|
libraryId: libraryId,
|
|
855
854
|
objectId: objectId,
|
|
856
855
|
writeToken: writeToken,
|
|
857
856
|
commitMessage: "Create stream edge write token " + edgeToken
|
|
858
857
|
});
|
|
859
|
-
case
|
|
858
|
+
case 8:
|
|
860
859
|
response = _context5.sent;
|
|
861
860
|
objectHash = response.hash;
|
|
862
861
|
this.Log("Finalized object: ", objectHash);
|
|
@@ -876,14 +875,14 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
876
875
|
});
|
|
877
876
|
}
|
|
878
877
|
return _context5.abrupt("return", status);
|
|
879
|
-
case
|
|
878
|
+
case 9:
|
|
880
879
|
case "end":
|
|
881
880
|
return _context5.stop();
|
|
882
881
|
}
|
|
883
882
|
}, _callee5, this);
|
|
884
883
|
}));
|
|
885
884
|
return function (_x5) {
|
|
886
|
-
return
|
|
885
|
+
return _ref0.apply(this, arguments);
|
|
887
886
|
};
|
|
888
887
|
}();
|
|
889
888
|
|
|
@@ -904,36 +903,36 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
904
903
|
*
|
|
905
904
|
*/
|
|
906
905
|
exports.StreamStartOrStopOrReset = /*#__PURE__*/function () {
|
|
907
|
-
var
|
|
908
|
-
var name, op, status, _tries, tries;
|
|
909
|
-
return _regeneratorRuntime.wrap(function
|
|
906
|
+
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref1) {
|
|
907
|
+
var name, op, status, _tries, tries, _t11, _t12, _t13;
|
|
908
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
910
909
|
while (1) switch (_context6.prev = _context6.next) {
|
|
911
910
|
case 0:
|
|
912
|
-
name =
|
|
911
|
+
name = _ref1.name, op = _ref1.op;
|
|
913
912
|
_context6.prev = 1;
|
|
914
|
-
_context6.next =
|
|
913
|
+
_context6.next = 2;
|
|
915
914
|
return this.StreamStatus({
|
|
916
915
|
name: name
|
|
917
916
|
});
|
|
918
|
-
case
|
|
917
|
+
case 2:
|
|
919
918
|
status = _context6.sent;
|
|
920
919
|
if (!(status.state != "stopped")) {
|
|
921
|
-
_context6.next =
|
|
920
|
+
_context6.next = 3;
|
|
922
921
|
break;
|
|
923
922
|
}
|
|
924
923
|
if (!(op === "start")) {
|
|
925
|
-
_context6.next =
|
|
924
|
+
_context6.next = 3;
|
|
926
925
|
break;
|
|
927
926
|
}
|
|
928
927
|
status.error = "Unable to start stream - state: " + status.state;
|
|
929
928
|
return _context6.abrupt("return", status);
|
|
930
|
-
case
|
|
929
|
+
case 3:
|
|
931
930
|
if (!(status.state == "running" || status.state == "starting" || status.state == "stalled")) {
|
|
932
|
-
_context6.next =
|
|
931
|
+
_context6.next = 12;
|
|
933
932
|
break;
|
|
934
933
|
}
|
|
935
|
-
_context6.prev =
|
|
936
|
-
_context6.next =
|
|
934
|
+
_context6.prev = 4;
|
|
935
|
+
_context6.next = 5;
|
|
937
936
|
return this.CallBitcodeMethod({
|
|
938
937
|
libraryId: status.library_id,
|
|
939
938
|
objectId: status.object_id,
|
|
@@ -941,50 +940,50 @@ exports.StreamStartOrStopOrReset = /*#__PURE__*/function () {
|
|
|
941
940
|
method: "/live/stop/" + status.tlro,
|
|
942
941
|
constant: false
|
|
943
942
|
});
|
|
944
|
-
case
|
|
945
|
-
_context6.next =
|
|
943
|
+
case 5:
|
|
944
|
+
_context6.next = 7;
|
|
946
945
|
break;
|
|
947
|
-
case
|
|
948
|
-
_context6.prev =
|
|
949
|
-
|
|
950
|
-
case
|
|
946
|
+
case 6:
|
|
947
|
+
_context6.prev = 6;
|
|
948
|
+
_t11 = _context6["catch"](4);
|
|
949
|
+
case 7:
|
|
951
950
|
// Wait until LRO is terminated
|
|
952
951
|
_tries = 10;
|
|
953
|
-
case
|
|
952
|
+
case 8:
|
|
954
953
|
if (!(status.state != "stopped" && _tries-- > 0)) {
|
|
955
|
-
_context6.next =
|
|
954
|
+
_context6.next = 11;
|
|
956
955
|
break;
|
|
957
956
|
}
|
|
958
957
|
console.log("Wait to terminate - ", status.state);
|
|
959
|
-
_context6.next =
|
|
958
|
+
_context6.next = 9;
|
|
960
959
|
return Sleep(1000);
|
|
961
|
-
case
|
|
962
|
-
_context6.next =
|
|
960
|
+
case 9:
|
|
961
|
+
_context6.next = 10;
|
|
963
962
|
return this.StreamStatus({
|
|
964
963
|
name: name
|
|
965
964
|
});
|
|
966
|
-
case
|
|
965
|
+
case 10:
|
|
967
966
|
status = _context6.sent;
|
|
968
|
-
_context6.next =
|
|
967
|
+
_context6.next = 8;
|
|
969
968
|
break;
|
|
970
|
-
case
|
|
969
|
+
case 11:
|
|
971
970
|
console.log("Status after stop - ", status.state);
|
|
972
971
|
if (!(_tries <= 0)) {
|
|
973
|
-
_context6.next =
|
|
972
|
+
_context6.next = 12;
|
|
974
973
|
break;
|
|
975
974
|
}
|
|
976
975
|
console.log("Failed to stop");
|
|
977
976
|
return _context6.abrupt("return", status);
|
|
978
|
-
case
|
|
977
|
+
case 12:
|
|
979
978
|
if (!(op === "stop")) {
|
|
980
|
-
_context6.next =
|
|
979
|
+
_context6.next = 13;
|
|
981
980
|
break;
|
|
982
981
|
}
|
|
983
982
|
return _context6.abrupt("return", status);
|
|
984
|
-
case
|
|
983
|
+
case 13:
|
|
985
984
|
console.log("STARTING", "edge_write_token", status.edge_write_token);
|
|
986
|
-
_context6.prev =
|
|
987
|
-
_context6.next =
|
|
985
|
+
_context6.prev = 14;
|
|
986
|
+
_context6.next = 15;
|
|
988
987
|
return this.CallBitcodeMethod({
|
|
989
988
|
libraryId: status.library_id,
|
|
990
989
|
objectId: status.object_id,
|
|
@@ -992,52 +991,52 @@ exports.StreamStartOrStopOrReset = /*#__PURE__*/function () {
|
|
|
992
991
|
method: "/live/start",
|
|
993
992
|
constant: false
|
|
994
993
|
});
|
|
995
|
-
case
|
|
996
|
-
_context6.next =
|
|
994
|
+
case 15:
|
|
995
|
+
_context6.next = 17;
|
|
997
996
|
break;
|
|
998
|
-
case
|
|
999
|
-
_context6.prev =
|
|
1000
|
-
|
|
1001
|
-
console.log("LRO Start (failed): ",
|
|
997
|
+
case 16:
|
|
998
|
+
_context6.prev = 16;
|
|
999
|
+
_t12 = _context6["catch"](14);
|
|
1000
|
+
console.log("LRO Start (failed): ", _t12);
|
|
1002
1001
|
return _context6.abrupt("return", {
|
|
1003
1002
|
state: status.state,
|
|
1004
1003
|
error: "LRO start failed - must create a stream first"
|
|
1005
1004
|
});
|
|
1006
|
-
case
|
|
1005
|
+
case 17:
|
|
1007
1006
|
// Wait until LRO is 'starting'
|
|
1008
1007
|
tries = 10;
|
|
1009
|
-
case
|
|
1008
|
+
case 18:
|
|
1010
1009
|
if (!(status.state != "starting" && tries-- > 0)) {
|
|
1011
|
-
_context6.next =
|
|
1010
|
+
_context6.next = 21;
|
|
1012
1011
|
break;
|
|
1013
1012
|
}
|
|
1014
1013
|
console.log("Wait to start - ", status.state);
|
|
1015
|
-
_context6.next =
|
|
1014
|
+
_context6.next = 19;
|
|
1016
1015
|
return Sleep(1000);
|
|
1017
|
-
case
|
|
1018
|
-
_context6.next =
|
|
1016
|
+
case 19:
|
|
1017
|
+
_context6.next = 20;
|
|
1019
1018
|
return this.StreamStatus({
|
|
1020
1019
|
name: name
|
|
1021
1020
|
});
|
|
1022
|
-
case
|
|
1021
|
+
case 20:
|
|
1023
1022
|
status = _context6.sent;
|
|
1024
|
-
_context6.next =
|
|
1023
|
+
_context6.next = 18;
|
|
1025
1024
|
break;
|
|
1026
|
-
case
|
|
1025
|
+
case 21:
|
|
1027
1026
|
console.log("Status after restart - ", status.state);
|
|
1028
1027
|
return _context6.abrupt("return", status);
|
|
1029
|
-
case
|
|
1030
|
-
_context6.prev =
|
|
1031
|
-
|
|
1032
|
-
console.error(
|
|
1033
|
-
case
|
|
1028
|
+
case 22:
|
|
1029
|
+
_context6.prev = 22;
|
|
1030
|
+
_t13 = _context6["catch"](1);
|
|
1031
|
+
console.error(_t13);
|
|
1032
|
+
case 23:
|
|
1034
1033
|
case "end":
|
|
1035
1034
|
return _context6.stop();
|
|
1036
1035
|
}
|
|
1037
|
-
}, _callee6, this, [[1,
|
|
1036
|
+
}, _callee6, this, [[1, 22], [4, 6], [14, 16]]);
|
|
1038
1037
|
}));
|
|
1039
1038
|
return function (_x6) {
|
|
1040
|
-
return
|
|
1039
|
+
return _ref10.apply(this, arguments);
|
|
1041
1040
|
};
|
|
1042
1041
|
}();
|
|
1043
1042
|
|
|
@@ -1051,27 +1050,27 @@ exports.StreamStartOrStopOrReset = /*#__PURE__*/function () {
|
|
|
1051
1050
|
* @return {Promise<Object>} - The finalize response for the stream object
|
|
1052
1051
|
*/
|
|
1053
1052
|
exports.StreamStopSession = /*#__PURE__*/function () {
|
|
1054
|
-
var
|
|
1055
|
-
var name, objectId, libraryId, mainMeta, fabURI, metaEdgeWriteToken, streamMetadata, status, _yield$this$EditConte, writeToken, newState, stopTime, finalizeMetadata, fin;
|
|
1056
|
-
return _regeneratorRuntime.wrap(function
|
|
1053
|
+
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref11) {
|
|
1054
|
+
var name, objectId, libraryId, mainMeta, fabURI, metaEdgeWriteToken, streamMetadata, status, _yield$this$EditConte, writeToken, newState, stopTime, finalizeMetadata, fin, _t14, _t15;
|
|
1055
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
1057
1056
|
while (1) switch (_context7.prev = _context7.next) {
|
|
1058
1057
|
case 0:
|
|
1059
|
-
name =
|
|
1058
|
+
name = _ref11.name;
|
|
1060
1059
|
_context7.prev = 1;
|
|
1061
1060
|
this.Log("Terminating stream session for: ".concat(name));
|
|
1062
1061
|
objectId = name;
|
|
1063
|
-
_context7.next =
|
|
1062
|
+
_context7.next = 2;
|
|
1064
1063
|
return this.ContentObjectLibraryId({
|
|
1065
1064
|
objectId: objectId
|
|
1066
1065
|
});
|
|
1067
|
-
case
|
|
1066
|
+
case 2:
|
|
1068
1067
|
libraryId = _context7.sent;
|
|
1069
|
-
_context7.next =
|
|
1068
|
+
_context7.next = 3;
|
|
1070
1069
|
return this.ContentObjectMetadata({
|
|
1071
1070
|
libraryId: libraryId,
|
|
1072
1071
|
objectId: objectId
|
|
1073
1072
|
});
|
|
1074
|
-
case
|
|
1073
|
+
case 3:
|
|
1075
1074
|
mainMeta = _context7.sent;
|
|
1076
1075
|
fabURI = mainMeta.live_recording.fabric_config.ingress_node_api; // Support both hostname and URL ingress_node_api
|
|
1077
1076
|
if (!fabURI.startsWith("http")) {
|
|
@@ -1083,56 +1082,56 @@ exports.StreamStopSession = /*#__PURE__*/function () {
|
|
|
1083
1082
|
});
|
|
1084
1083
|
metaEdgeWriteToken = mainMeta.live_recording.fabric_config.edge_write_token;
|
|
1085
1084
|
if (metaEdgeWriteToken) {
|
|
1086
|
-
_context7.next =
|
|
1085
|
+
_context7.next = 4;
|
|
1087
1086
|
break;
|
|
1088
1087
|
}
|
|
1089
1088
|
return _context7.abrupt("return", {
|
|
1090
1089
|
state: "inactive",
|
|
1091
1090
|
error: "The stream is not active"
|
|
1092
1091
|
});
|
|
1093
|
-
case
|
|
1094
|
-
_context7.prev =
|
|
1095
|
-
_context7.next =
|
|
1092
|
+
case 4:
|
|
1093
|
+
_context7.prev = 4;
|
|
1094
|
+
_context7.next = 5;
|
|
1096
1095
|
return this.ContentObjectMetadata({
|
|
1097
1096
|
libraryId: libraryId,
|
|
1098
1097
|
objectId: objectId,
|
|
1099
1098
|
writeToken: metaEdgeWriteToken
|
|
1100
1099
|
});
|
|
1101
|
-
case
|
|
1100
|
+
case 5:
|
|
1102
1101
|
streamMetadata = _context7.sent;
|
|
1103
|
-
_context7.next =
|
|
1102
|
+
_context7.next = 6;
|
|
1104
1103
|
return this.StreamStatus({
|
|
1105
1104
|
name: name
|
|
1106
1105
|
});
|
|
1107
|
-
case
|
|
1106
|
+
case 6:
|
|
1108
1107
|
status = _context7.sent;
|
|
1109
1108
|
if (!(status.state !== "stopped")) {
|
|
1110
|
-
_context7.next =
|
|
1109
|
+
_context7.next = 7;
|
|
1111
1110
|
break;
|
|
1112
1111
|
}
|
|
1113
1112
|
return _context7.abrupt("return", {
|
|
1114
1113
|
state: status.state,
|
|
1115
1114
|
error: "The stream must be stopped before terminating"
|
|
1116
1115
|
});
|
|
1117
|
-
case
|
|
1118
|
-
_context7.next =
|
|
1116
|
+
case 7:
|
|
1117
|
+
_context7.next = 8;
|
|
1119
1118
|
return this.DeleteWriteToken({
|
|
1120
1119
|
writeToken: metaEdgeWriteToken
|
|
1121
1120
|
});
|
|
1122
|
-
case
|
|
1123
|
-
_context7.next =
|
|
1121
|
+
case 8:
|
|
1122
|
+
_context7.next = 10;
|
|
1124
1123
|
break;
|
|
1125
|
-
case
|
|
1126
|
-
_context7.prev =
|
|
1127
|
-
|
|
1124
|
+
case 9:
|
|
1125
|
+
_context7.prev = 9;
|
|
1126
|
+
_t14 = _context7["catch"](4);
|
|
1128
1127
|
this.Log("Unable to retrieve metadata for edge write token");
|
|
1129
|
-
case
|
|
1130
|
-
_context7.next =
|
|
1128
|
+
case 10:
|
|
1129
|
+
_context7.next = 11;
|
|
1131
1130
|
return this.EditContentObject({
|
|
1132
1131
|
libraryId: libraryId,
|
|
1133
1132
|
objectId: objectId
|
|
1134
1133
|
});
|
|
1135
|
-
case
|
|
1134
|
+
case 11:
|
|
1136
1135
|
_yield$this$EditConte = _context7.sent;
|
|
1137
1136
|
writeToken = _yield$this$EditConte.writeToken;
|
|
1138
1137
|
// Set stop time and inactive state
|
|
@@ -1150,40 +1149,40 @@ exports.StreamStopSession = /*#__PURE__*/function () {
|
|
|
1150
1149
|
}
|
|
1151
1150
|
}
|
|
1152
1151
|
};
|
|
1153
|
-
_context7.next =
|
|
1152
|
+
_context7.next = 12;
|
|
1154
1153
|
return this.MergeMetadata({
|
|
1155
1154
|
libraryId: libraryId,
|
|
1156
1155
|
objectId: objectId,
|
|
1157
1156
|
writeToken: writeToken,
|
|
1158
1157
|
metadata: finalizeMetadata
|
|
1159
1158
|
});
|
|
1160
|
-
case
|
|
1161
|
-
_context7.next =
|
|
1159
|
+
case 12:
|
|
1160
|
+
_context7.next = 13;
|
|
1162
1161
|
return this.FinalizeContentObject({
|
|
1163
1162
|
libraryId: libraryId,
|
|
1164
1163
|
objectId: objectId,
|
|
1165
1164
|
writeToken: writeToken,
|
|
1166
1165
|
commitMessage: "Deactivate live stream - stop time ".concat(stopTime)
|
|
1167
1166
|
});
|
|
1168
|
-
case
|
|
1167
|
+
case 13:
|
|
1169
1168
|
fin = _context7.sent;
|
|
1170
1169
|
return _context7.abrupt("return", {
|
|
1171
1170
|
fin: fin,
|
|
1172
1171
|
name: name,
|
|
1173
1172
|
state: newState
|
|
1174
1173
|
});
|
|
1175
|
-
case
|
|
1176
|
-
_context7.prev =
|
|
1177
|
-
|
|
1178
|
-
console.error(
|
|
1179
|
-
case
|
|
1174
|
+
case 14:
|
|
1175
|
+
_context7.prev = 14;
|
|
1176
|
+
_t15 = _context7["catch"](1);
|
|
1177
|
+
console.error(_t15);
|
|
1178
|
+
case 15:
|
|
1180
1179
|
case "end":
|
|
1181
1180
|
return _context7.stop();
|
|
1182
1181
|
}
|
|
1183
|
-
}, _callee7, this, [[1,
|
|
1182
|
+
}, _callee7, this, [[1, 14], [4, 9]]);
|
|
1184
1183
|
}));
|
|
1185
1184
|
return function (_x7) {
|
|
1186
|
-
return
|
|
1185
|
+
return _ref12.apply(this, arguments);
|
|
1187
1186
|
};
|
|
1188
1187
|
}();
|
|
1189
1188
|
|
|
@@ -1201,24 +1200,24 @@ exports.StreamStopSession = /*#__PURE__*/function () {
|
|
|
1201
1200
|
* @return {Promise<Object>} - The name, object ID, and state of the stream
|
|
1202
1201
|
*/
|
|
1203
1202
|
exports.StreamInitialize = /*#__PURE__*/function () {
|
|
1204
|
-
var
|
|
1205
|
-
var name,
|
|
1206
|
-
return _regeneratorRuntime.wrap(function
|
|
1203
|
+
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref13) {
|
|
1204
|
+
var name, _ref13$drm, drm, format, typeAbrMaster, typeLiveStream, tenantContractId, _yield$this$ContentOb, live_stream, title, res;
|
|
1205
|
+
return _regeneratorRuntime.wrap(function (_context8) {
|
|
1207
1206
|
while (1) switch (_context8.prev = _context8.next) {
|
|
1208
1207
|
case 0:
|
|
1209
|
-
name =
|
|
1210
|
-
_context8.next =
|
|
1208
|
+
name = _ref13.name, _ref13$drm = _ref13.drm, drm = _ref13$drm === void 0 ? false : _ref13$drm, format = _ref13.format;
|
|
1209
|
+
_context8.next = 1;
|
|
1211
1210
|
return this.userProfileClient.TenantContractId();
|
|
1212
|
-
case
|
|
1211
|
+
case 1:
|
|
1213
1212
|
tenantContractId = _context8.sent;
|
|
1214
|
-
_context8.next =
|
|
1213
|
+
_context8.next = 2;
|
|
1215
1214
|
return this.ContentObjectMetadata({
|
|
1216
1215
|
libraryId: tenantContractId.replace("iten", "ilib"),
|
|
1217
1216
|
objectId: tenantContractId.replace("iten", "iq__"),
|
|
1218
1217
|
metadataSubtree: "public/content_types",
|
|
1219
1218
|
select: ["live_stream", "title"]
|
|
1220
1219
|
});
|
|
1221
|
-
case
|
|
1220
|
+
case 2:
|
|
1222
1221
|
_yield$this$ContentOb = _context8.sent;
|
|
1223
1222
|
live_stream = _yield$this$ContentOb.live_stream;
|
|
1224
1223
|
title = _yield$this$ContentOb.title;
|
|
@@ -1229,13 +1228,13 @@ exports.StreamInitialize = /*#__PURE__*/function () {
|
|
|
1229
1228
|
typeAbrMaster = title;
|
|
1230
1229
|
}
|
|
1231
1230
|
if (!(typeAbrMaster === undefined || typeLiveStream === undefined)) {
|
|
1232
|
-
_context8.next =
|
|
1231
|
+
_context8.next = 3;
|
|
1233
1232
|
break;
|
|
1234
1233
|
}
|
|
1235
1234
|
console.log("ERROR - unable to find content types", "ABR Master", typeAbrMaster, "Live Stream", typeLiveStream);
|
|
1236
1235
|
return _context8.abrupt("return", {});
|
|
1237
|
-
case
|
|
1238
|
-
_context8.next =
|
|
1236
|
+
case 3:
|
|
1237
|
+
_context8.next = 4;
|
|
1239
1238
|
return this.StreamSetOfferingAndDRM({
|
|
1240
1239
|
name: name,
|
|
1241
1240
|
typeAbrMaster: typeAbrMaster,
|
|
@@ -1243,17 +1242,17 @@ exports.StreamInitialize = /*#__PURE__*/function () {
|
|
|
1243
1242
|
drm: drm,
|
|
1244
1243
|
format: format
|
|
1245
1244
|
});
|
|
1246
|
-
case
|
|
1245
|
+
case 4:
|
|
1247
1246
|
res = _context8.sent;
|
|
1248
1247
|
return _context8.abrupt("return", res);
|
|
1249
|
-
case
|
|
1248
|
+
case 5:
|
|
1250
1249
|
case "end":
|
|
1251
1250
|
return _context8.stop();
|
|
1252
1251
|
}
|
|
1253
1252
|
}, _callee8, this);
|
|
1254
1253
|
}));
|
|
1255
1254
|
return function (_x8) {
|
|
1256
|
-
return
|
|
1255
|
+
return _ref14.apply(this, arguments);
|
|
1257
1256
|
};
|
|
1258
1257
|
}();
|
|
1259
1258
|
|
|
@@ -1273,27 +1272,27 @@ exports.StreamInitialize = /*#__PURE__*/function () {
|
|
|
1273
1272
|
* @return {Promise<Object>} - The name, object ID, and state of the stream
|
|
1274
1273
|
*/
|
|
1275
1274
|
exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
1276
|
-
var
|
|
1277
|
-
var name, typeAbrMaster, typeLiveStream,
|
|
1278
|
-
return _regeneratorRuntime.wrap(function
|
|
1275
|
+
var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref15) {
|
|
1276
|
+
var name, typeAbrMaster, typeLiveStream, _ref15$drm, drm, format, status, objectId, aBitRate, aChannels, aSampleRate, aStreamIndex, aTimeBase, aChannelLayout, vBitRate, vHeight, vStreamIndex, vWidth, vDisplayAspectRatio, vFrameRate, vTimeBase, abrProfileDefault, playoutFormats, abrProfile, formats, i, libraryId, mainMeta, fabURI, streamUrl, _t16;
|
|
1277
|
+
return _regeneratorRuntime.wrap(function (_context9) {
|
|
1279
1278
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1280
1279
|
case 0:
|
|
1281
|
-
name =
|
|
1282
|
-
_context9.next =
|
|
1280
|
+
name = _ref15.name, typeAbrMaster = _ref15.typeAbrMaster, typeLiveStream = _ref15.typeLiveStream, _ref15$drm = _ref15.drm, drm = _ref15$drm === void 0 ? false : _ref15$drm, format = _ref15.format;
|
|
1281
|
+
_context9.next = 1;
|
|
1283
1282
|
return this.StreamStatus({
|
|
1284
1283
|
name: name
|
|
1285
1284
|
});
|
|
1286
|
-
case
|
|
1285
|
+
case 1:
|
|
1287
1286
|
status = _context9.sent;
|
|
1288
1287
|
if (!(status.state != "uninitialized" && status.state != "inactive" && status.state != "stopped")) {
|
|
1289
|
-
_context9.next =
|
|
1288
|
+
_context9.next = 2;
|
|
1290
1289
|
break;
|
|
1291
1290
|
}
|
|
1292
1291
|
return _context9.abrupt("return", {
|
|
1293
1292
|
state: status.state,
|
|
1294
1293
|
error: "stream still active - must terminate first"
|
|
1295
1294
|
});
|
|
1296
|
-
case
|
|
1295
|
+
case 2:
|
|
1297
1296
|
objectId = status.object_id;
|
|
1298
1297
|
console.log("INIT: ", name, objectId);
|
|
1299
1298
|
aBitRate = 128000;
|
|
@@ -1312,20 +1311,20 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1312
1311
|
abrProfileDefault = require("../abr_profiles/abr_profile_live_drm.js");
|
|
1313
1312
|
abrProfile = JSON.parse(JSON.stringify(abrProfileDefault));
|
|
1314
1313
|
if (!format) {
|
|
1315
|
-
_context9.next =
|
|
1314
|
+
_context9.next = 8;
|
|
1316
1315
|
break;
|
|
1317
1316
|
}
|
|
1318
1317
|
drm = true; // Override DRM parameter
|
|
1319
1318
|
playoutFormats = {};
|
|
1320
1319
|
formats = format.split(",");
|
|
1321
1320
|
i = 0;
|
|
1322
|
-
case
|
|
1321
|
+
case 3:
|
|
1323
1322
|
if (!(i < formats.length)) {
|
|
1324
|
-
_context9.next =
|
|
1323
|
+
_context9.next = 7;
|
|
1325
1324
|
break;
|
|
1326
1325
|
}
|
|
1327
1326
|
if (!(formats[i] === "hls-clear")) {
|
|
1328
|
-
_context9.next =
|
|
1327
|
+
_context9.next = 4;
|
|
1329
1328
|
break;
|
|
1330
1329
|
}
|
|
1331
1330
|
abrProfile.drm_optional = true;
|
|
@@ -1335,10 +1334,10 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1335
1334
|
"type": "ProtoHls"
|
|
1336
1335
|
}
|
|
1337
1336
|
};
|
|
1338
|
-
return _context9.abrupt("continue",
|
|
1339
|
-
case
|
|
1337
|
+
return _context9.abrupt("continue", 6);
|
|
1338
|
+
case 4:
|
|
1340
1339
|
if (!(formats[i] === "dash-clear")) {
|
|
1341
|
-
_context9.next =
|
|
1340
|
+
_context9.next = 5;
|
|
1342
1341
|
break;
|
|
1343
1342
|
}
|
|
1344
1343
|
abrProfile.drm_optional = true;
|
|
@@ -1349,17 +1348,17 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1349
1348
|
"type": "ProtoDash"
|
|
1350
1349
|
}
|
|
1351
1350
|
};
|
|
1352
|
-
return _context9.abrupt("continue",
|
|
1353
|
-
case
|
|
1351
|
+
return _context9.abrupt("continue", 6);
|
|
1352
|
+
case 5:
|
|
1354
1353
|
playoutFormats[formats[i]] = abrProfile.playout_formats[formats[i]];
|
|
1355
|
-
case
|
|
1354
|
+
case 6:
|
|
1356
1355
|
i++;
|
|
1357
|
-
_context9.next =
|
|
1356
|
+
_context9.next = 3;
|
|
1358
1357
|
break;
|
|
1359
|
-
case
|
|
1360
|
-
_context9.next =
|
|
1358
|
+
case 7:
|
|
1359
|
+
_context9.next = 9;
|
|
1361
1360
|
break;
|
|
1362
|
-
case
|
|
1361
|
+
case 8:
|
|
1363
1362
|
if (!drm) {
|
|
1364
1363
|
abrProfile.drm_optional = true;
|
|
1365
1364
|
playoutFormats = {
|
|
@@ -1380,21 +1379,21 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1380
1379
|
} else {
|
|
1381
1380
|
playoutFormats = Object.assign({}, abrProfile.playout_formats);
|
|
1382
1381
|
}
|
|
1383
|
-
case
|
|
1382
|
+
case 9:
|
|
1384
1383
|
abrProfile.playout_formats = playoutFormats;
|
|
1385
|
-
_context9.next =
|
|
1384
|
+
_context9.next = 10;
|
|
1386
1385
|
return this.ContentObjectLibraryId({
|
|
1387
1386
|
objectId: objectId
|
|
1388
1387
|
});
|
|
1389
|
-
case
|
|
1388
|
+
case 10:
|
|
1390
1389
|
libraryId = _context9.sent;
|
|
1391
|
-
_context9.prev =
|
|
1392
|
-
_context9.next =
|
|
1390
|
+
_context9.prev = 11;
|
|
1391
|
+
_context9.next = 12;
|
|
1393
1392
|
return this.ContentObjectMetadata({
|
|
1394
1393
|
libraryId: libraryId,
|
|
1395
1394
|
objectId: objectId
|
|
1396
1395
|
});
|
|
1397
|
-
case
|
|
1396
|
+
case 12:
|
|
1398
1397
|
mainMeta = _context9.sent;
|
|
1399
1398
|
fabURI = mainMeta.live_recording.fabric_config.ingress_node_api; // Support both hostname and URL ingress_node_api
|
|
1400
1399
|
if (!fabURI.startsWith("http")) {
|
|
@@ -1405,7 +1404,7 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1405
1404
|
fabricURIs: [fabURI]
|
|
1406
1405
|
});
|
|
1407
1406
|
streamUrl = mainMeta.live_recording.recording_config.recording_params.origin_url;
|
|
1408
|
-
_context9.next =
|
|
1407
|
+
_context9.next = 13;
|
|
1409
1408
|
return StreamGenerateOffering({
|
|
1410
1409
|
client: this,
|
|
1411
1410
|
libraryId: libraryId,
|
|
@@ -1428,25 +1427,25 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1428
1427
|
vFrameRate: vFrameRate,
|
|
1429
1428
|
vTimeBase: vTimeBase
|
|
1430
1429
|
});
|
|
1431
|
-
case
|
|
1430
|
+
case 13:
|
|
1432
1431
|
console.log("Finished generating offering");
|
|
1433
1432
|
return _context9.abrupt("return", {
|
|
1434
1433
|
name: name,
|
|
1435
1434
|
object_id: objectId,
|
|
1436
1435
|
state: "initialized"
|
|
1437
1436
|
});
|
|
1438
|
-
case
|
|
1439
|
-
_context9.prev =
|
|
1440
|
-
|
|
1441
|
-
console.error(
|
|
1442
|
-
case
|
|
1437
|
+
case 14:
|
|
1438
|
+
_context9.prev = 14;
|
|
1439
|
+
_t16 = _context9["catch"](11);
|
|
1440
|
+
console.error(_t16);
|
|
1441
|
+
case 15:
|
|
1443
1442
|
case "end":
|
|
1444
1443
|
return _context9.stop();
|
|
1445
1444
|
}
|
|
1446
|
-
}, _callee9, this, [[
|
|
1445
|
+
}, _callee9, this, [[11, 14]]);
|
|
1447
1446
|
}));
|
|
1448
1447
|
return function (_x9) {
|
|
1449
|
-
return
|
|
1448
|
+
return _ref16.apply(this, arguments);
|
|
1450
1449
|
};
|
|
1451
1450
|
}();
|
|
1452
1451
|
|
|
@@ -1466,23 +1465,22 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1466
1465
|
* @return {Promise<Object>} - Insertions, as well as any errors from bad insertions
|
|
1467
1466
|
*/
|
|
1468
1467
|
exports.StreamInsertion = /*#__PURE__*/function () {
|
|
1469
|
-
var
|
|
1470
|
-
var name, insertionTime,
|
|
1471
|
-
return _regeneratorRuntime.wrap(function
|
|
1472
|
-
while (1) switch (
|
|
1468
|
+
var _ref18 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(_ref17) {
|
|
1469
|
+
var name, insertionTime, _ref17$sinceStart, sinceStart, duration, targetHash, _ref17$remove, remove, offeringMeta, insertionInfo, audioAbrDuration, videoAbrDuration, objectId, libraryId, mainMeta, fabURI, edgeWriteToken, edgeMeta, recordings, sequence, streamStartTime, period, playoutConfig, insertions, res, errs, currentTime, insertionDone, newInsertion, i;
|
|
1470
|
+
return _regeneratorRuntime.wrap(function (_context0) {
|
|
1471
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
1473
1472
|
case 0:
|
|
1474
|
-
name =
|
|
1475
|
-
|
|
1473
|
+
name = _ref17.name, insertionTime = _ref17.insertionTime, _ref17$sinceStart = _ref17.sinceStart, sinceStart = _ref17$sinceStart === void 0 ? false : _ref17$sinceStart, duration = _ref17.duration, targetHash = _ref17.targetHash, _ref17$remove = _ref17.remove, remove = _ref17$remove === void 0 ? false : _ref17$remove;
|
|
1474
|
+
_context0.next = 1;
|
|
1476
1475
|
return this.ContentObjectMetadata({
|
|
1477
1476
|
versionHash: targetHash,
|
|
1478
1477
|
metadataSubtree: "/offerings/default"
|
|
1479
1478
|
});
|
|
1480
|
-
case
|
|
1481
|
-
offeringMeta =
|
|
1479
|
+
case 1:
|
|
1480
|
+
offeringMeta = _context0.sent;
|
|
1482
1481
|
insertionInfo = {
|
|
1483
1482
|
duration_sec: 0 // Minimum of video and audio duration
|
|
1484
1483
|
};
|
|
1485
|
-
|
|
1486
1484
|
["video", "audio"].forEach(function (mt) {
|
|
1487
1485
|
var stream = offeringMeta.media_struct.streams[mt];
|
|
1488
1486
|
insertionInfo[mt] = {
|
|
@@ -1497,39 +1495,39 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1497
1495
|
audioAbrDuration = insertionInfo.audio.seg_duration_sec;
|
|
1498
1496
|
videoAbrDuration = insertionInfo.video.seg_duration_sec;
|
|
1499
1497
|
if (!(audioAbrDuration === 0 || videoAbrDuration === 0)) {
|
|
1500
|
-
|
|
1498
|
+
_context0.next = 2;
|
|
1501
1499
|
break;
|
|
1502
1500
|
}
|
|
1503
1501
|
throw new Error("Bad segment duration hash:", targetHash);
|
|
1504
|
-
case
|
|
1502
|
+
case 2:
|
|
1505
1503
|
if (!(duration === undefined)) {
|
|
1506
|
-
|
|
1504
|
+
_context0.next = 3;
|
|
1507
1505
|
break;
|
|
1508
1506
|
}
|
|
1509
1507
|
duration = insertionInfo.duration_sec; // Use full duration of the insertion
|
|
1510
|
-
|
|
1508
|
+
_context0.next = 4;
|
|
1511
1509
|
break;
|
|
1512
|
-
case
|
|
1510
|
+
case 3:
|
|
1513
1511
|
if (!(duration > insertionInfo.duration_sec)) {
|
|
1514
|
-
|
|
1512
|
+
_context0.next = 4;
|
|
1515
1513
|
break;
|
|
1516
1514
|
}
|
|
1517
1515
|
throw new Error("Bad duration - larger than insertion object duration", insertionInfo.duration_sec);
|
|
1518
|
-
case
|
|
1516
|
+
case 4:
|
|
1519
1517
|
objectId = name;
|
|
1520
|
-
|
|
1518
|
+
_context0.next = 5;
|
|
1521
1519
|
return this.ContentObjectLibraryId({
|
|
1522
1520
|
objectId: objectId
|
|
1523
1521
|
});
|
|
1524
|
-
case
|
|
1525
|
-
libraryId =
|
|
1526
|
-
|
|
1522
|
+
case 5:
|
|
1523
|
+
libraryId = _context0.sent;
|
|
1524
|
+
_context0.next = 6;
|
|
1527
1525
|
return this.ContentObjectMetadata({
|
|
1528
1526
|
libraryId: libraryId,
|
|
1529
1527
|
objectId: objectId
|
|
1530
1528
|
});
|
|
1531
|
-
case
|
|
1532
|
-
mainMeta =
|
|
1529
|
+
case 6:
|
|
1530
|
+
mainMeta = _context0.sent;
|
|
1533
1531
|
fabURI = mainMeta.live_recording.fabric_config.ingress_node_api; // Support both hostname and URL ingress_node_api
|
|
1534
1532
|
if (!fabURI.startsWith("http")) {
|
|
1535
1533
|
// Assume https
|
|
@@ -1539,14 +1537,14 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1539
1537
|
fabricURIs: [fabURI]
|
|
1540
1538
|
});
|
|
1541
1539
|
edgeWriteToken = mainMeta.live_recording.fabric_config.edge_write_token;
|
|
1542
|
-
|
|
1540
|
+
_context0.next = 7;
|
|
1543
1541
|
return this.ContentObjectMetadata({
|
|
1544
1542
|
libraryId: libraryId,
|
|
1545
1543
|
objectId: objectId,
|
|
1546
1544
|
writeToken: edgeWriteToken
|
|
1547
1545
|
});
|
|
1548
|
-
case
|
|
1549
|
-
edgeMeta =
|
|
1546
|
+
case 7:
|
|
1547
|
+
edgeMeta = _context0.sent;
|
|
1550
1548
|
// Find stream start time (from the most recent recording section)
|
|
1551
1549
|
recordings = edgeMeta.live_recording.recordings;
|
|
1552
1550
|
sequence = 1;
|
|
@@ -1564,15 +1562,15 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1564
1562
|
}
|
|
1565
1563
|
}
|
|
1566
1564
|
if (!(streamStartTime === 0)) {
|
|
1567
|
-
|
|
1565
|
+
_context0.next = 8;
|
|
1568
1566
|
break;
|
|
1569
1567
|
}
|
|
1570
1568
|
if (!(sinceStart === false)) {
|
|
1571
|
-
|
|
1569
|
+
_context0.next = 8;
|
|
1572
1570
|
break;
|
|
1573
1571
|
}
|
|
1574
1572
|
throw new Error("Stream not running - must use 'time since start'");
|
|
1575
|
-
case
|
|
1573
|
+
case 8:
|
|
1576
1574
|
// Find the current period playout configuration
|
|
1577
1575
|
if (edgeMeta.live_recording.playout_config.interleaves === undefined) {
|
|
1578
1576
|
edgeMeta.live_recording.playout_config.interleaves = {};
|
|
@@ -1599,9 +1597,9 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1599
1597
|
playout: "/qfab/" + targetHash + "/rep/playout" // TO FIX - should be a link
|
|
1600
1598
|
};
|
|
1601
1599
|
i = 0;
|
|
1602
|
-
case
|
|
1600
|
+
case 9:
|
|
1603
1601
|
if (!(i < insertions.length)) {
|
|
1604
|
-
|
|
1602
|
+
_context0.next = 13;
|
|
1605
1603
|
break;
|
|
1606
1604
|
}
|
|
1607
1605
|
if (insertions[i].insertion_time <= currentTime) {
|
|
@@ -1609,21 +1607,21 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1609
1607
|
append(errs, "Bad insertion - time:", insertions[i].insertion_time);
|
|
1610
1608
|
}
|
|
1611
1609
|
if (!remove) {
|
|
1612
|
-
|
|
1610
|
+
_context0.next = 11;
|
|
1613
1611
|
break;
|
|
1614
1612
|
}
|
|
1615
1613
|
if (!(insertions[i].insertion_time === insertionTime)) {
|
|
1616
|
-
|
|
1614
|
+
_context0.next = 10;
|
|
1617
1615
|
break;
|
|
1618
1616
|
}
|
|
1619
1617
|
insertions.splice(i, 1);
|
|
1620
|
-
return
|
|
1621
|
-
case
|
|
1622
|
-
|
|
1618
|
+
return _context0.abrupt("continue", 13);
|
|
1619
|
+
case 10:
|
|
1620
|
+
_context0.next = 12;
|
|
1623
1621
|
break;
|
|
1624
|
-
case
|
|
1622
|
+
case 11:
|
|
1625
1623
|
if (!(insertions[i].insertion_time > insertionTime)) {
|
|
1626
|
-
|
|
1624
|
+
_context0.next = 12;
|
|
1627
1625
|
break;
|
|
1628
1626
|
}
|
|
1629
1627
|
if (i > 0) {
|
|
@@ -1632,12 +1630,12 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1632
1630
|
insertions = [newInsertion].concat(_toConsumableArray(insertions.splice(i)));
|
|
1633
1631
|
}
|
|
1634
1632
|
insertionDone = true;
|
|
1635
|
-
return
|
|
1636
|
-
case
|
|
1633
|
+
return _context0.abrupt("continue", 13);
|
|
1634
|
+
case 12:
|
|
1637
1635
|
i++;
|
|
1638
|
-
|
|
1636
|
+
_context0.next = 9;
|
|
1639
1637
|
break;
|
|
1640
|
-
case
|
|
1638
|
+
case 13:
|
|
1641
1639
|
if (!remove && !insertionDone) {
|
|
1642
1640
|
// Add to the end of the insertions list
|
|
1643
1641
|
console.log("Add insertion at the end");
|
|
@@ -1646,7 +1644,7 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1646
1644
|
playoutConfig.interleaves[sequence] = insertions;
|
|
1647
1645
|
|
|
1648
1646
|
// Store the new insertions in the write token
|
|
1649
|
-
|
|
1647
|
+
_context0.next = 14;
|
|
1650
1648
|
return this.ReplaceMetadata({
|
|
1651
1649
|
libraryId: libraryId,
|
|
1652
1650
|
objectId: objectId,
|
|
@@ -1654,18 +1652,18 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1654
1652
|
metadataSubtree: "/live_recording/playout_config",
|
|
1655
1653
|
metadata: edgeMeta.live_recording.playout_config
|
|
1656
1654
|
});
|
|
1657
|
-
case
|
|
1655
|
+
case 14:
|
|
1658
1656
|
res.errors = errs;
|
|
1659
1657
|
res.insertions = insertions;
|
|
1660
|
-
return
|
|
1661
|
-
case
|
|
1658
|
+
return _context0.abrupt("return", res);
|
|
1659
|
+
case 15:
|
|
1662
1660
|
case "end":
|
|
1663
|
-
return
|
|
1661
|
+
return _context0.stop();
|
|
1664
1662
|
}
|
|
1665
|
-
},
|
|
1663
|
+
}, _callee0, this);
|
|
1666
1664
|
}));
|
|
1667
|
-
return function (
|
|
1668
|
-
return
|
|
1665
|
+
return function (_x0) {
|
|
1666
|
+
return _ref18.apply(this, arguments);
|
|
1669
1667
|
};
|
|
1670
1668
|
}();
|
|
1671
1669
|
|
|
@@ -1703,32 +1701,32 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1703
1701
|
*
|
|
1704
1702
|
*/
|
|
1705
1703
|
exports.StreamConfig = /*#__PURE__*/function () {
|
|
1706
|
-
var
|
|
1707
|
-
var name,
|
|
1708
|
-
return _regeneratorRuntime.wrap(function
|
|
1709
|
-
while (1) switch (
|
|
1704
|
+
var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(_ref19) {
|
|
1705
|
+
var name, _ref19$customSettings, customSettings, _ref19$customMetaValu, customMetaValues, probeMetadata, writeToken, _ref19$finalize, finalize, objectId, status, libraryId, probe, mainMeta, userConfig, parsedName, hostName, streamUrl, nodes, node, endpoint, probeUrl, lc, liveRecordingConfig, e, _t17, _t18, _t19;
|
|
1706
|
+
return _regeneratorRuntime.wrap(function (_context1) {
|
|
1707
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
1710
1708
|
case 0:
|
|
1711
|
-
name =
|
|
1709
|
+
name = _ref19.name, _ref19$customSettings = _ref19.customSettings, customSettings = _ref19$customSettings === void 0 ? {} : _ref19$customSettings, _ref19$customMetaValu = _ref19.customMetaValues, customMetaValues = _ref19$customMetaValu === void 0 ? {} : _ref19$customMetaValu, probeMetadata = _ref19.probeMetadata, writeToken = _ref19.writeToken, _ref19$finalize = _ref19.finalize, finalize = _ref19$finalize === void 0 ? true : _ref19$finalize;
|
|
1712
1710
|
objectId = name;
|
|
1713
1711
|
status = {
|
|
1714
1712
|
name: name
|
|
1715
1713
|
};
|
|
1716
|
-
|
|
1714
|
+
_context1.next = 1;
|
|
1717
1715
|
return this.ContentObjectLibraryId({
|
|
1718
1716
|
objectId: objectId
|
|
1719
1717
|
});
|
|
1720
|
-
case
|
|
1721
|
-
libraryId =
|
|
1718
|
+
case 1:
|
|
1719
|
+
libraryId = _context1.sent;
|
|
1722
1720
|
status.library_id = libraryId;
|
|
1723
1721
|
status.object_id = objectId;
|
|
1724
1722
|
probe = probeMetadata;
|
|
1725
|
-
|
|
1723
|
+
_context1.next = 2;
|
|
1726
1724
|
return this.ContentObjectMetadata({
|
|
1727
1725
|
libraryId: libraryId,
|
|
1728
1726
|
objectId: objectId
|
|
1729
1727
|
});
|
|
1730
|
-
case
|
|
1731
|
-
mainMeta =
|
|
1728
|
+
case 2:
|
|
1729
|
+
mainMeta = _context1.sent;
|
|
1732
1730
|
userConfig = mainMeta.live_recording_config;
|
|
1733
1731
|
status.user_config = userConfig;
|
|
1734
1732
|
|
|
@@ -1737,19 +1735,19 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1737
1735
|
hostName = new URL(parsedName).hostname;
|
|
1738
1736
|
streamUrl = new URL(userConfig.url);
|
|
1739
1737
|
this.Log("Retrieving nodes - matching: ".concat(hostName));
|
|
1740
|
-
|
|
1738
|
+
_context1.next = 3;
|
|
1741
1739
|
return this.SpaceNodes({
|
|
1742
1740
|
matchEndpoint: hostName
|
|
1743
1741
|
});
|
|
1744
|
-
case
|
|
1745
|
-
nodes =
|
|
1742
|
+
case 3:
|
|
1743
|
+
nodes = _context1.sent;
|
|
1746
1744
|
if (!(nodes.length < 1)) {
|
|
1747
|
-
|
|
1745
|
+
_context1.next = 4;
|
|
1748
1746
|
break;
|
|
1749
1747
|
}
|
|
1750
1748
|
status.error = "No node matching stream URL " + streamUrl.href;
|
|
1751
|
-
return
|
|
1752
|
-
case
|
|
1749
|
+
return _context1.abrupt("return", status);
|
|
1750
|
+
case 4:
|
|
1753
1751
|
node = {
|
|
1754
1752
|
endpoints: nodes[0].services.fabric_api.urls,
|
|
1755
1753
|
id: nodes[0].id
|
|
@@ -1757,7 +1755,7 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1757
1755
|
status.node = node;
|
|
1758
1756
|
endpoint = node.endpoints[0];
|
|
1759
1757
|
if (probe) {
|
|
1760
|
-
|
|
1758
|
+
_context1.next = 13;
|
|
1761
1759
|
break;
|
|
1762
1760
|
}
|
|
1763
1761
|
this.SetNodes({
|
|
@@ -1766,17 +1764,17 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1766
1764
|
|
|
1767
1765
|
// Probe the stream
|
|
1768
1766
|
probe = {};
|
|
1769
|
-
|
|
1770
|
-
|
|
1767
|
+
_context1.prev = 5;
|
|
1768
|
+
_context1.next = 6;
|
|
1771
1769
|
return this.Rep({
|
|
1772
1770
|
libraryId: libraryId,
|
|
1773
1771
|
objectId: objectId,
|
|
1774
1772
|
rep: "probe"
|
|
1775
1773
|
});
|
|
1776
|
-
case
|
|
1777
|
-
probeUrl =
|
|
1778
|
-
|
|
1779
|
-
|
|
1774
|
+
case 6:
|
|
1775
|
+
probeUrl = _context1.sent;
|
|
1776
|
+
_t17 = this.utils;
|
|
1777
|
+
_context1.next = 7;
|
|
1780
1778
|
return HttpClient.Fetch(probeUrl, {
|
|
1781
1779
|
body: JSON.stringify({
|
|
1782
1780
|
"filename": streamUrl.href,
|
|
@@ -1784,52 +1782,52 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1784
1782
|
}),
|
|
1785
1783
|
method: "POST"
|
|
1786
1784
|
});
|
|
1787
|
-
case
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
return
|
|
1791
|
-
case
|
|
1792
|
-
probe =
|
|
1785
|
+
case 7:
|
|
1786
|
+
_t18 = _context1.sent;
|
|
1787
|
+
_context1.next = 8;
|
|
1788
|
+
return _t17.ResponseToJson.call(_t17, _t18);
|
|
1789
|
+
case 8:
|
|
1790
|
+
probe = _context1.sent;
|
|
1793
1791
|
if (!probe.errors) {
|
|
1794
|
-
|
|
1792
|
+
_context1.next = 9;
|
|
1795
1793
|
break;
|
|
1796
1794
|
}
|
|
1797
1795
|
throw probe.errors[0];
|
|
1798
|
-
case
|
|
1799
|
-
|
|
1796
|
+
case 9:
|
|
1797
|
+
_context1.next = 12;
|
|
1800
1798
|
break;
|
|
1801
|
-
case
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
if (!(
|
|
1805
|
-
|
|
1799
|
+
case 10:
|
|
1800
|
+
_context1.prev = 10;
|
|
1801
|
+
_t19 = _context1["catch"](5);
|
|
1802
|
+
if (!(_t19.code === "ETIMEDOUT")) {
|
|
1803
|
+
_context1.next = 11;
|
|
1806
1804
|
break;
|
|
1807
1805
|
}
|
|
1808
1806
|
throw "Stream probe time out - make sure the stream source is available";
|
|
1809
|
-
case
|
|
1810
|
-
throw
|
|
1811
|
-
case
|
|
1807
|
+
case 11:
|
|
1808
|
+
throw _t19;
|
|
1809
|
+
case 12:
|
|
1812
1810
|
probe.format.filename = streamUrl.href;
|
|
1813
|
-
case
|
|
1811
|
+
case 13:
|
|
1814
1812
|
// Create live recording config
|
|
1815
1813
|
lc = new LiveConf(probe, node.id, endpoint, false, false, true);
|
|
1816
1814
|
liveRecordingConfig = lc.generateLiveConf({
|
|
1817
1815
|
customSettings: customSettings
|
|
1818
1816
|
}); // Store live recording config into the stream object
|
|
1819
1817
|
if (writeToken) {
|
|
1820
|
-
|
|
1818
|
+
_context1.next = 15;
|
|
1821
1819
|
break;
|
|
1822
1820
|
}
|
|
1823
|
-
|
|
1821
|
+
_context1.next = 14;
|
|
1824
1822
|
return this.EditContentObject({
|
|
1825
1823
|
libraryId: libraryId,
|
|
1826
1824
|
objectId: objectId
|
|
1827
1825
|
});
|
|
1828
|
-
case
|
|
1829
|
-
e =
|
|
1826
|
+
case 14:
|
|
1827
|
+
e = _context1.sent;
|
|
1830
1828
|
writeToken = e.write_token;
|
|
1831
|
-
case
|
|
1832
|
-
|
|
1829
|
+
case 15:
|
|
1830
|
+
_context1.next = 16;
|
|
1833
1831
|
return this.ReplaceMetadata({
|
|
1834
1832
|
libraryId: libraryId,
|
|
1835
1833
|
objectId: objectId,
|
|
@@ -1837,8 +1835,8 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1837
1835
|
metadataSubtree: "live_recording",
|
|
1838
1836
|
metadata: liveRecordingConfig.live_recording
|
|
1839
1837
|
});
|
|
1840
|
-
case
|
|
1841
|
-
|
|
1838
|
+
case 16:
|
|
1839
|
+
_context1.next = 17;
|
|
1842
1840
|
return this.ReplaceMetadata({
|
|
1843
1841
|
libraryId: libraryId,
|
|
1844
1842
|
objectId: objectId,
|
|
@@ -1846,30 +1844,30 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1846
1844
|
metadataSubtree: "live_recording_config/probe_info",
|
|
1847
1845
|
metadata: probe
|
|
1848
1846
|
});
|
|
1849
|
-
case
|
|
1847
|
+
case 17:
|
|
1850
1848
|
if (!finalize) {
|
|
1851
|
-
|
|
1849
|
+
_context1.next = 19;
|
|
1852
1850
|
break;
|
|
1853
1851
|
}
|
|
1854
|
-
|
|
1852
|
+
_context1.next = 18;
|
|
1855
1853
|
return this.FinalizeContentObject({
|
|
1856
1854
|
libraryId: libraryId,
|
|
1857
1855
|
objectId: objectId,
|
|
1858
1856
|
writeToken: writeToken,
|
|
1859
1857
|
commitMessage: "Apply live stream configuration"
|
|
1860
1858
|
});
|
|
1861
|
-
case
|
|
1862
|
-
status.fin =
|
|
1863
|
-
case
|
|
1864
|
-
return
|
|
1865
|
-
case
|
|
1859
|
+
case 18:
|
|
1860
|
+
status.fin = _context1.sent;
|
|
1861
|
+
case 19:
|
|
1862
|
+
return _context1.abrupt("return", status);
|
|
1863
|
+
case 20:
|
|
1866
1864
|
case "end":
|
|
1867
|
-
return
|
|
1865
|
+
return _context1.stop();
|
|
1868
1866
|
}
|
|
1869
|
-
},
|
|
1867
|
+
}, _callee1, this, [[5, 10]]);
|
|
1870
1868
|
}));
|
|
1871
|
-
return function (
|
|
1872
|
-
return
|
|
1869
|
+
return function (_x1) {
|
|
1870
|
+
return _ref20.apply(this, arguments);
|
|
1873
1871
|
};
|
|
1874
1872
|
}();
|
|
1875
1873
|
|
|
@@ -1882,9 +1880,9 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1882
1880
|
*
|
|
1883
1881
|
* @return {Promise<Object>} - The list of stream URLs
|
|
1884
1882
|
*/
|
|
1885
|
-
exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator(
|
|
1883
|
+
exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
1886
1884
|
var _this2 = this;
|
|
1887
|
-
var
|
|
1885
|
+
var _ref22,
|
|
1888
1886
|
siteId,
|
|
1889
1887
|
STATUS_MAP,
|
|
1890
1888
|
tenantContractId,
|
|
@@ -1892,12 +1890,21 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
1892
1890
|
activeUrlMap,
|
|
1893
1891
|
streamUrlStatus,
|
|
1894
1892
|
streamUrls,
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1893
|
+
_args11 = arguments,
|
|
1894
|
+
_t20,
|
|
1895
|
+
_t21,
|
|
1896
|
+
_t22,
|
|
1897
|
+
_t23,
|
|
1898
|
+
_t24,
|
|
1899
|
+
_t25,
|
|
1900
|
+
_t26,
|
|
1901
|
+
_t27,
|
|
1902
|
+
_t28;
|
|
1903
|
+
return _regeneratorRuntime.wrap(function (_context11) {
|
|
1904
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1898
1905
|
case 0:
|
|
1899
|
-
|
|
1900
|
-
|
|
1906
|
+
_ref22 = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {}, siteId = _ref22.siteId;
|
|
1907
|
+
_context11.prev = 1;
|
|
1901
1908
|
STATUS_MAP = {
|
|
1902
1909
|
UNCONFIGURED: "unconfigured",
|
|
1903
1910
|
UNINITIALIZED: "uninitialized",
|
|
@@ -1908,78 +1915,78 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
1908
1915
|
STALLED: "stalled"
|
|
1909
1916
|
};
|
|
1910
1917
|
if (siteId) {
|
|
1911
|
-
|
|
1918
|
+
_context11.next = 5;
|
|
1912
1919
|
break;
|
|
1913
1920
|
}
|
|
1914
|
-
|
|
1921
|
+
_context11.next = 2;
|
|
1915
1922
|
return this.userProfileClient.TenantContractId();
|
|
1916
|
-
case
|
|
1917
|
-
tenantContractId =
|
|
1923
|
+
case 2:
|
|
1924
|
+
tenantContractId = _context11.sent;
|
|
1918
1925
|
if (tenantContractId) {
|
|
1919
|
-
|
|
1926
|
+
_context11.next = 3;
|
|
1920
1927
|
break;
|
|
1921
1928
|
}
|
|
1922
1929
|
throw Error("No tenant contract ID configured");
|
|
1923
|
-
case
|
|
1924
|
-
|
|
1930
|
+
case 3:
|
|
1931
|
+
_context11.next = 4;
|
|
1925
1932
|
return this.ContentObjectMetadata({
|
|
1926
1933
|
libraryId: tenantContractId.replace("iten", "ilib"),
|
|
1927
1934
|
objectId: tenantContractId.replace("iten", "iq__"),
|
|
1928
1935
|
metadataSubtree: "public/sites/live_streams"
|
|
1929
1936
|
});
|
|
1930
|
-
case
|
|
1931
|
-
siteId =
|
|
1932
|
-
case
|
|
1933
|
-
|
|
1934
|
-
|
|
1937
|
+
case 4:
|
|
1938
|
+
siteId = _context11.sent;
|
|
1939
|
+
case 5:
|
|
1940
|
+
_t20 = this;
|
|
1941
|
+
_context11.next = 6;
|
|
1935
1942
|
return this.ContentObjectLibraryId({
|
|
1936
1943
|
objectId: siteId
|
|
1937
1944
|
});
|
|
1938
|
-
case
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
libraryId:
|
|
1943
|
-
objectId:
|
|
1945
|
+
case 6:
|
|
1946
|
+
_t21 = _context11.sent;
|
|
1947
|
+
_t22 = siteId;
|
|
1948
|
+
_t23 = {
|
|
1949
|
+
libraryId: _t21,
|
|
1950
|
+
objectId: _t22,
|
|
1944
1951
|
metadataSubtree: "public/asset_metadata/live_streams",
|
|
1945
1952
|
resolveLinks: true,
|
|
1946
1953
|
resolveIgnoreErrors: true,
|
|
1947
1954
|
resolveIncludeSource: true
|
|
1948
1955
|
};
|
|
1949
|
-
|
|
1950
|
-
return
|
|
1951
|
-
case
|
|
1952
|
-
streamMetadata =
|
|
1956
|
+
_context11.next = 7;
|
|
1957
|
+
return _t20.ContentObjectMetadata.call(_t20, _t23);
|
|
1958
|
+
case 7:
|
|
1959
|
+
streamMetadata = _context11.sent;
|
|
1953
1960
|
activeUrlMap = {};
|
|
1954
|
-
|
|
1961
|
+
_context11.next = 8;
|
|
1955
1962
|
return this.utils.LimitedMap(10, Object.keys(streamMetadata || {}), /*#__PURE__*/function () {
|
|
1956
|
-
var
|
|
1963
|
+
var _ref23 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(slug) {
|
|
1957
1964
|
var stream, versionHash, objectId, libraryId, status, streamMeta, url, isActive;
|
|
1958
|
-
return _regeneratorRuntime.wrap(function
|
|
1959
|
-
while (1) switch (
|
|
1965
|
+
return _regeneratorRuntime.wrap(function (_context10) {
|
|
1966
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1960
1967
|
case 0:
|
|
1961
1968
|
stream = streamMetadata[slug];
|
|
1962
1969
|
if (stream && stream["."] && stream["."].source) {
|
|
1963
1970
|
versionHash = stream["."].source;
|
|
1964
1971
|
}
|
|
1965
1972
|
if (!versionHash) {
|
|
1966
|
-
|
|
1973
|
+
_context10.next = 4;
|
|
1967
1974
|
break;
|
|
1968
1975
|
}
|
|
1969
1976
|
objectId = _this2.utils.DecodeVersionHash(versionHash).objectId;
|
|
1970
|
-
|
|
1977
|
+
_context10.next = 1;
|
|
1971
1978
|
return _this2.ContentObjectLibraryId({
|
|
1972
1979
|
objectId: objectId
|
|
1973
1980
|
});
|
|
1974
|
-
case
|
|
1975
|
-
libraryId =
|
|
1976
|
-
|
|
1981
|
+
case 1:
|
|
1982
|
+
libraryId = _context10.sent;
|
|
1983
|
+
_context10.next = 2;
|
|
1977
1984
|
return _this2.StreamStatus({
|
|
1978
1985
|
name: objectId
|
|
1979
1986
|
});
|
|
1980
|
-
case
|
|
1981
|
-
status =
|
|
1982
|
-
|
|
1987
|
+
case 2:
|
|
1988
|
+
status = _context10.sent;
|
|
1989
|
+
_context10.next = 3;
|
|
1983
1990
|
return _this2.ContentObjectMetadata({
|
|
1984
1991
|
objectId: objectId,
|
|
1985
1992
|
libraryId: libraryId,
|
|
@@ -1987,50 +1994,50 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
1987
1994
|
// live_recording_config/url is the old path
|
|
1988
1995
|
"live_recording_config/url"]
|
|
1989
1996
|
});
|
|
1990
|
-
case
|
|
1991
|
-
streamMeta =
|
|
1997
|
+
case 3:
|
|
1998
|
+
streamMeta = _context10.sent;
|
|
1992
1999
|
url = streamMeta.live_recording_config.reference_url || streamMeta.live_recording_config.url;
|
|
1993
2000
|
isActive = [STATUS_MAP.STARTING, STATUS_MAP.RUNNING, STATUS_MAP.STALLED, STATUS_MAP.STOPPED].includes(status.state);
|
|
1994
2001
|
if (url && isActive) {
|
|
1995
2002
|
activeUrlMap[url] = true;
|
|
1996
2003
|
}
|
|
1997
|
-
case
|
|
2004
|
+
case 4:
|
|
1998
2005
|
case "end":
|
|
1999
|
-
return
|
|
2006
|
+
return _context10.stop();
|
|
2000
2007
|
}
|
|
2001
|
-
},
|
|
2008
|
+
}, _callee10);
|
|
2002
2009
|
}));
|
|
2003
|
-
return function (
|
|
2004
|
-
return
|
|
2010
|
+
return function (_x10) {
|
|
2011
|
+
return _ref23.apply(this, arguments);
|
|
2005
2012
|
};
|
|
2006
2013
|
}());
|
|
2007
|
-
case
|
|
2014
|
+
case 8:
|
|
2008
2015
|
streamUrlStatus = {};
|
|
2009
|
-
|
|
2010
|
-
|
|
2016
|
+
_t24 = this;
|
|
2017
|
+
_context11.next = 9;
|
|
2011
2018
|
return this.ContentObjectLibraryId({
|
|
2012
2019
|
objectId: siteId
|
|
2013
2020
|
});
|
|
2014
|
-
case
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
libraryId:
|
|
2019
|
-
objectId:
|
|
2021
|
+
case 9:
|
|
2022
|
+
_t25 = _context11.sent;
|
|
2023
|
+
_t26 = siteId;
|
|
2024
|
+
_t27 = {
|
|
2025
|
+
libraryId: _t25,
|
|
2026
|
+
objectId: _t26,
|
|
2020
2027
|
metadataSubtree: "/live_stream_urls",
|
|
2021
2028
|
resolveLinks: true,
|
|
2022
2029
|
resolveIgnoreErrors: true
|
|
2023
2030
|
};
|
|
2024
|
-
|
|
2025
|
-
return
|
|
2026
|
-
case
|
|
2027
|
-
streamUrls =
|
|
2031
|
+
_context11.next = 10;
|
|
2032
|
+
return _t24.ContentObjectMetadata.call(_t24, _t27);
|
|
2033
|
+
case 10:
|
|
2034
|
+
streamUrls = _context11.sent;
|
|
2028
2035
|
if (streamUrls) {
|
|
2029
|
-
|
|
2036
|
+
_context11.next = 11;
|
|
2030
2037
|
break;
|
|
2031
2038
|
}
|
|
2032
2039
|
throw Error("No pre-allocated URLs configured");
|
|
2033
|
-
case
|
|
2040
|
+
case 11:
|
|
2034
2041
|
Object.keys(streamUrls || {}).forEach(function (protocol) {
|
|
2035
2042
|
streamUrlStatus[protocol] = streamUrls[protocol].map(function (url) {
|
|
2036
2043
|
return {
|
|
@@ -2039,16 +2046,16 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
2039
2046
|
};
|
|
2040
2047
|
});
|
|
2041
2048
|
});
|
|
2042
|
-
return
|
|
2043
|
-
case
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
console.error(
|
|
2047
|
-
case
|
|
2049
|
+
return _context11.abrupt("return", streamUrlStatus);
|
|
2050
|
+
case 12:
|
|
2051
|
+
_context11.prev = 12;
|
|
2052
|
+
_t28 = _context11["catch"](1);
|
|
2053
|
+
console.error(_t28);
|
|
2054
|
+
case 13:
|
|
2048
2055
|
case "end":
|
|
2049
|
-
return
|
|
2056
|
+
return _context11.stop();
|
|
2050
2057
|
}
|
|
2051
|
-
},
|
|
2058
|
+
}, _callee11, this, [[1, 12]]);
|
|
2052
2059
|
}));
|
|
2053
2060
|
|
|
2054
2061
|
/**
|
|
@@ -2107,89 +2114,89 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
2107
2114
|
*/
|
|
2108
2115
|
|
|
2109
2116
|
exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
2110
|
-
var
|
|
2111
|
-
var name, targetObjectId, eventId,
|
|
2112
|
-
return _regeneratorRuntime.wrap(function
|
|
2113
|
-
while (1) switch (
|
|
2117
|
+
var _ref25 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref24) {
|
|
2118
|
+
var name, targetObjectId, eventId, _ref24$streams, streams, _ref24$finalize, finalize, _ref24$recordingPerio, recordingPeriod, _ref24$startTime, startTime, _ref24$endTime, endTime, objectId, abrProfile, status, libraryId, targetLibraryId, kmsAddress, kmsCapId, kmsCap, liveHash, event, _yield$this$EditConte2, writeToken, abrMezInitBody, finalizeResponse, _t29, _t30;
|
|
2119
|
+
return _regeneratorRuntime.wrap(function (_context12) {
|
|
2120
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
2114
2121
|
case 0:
|
|
2115
|
-
name =
|
|
2122
|
+
name = _ref24.name, targetObjectId = _ref24.targetObjectId, eventId = _ref24.eventId, _ref24$streams = _ref24.streams, streams = _ref24$streams === void 0 ? null : _ref24$streams, _ref24$finalize = _ref24.finalize, finalize = _ref24$finalize === void 0 ? true : _ref24$finalize, _ref24$recordingPerio = _ref24.recordingPeriod, recordingPeriod = _ref24$recordingPerio === void 0 ? -1 : _ref24$recordingPerio, _ref24$startTime = _ref24.startTime, startTime = _ref24$startTime === void 0 ? "" : _ref24$startTime, _ref24$endTime = _ref24.endTime, endTime = _ref24$endTime === void 0 ? "" : _ref24$endTime;
|
|
2116
2123
|
objectId = name;
|
|
2117
2124
|
abrProfile = require("../abr_profiles/abr_profile_live_to_vod.js");
|
|
2118
|
-
|
|
2125
|
+
_context12.next = 1;
|
|
2119
2126
|
return this.StreamStatus({
|
|
2120
2127
|
name: name
|
|
2121
2128
|
});
|
|
2122
|
-
case
|
|
2123
|
-
status =
|
|
2129
|
+
case 1:
|
|
2130
|
+
status = _context12.sent;
|
|
2124
2131
|
libraryId = status.library_id;
|
|
2125
2132
|
this.Log("Copying stream ".concat(name, " to target ").concat(targetObjectId));
|
|
2126
2133
|
ValidateObject(targetObjectId);
|
|
2127
|
-
|
|
2134
|
+
_context12.next = 2;
|
|
2128
2135
|
return this.ContentObjectLibraryId({
|
|
2129
2136
|
objectId: targetObjectId
|
|
2130
2137
|
});
|
|
2131
|
-
case
|
|
2132
|
-
targetLibraryId =
|
|
2133
|
-
|
|
2138
|
+
case 2:
|
|
2139
|
+
targetLibraryId = _context12.sent;
|
|
2140
|
+
_context12.next = 3;
|
|
2134
2141
|
return this.authClient.KMSAddress({
|
|
2135
2142
|
objectId: targetObjectId
|
|
2136
2143
|
});
|
|
2137
|
-
case
|
|
2138
|
-
kmsAddress =
|
|
2144
|
+
case 3:
|
|
2145
|
+
kmsAddress = _context12.sent;
|
|
2139
2146
|
kmsCapId = "eluv.caps.ikms".concat(this.utils.AddressToHash(kmsAddress));
|
|
2140
|
-
|
|
2147
|
+
_context12.next = 4;
|
|
2141
2148
|
return this.ContentObjectMetadata({
|
|
2142
2149
|
libraryId: targetLibraryId,
|
|
2143
2150
|
objectId: targetObjectId,
|
|
2144
2151
|
metadataSubtree: kmsCapId
|
|
2145
2152
|
});
|
|
2146
|
-
case
|
|
2147
|
-
kmsCap =
|
|
2153
|
+
case 4:
|
|
2154
|
+
kmsCap = _context12.sent;
|
|
2148
2155
|
if (kmsCap) {
|
|
2149
|
-
|
|
2156
|
+
_context12.next = 5;
|
|
2150
2157
|
break;
|
|
2151
2158
|
}
|
|
2152
2159
|
throw Error("No content encryption key set for object ".concat(targetObjectId));
|
|
2153
|
-
case
|
|
2154
|
-
|
|
2160
|
+
case 5:
|
|
2161
|
+
_context12.prev = 5;
|
|
2155
2162
|
status.live_object_id = objectId;
|
|
2156
|
-
|
|
2163
|
+
_context12.next = 6;
|
|
2157
2164
|
return this.LatestVersionHash({
|
|
2158
2165
|
objectId: objectId,
|
|
2159
2166
|
libraryId: libraryId
|
|
2160
2167
|
});
|
|
2161
|
-
case
|
|
2162
|
-
liveHash =
|
|
2168
|
+
case 6:
|
|
2169
|
+
liveHash = _context12.sent;
|
|
2163
2170
|
status.live_hash = liveHash;
|
|
2164
2171
|
if (!eventId) {
|
|
2165
|
-
|
|
2172
|
+
_context12.next = 8;
|
|
2166
2173
|
break;
|
|
2167
2174
|
}
|
|
2168
|
-
|
|
2175
|
+
_context12.next = 7;
|
|
2169
2176
|
return this.CueInfo({
|
|
2170
2177
|
eventId: eventId,
|
|
2171
2178
|
status: status
|
|
2172
2179
|
});
|
|
2173
|
-
case
|
|
2174
|
-
event =
|
|
2180
|
+
case 7:
|
|
2181
|
+
event = _context12.sent;
|
|
2175
2182
|
if (event.eventStart && event.eventEnd) {
|
|
2176
2183
|
startTime = event.eventStart;
|
|
2177
2184
|
endTime = event.eventEnd;
|
|
2178
2185
|
}
|
|
2179
|
-
case
|
|
2180
|
-
|
|
2186
|
+
case 8:
|
|
2187
|
+
_context12.next = 9;
|
|
2181
2188
|
return this.EditContentObject({
|
|
2182
2189
|
objectId: targetObjectId,
|
|
2183
2190
|
libraryId: targetLibraryId
|
|
2184
2191
|
});
|
|
2185
|
-
case
|
|
2186
|
-
_yield$this$EditConte2 =
|
|
2192
|
+
case 9:
|
|
2193
|
+
_yield$this$EditConte2 = _context12.sent;
|
|
2187
2194
|
writeToken = _yield$this$EditConte2.writeToken;
|
|
2188
2195
|
status.target_object_id = targetObjectId;
|
|
2189
2196
|
status.target_library_id = targetLibraryId;
|
|
2190
2197
|
status.target_write_token = writeToken;
|
|
2191
2198
|
this.Log("Process live source (takes around 20 sec per hour of content)");
|
|
2192
|
-
|
|
2199
|
+
_context12.next = 10;
|
|
2193
2200
|
return this.CallBitcodeMethod({
|
|
2194
2201
|
libraryId: targetLibraryId,
|
|
2195
2202
|
objectId: targetObjectId,
|
|
@@ -2208,7 +2215,7 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2208
2215
|
constant: false,
|
|
2209
2216
|
format: "text"
|
|
2210
2217
|
});
|
|
2211
|
-
case
|
|
2218
|
+
case 10:
|
|
2212
2219
|
abrMezInitBody = {
|
|
2213
2220
|
abr_profile: abrProfile,
|
|
2214
2221
|
"offering_key": "default",
|
|
@@ -2216,7 +2223,7 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2216
2223
|
"variant_key": "default",
|
|
2217
2224
|
"keep_other_streams": false
|
|
2218
2225
|
};
|
|
2219
|
-
|
|
2226
|
+
_context12.next = 11;
|
|
2220
2227
|
return this.CallBitcodeMethod({
|
|
2221
2228
|
libraryId: targetLibraryId,
|
|
2222
2229
|
objectId: targetObjectId,
|
|
@@ -2226,9 +2233,9 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2226
2233
|
constant: false,
|
|
2227
2234
|
format: "text"
|
|
2228
2235
|
});
|
|
2229
|
-
case
|
|
2230
|
-
|
|
2231
|
-
|
|
2236
|
+
case 11:
|
|
2237
|
+
_context12.prev = 11;
|
|
2238
|
+
_context12.next = 12;
|
|
2232
2239
|
return this.CallBitcodeMethod({
|
|
2233
2240
|
libraryId: targetLibraryId,
|
|
2234
2241
|
objectId: targetObjectId,
|
|
@@ -2238,16 +2245,16 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2238
2245
|
constant: false,
|
|
2239
2246
|
format: "text"
|
|
2240
2247
|
});
|
|
2241
|
-
case
|
|
2242
|
-
|
|
2248
|
+
case 12:
|
|
2249
|
+
_context12.next = 14;
|
|
2243
2250
|
break;
|
|
2244
|
-
case
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
console.error("Unable to call /media/live_to_vod/copy",
|
|
2248
|
-
throw
|
|
2249
|
-
case
|
|
2250
|
-
|
|
2251
|
+
case 13:
|
|
2252
|
+
_context12.prev = 13;
|
|
2253
|
+
_t29 = _context12["catch"](11);
|
|
2254
|
+
console.error("Unable to call /media/live_to_vod/copy", _t29);
|
|
2255
|
+
throw _t29;
|
|
2256
|
+
case 14:
|
|
2257
|
+
_context12.next = 15;
|
|
2251
2258
|
return this.CallBitcodeMethod({
|
|
2252
2259
|
libraryId: targetLibraryId,
|
|
2253
2260
|
objectId: targetObjectId,
|
|
@@ -2257,22 +2264,22 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2257
2264
|
constant: false,
|
|
2258
2265
|
format: "text"
|
|
2259
2266
|
});
|
|
2260
|
-
case
|
|
2267
|
+
case 15:
|
|
2261
2268
|
if (!finalize) {
|
|
2262
|
-
|
|
2269
|
+
_context12.next = 17;
|
|
2263
2270
|
break;
|
|
2264
2271
|
}
|
|
2265
|
-
|
|
2272
|
+
_context12.next = 16;
|
|
2266
2273
|
return this.FinalizeContentObject({
|
|
2267
2274
|
libraryId: targetLibraryId,
|
|
2268
2275
|
objectId: targetObjectId,
|
|
2269
2276
|
writeToken: writeToken,
|
|
2270
2277
|
commitMessage: "Live Stream to VoD"
|
|
2271
2278
|
});
|
|
2272
|
-
case
|
|
2273
|
-
finalizeResponse =
|
|
2279
|
+
case 16:
|
|
2280
|
+
finalizeResponse = _context12.sent;
|
|
2274
2281
|
status.target_hash = finalizeResponse.hash;
|
|
2275
|
-
case
|
|
2282
|
+
case 17:
|
|
2276
2283
|
// Clean up unnecessary status items
|
|
2277
2284
|
delete status.playout_urls;
|
|
2278
2285
|
delete status.lro_status_url;
|
|
@@ -2280,20 +2287,20 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2280
2287
|
delete status.recording_period_sequence;
|
|
2281
2288
|
delete status.edge_meta_size;
|
|
2282
2289
|
delete status.insertions;
|
|
2283
|
-
return
|
|
2284
|
-
case
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
this.Log(
|
|
2288
|
-
throw
|
|
2289
|
-
case
|
|
2290
|
+
return _context12.abrupt("return", status);
|
|
2291
|
+
case 18:
|
|
2292
|
+
_context12.prev = 18;
|
|
2293
|
+
_t30 = _context12["catch"](5);
|
|
2294
|
+
this.Log(_t30, true);
|
|
2295
|
+
throw _t30;
|
|
2296
|
+
case 19:
|
|
2290
2297
|
case "end":
|
|
2291
|
-
return
|
|
2298
|
+
return _context12.stop();
|
|
2292
2299
|
}
|
|
2293
|
-
},
|
|
2300
|
+
}, _callee12, this, [[5, 18], [11, 13]]);
|
|
2294
2301
|
}));
|
|
2295
|
-
return function (
|
|
2296
|
-
return
|
|
2302
|
+
return function (_x11) {
|
|
2303
|
+
return _ref25.apply(this, arguments);
|
|
2297
2304
|
};
|
|
2298
2305
|
}();
|
|
2299
2306
|
|
|
@@ -2314,48 +2321,48 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2314
2321
|
* @return {Promise<Object>} - The finalize response
|
|
2315
2322
|
*/
|
|
2316
2323
|
exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
2317
|
-
var
|
|
2318
|
-
var libraryId, objectId, writeToken, types,
|
|
2319
|
-
return _regeneratorRuntime.wrap(function
|
|
2320
|
-
while (1) switch (
|
|
2324
|
+
var _ref27 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref26) {
|
|
2325
|
+
var libraryId, objectId, writeToken, types, _ref26$finalize, finalize, _yield$this$EditConte3, edgeWriteToken, metadataPath, objectMetadata, finalizeResponse;
|
|
2326
|
+
return _regeneratorRuntime.wrap(function (_context13) {
|
|
2327
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
2321
2328
|
case 0:
|
|
2322
|
-
libraryId =
|
|
2329
|
+
libraryId = _ref26.libraryId, objectId = _ref26.objectId, writeToken = _ref26.writeToken, types = _ref26.types, _ref26$finalize = _ref26.finalize, finalize = _ref26$finalize === void 0 ? true : _ref26$finalize;
|
|
2323
2330
|
ValidateObject(objectId);
|
|
2324
2331
|
if (libraryId) {
|
|
2325
|
-
|
|
2332
|
+
_context13.next = 2;
|
|
2326
2333
|
break;
|
|
2327
2334
|
}
|
|
2328
|
-
|
|
2335
|
+
_context13.next = 1;
|
|
2329
2336
|
return this.ContentObjectLibraryId({
|
|
2330
2337
|
objectId: objectId
|
|
2331
2338
|
});
|
|
2332
|
-
case
|
|
2333
|
-
libraryId =
|
|
2334
|
-
case
|
|
2339
|
+
case 1:
|
|
2340
|
+
libraryId = _context13.sent;
|
|
2341
|
+
case 2:
|
|
2335
2342
|
if (writeToken) {
|
|
2336
|
-
|
|
2343
|
+
_context13.next = 4;
|
|
2337
2344
|
break;
|
|
2338
2345
|
}
|
|
2339
|
-
|
|
2346
|
+
_context13.next = 3;
|
|
2340
2347
|
return this.EditContentObject({
|
|
2341
2348
|
objectId: objectId,
|
|
2342
2349
|
libraryId: libraryId
|
|
2343
2350
|
});
|
|
2344
|
-
case
|
|
2345
|
-
_yield$this$EditConte3 =
|
|
2351
|
+
case 3:
|
|
2352
|
+
_yield$this$EditConte3 = _context13.sent;
|
|
2346
2353
|
writeToken = _yield$this$EditConte3.writeToken;
|
|
2347
|
-
case
|
|
2354
|
+
case 4:
|
|
2348
2355
|
this.Log("Removing watermark types: ".concat(types.join(", "), " ").concat(libraryId, " ").concat(objectId));
|
|
2349
|
-
|
|
2356
|
+
_context13.next = 5;
|
|
2350
2357
|
return this.ContentObjectMetadata({
|
|
2351
2358
|
objectId: objectId,
|
|
2352
2359
|
libraryId: libraryId,
|
|
2353
2360
|
metadataSubtree: "/live_recording/fabric_config/edge_write_token"
|
|
2354
2361
|
});
|
|
2355
|
-
case
|
|
2356
|
-
edgeWriteToken =
|
|
2362
|
+
case 5:
|
|
2363
|
+
edgeWriteToken = _context13.sent;
|
|
2357
2364
|
metadataPath = "live_recording/playout_config";
|
|
2358
|
-
|
|
2365
|
+
_context13.next = 6;
|
|
2359
2366
|
return this.ContentObjectMetadata({
|
|
2360
2367
|
libraryId: libraryId,
|
|
2361
2368
|
objectId: objectId,
|
|
@@ -2363,14 +2370,14 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2363
2370
|
metadataSubtree: metadataPath,
|
|
2364
2371
|
resolveLinks: false
|
|
2365
2372
|
});
|
|
2366
|
-
case
|
|
2367
|
-
objectMetadata =
|
|
2373
|
+
case 6:
|
|
2374
|
+
objectMetadata = _context13.sent;
|
|
2368
2375
|
if (objectMetadata) {
|
|
2369
|
-
|
|
2376
|
+
_context13.next = 7;
|
|
2370
2377
|
break;
|
|
2371
2378
|
}
|
|
2372
2379
|
throw Error("Stream object must be configured before removing a watermark");
|
|
2373
|
-
case
|
|
2380
|
+
case 7:
|
|
2374
2381
|
types.forEach(function (type) {
|
|
2375
2382
|
if (type === "text") {
|
|
2376
2383
|
delete objectMetadata.simple_watermark;
|
|
@@ -2380,7 +2387,7 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2380
2387
|
delete objectMetadata.forensic_watermark;
|
|
2381
2388
|
}
|
|
2382
2389
|
});
|
|
2383
|
-
|
|
2390
|
+
_context13.next = 8;
|
|
2384
2391
|
return this.ReplaceMetadata({
|
|
2385
2392
|
libraryId: libraryId,
|
|
2386
2393
|
objectId: objectId,
|
|
@@ -2388,12 +2395,12 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2388
2395
|
metadataSubtree: metadataPath,
|
|
2389
2396
|
metadata: objectMetadata
|
|
2390
2397
|
});
|
|
2391
|
-
case
|
|
2398
|
+
case 8:
|
|
2392
2399
|
if (!edgeWriteToken) {
|
|
2393
|
-
|
|
2400
|
+
_context13.next = 9;
|
|
2394
2401
|
break;
|
|
2395
2402
|
}
|
|
2396
|
-
|
|
2403
|
+
_context13.next = 9;
|
|
2397
2404
|
return this.ReplaceMetadata({
|
|
2398
2405
|
libraryId: libraryId,
|
|
2399
2406
|
objectId: objectId,
|
|
@@ -2401,29 +2408,29 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2401
2408
|
metadataSubtree: metadataPath,
|
|
2402
2409
|
metadata: objectMetadata
|
|
2403
2410
|
});
|
|
2404
|
-
case
|
|
2411
|
+
case 9:
|
|
2405
2412
|
if (!finalize) {
|
|
2406
|
-
|
|
2413
|
+
_context13.next = 11;
|
|
2407
2414
|
break;
|
|
2408
2415
|
}
|
|
2409
|
-
|
|
2416
|
+
_context13.next = 10;
|
|
2410
2417
|
return this.FinalizeContentObject({
|
|
2411
2418
|
libraryId: libraryId,
|
|
2412
2419
|
objectId: objectId,
|
|
2413
2420
|
writeToken: writeToken,
|
|
2414
2421
|
commitMessage: "Watermark removed"
|
|
2415
2422
|
});
|
|
2416
|
-
case
|
|
2417
|
-
finalizeResponse =
|
|
2418
|
-
return
|
|
2419
|
-
case
|
|
2423
|
+
case 10:
|
|
2424
|
+
finalizeResponse = _context13.sent;
|
|
2425
|
+
return _context13.abrupt("return", finalizeResponse);
|
|
2426
|
+
case 11:
|
|
2420
2427
|
case "end":
|
|
2421
|
-
return
|
|
2428
|
+
return _context13.stop();
|
|
2422
2429
|
}
|
|
2423
|
-
},
|
|
2430
|
+
}, _callee13, this);
|
|
2424
2431
|
}));
|
|
2425
|
-
return function (
|
|
2426
|
-
return
|
|
2432
|
+
return function (_x12) {
|
|
2433
|
+
return _ref27.apply(this, arguments);
|
|
2427
2434
|
};
|
|
2428
2435
|
}();
|
|
2429
2436
|
|
|
@@ -2478,49 +2485,49 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2478
2485
|
* @return {Promise<Object>} - The finalize response
|
|
2479
2486
|
*/
|
|
2480
2487
|
exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
2481
|
-
var
|
|
2482
|
-
var libraryId, objectId, writeToken, simpleWatermark, imageWatermark, forensicWatermark,
|
|
2483
|
-
return _regeneratorRuntime.wrap(function
|
|
2484
|
-
while (1) switch (
|
|
2488
|
+
var _ref29 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref28) {
|
|
2489
|
+
var libraryId, objectId, writeToken, simpleWatermark, imageWatermark, forensicWatermark, _ref28$finalize, finalize, _yield$this$EditConte4, edgeWriteToken, watermarkType, metadataPath, objectMetadata, watermarkArgCount, response, finalizeResponse;
|
|
2490
|
+
return _regeneratorRuntime.wrap(function (_context14) {
|
|
2491
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
2485
2492
|
case 0:
|
|
2486
|
-
libraryId =
|
|
2493
|
+
libraryId = _ref28.libraryId, objectId = _ref28.objectId, writeToken = _ref28.writeToken, simpleWatermark = _ref28.simpleWatermark, imageWatermark = _ref28.imageWatermark, forensicWatermark = _ref28.forensicWatermark, _ref28$finalize = _ref28.finalize, finalize = _ref28$finalize === void 0 ? true : _ref28$finalize;
|
|
2487
2494
|
ValidateObject(objectId);
|
|
2488
2495
|
if (libraryId) {
|
|
2489
|
-
|
|
2496
|
+
_context14.next = 2;
|
|
2490
2497
|
break;
|
|
2491
2498
|
}
|
|
2492
|
-
|
|
2499
|
+
_context14.next = 1;
|
|
2493
2500
|
return this.ContentObjectLibraryId({
|
|
2494
2501
|
objectId: objectId
|
|
2495
2502
|
});
|
|
2496
|
-
case
|
|
2497
|
-
libraryId =
|
|
2498
|
-
case
|
|
2503
|
+
case 1:
|
|
2504
|
+
libraryId = _context14.sent;
|
|
2505
|
+
case 2:
|
|
2499
2506
|
if (writeToken) {
|
|
2500
|
-
|
|
2507
|
+
_context14.next = 4;
|
|
2501
2508
|
break;
|
|
2502
2509
|
}
|
|
2503
|
-
|
|
2510
|
+
_context14.next = 3;
|
|
2504
2511
|
return this.EditContentObject({
|
|
2505
2512
|
objectId: objectId,
|
|
2506
2513
|
libraryId: libraryId
|
|
2507
2514
|
});
|
|
2508
|
-
case
|
|
2509
|
-
_yield$this$EditConte4 =
|
|
2515
|
+
case 3:
|
|
2516
|
+
_yield$this$EditConte4 = _context14.sent;
|
|
2510
2517
|
writeToken = _yield$this$EditConte4.writeToken;
|
|
2511
|
-
case
|
|
2512
|
-
|
|
2518
|
+
case 4:
|
|
2519
|
+
_context14.next = 5;
|
|
2513
2520
|
return this.ContentObjectMetadata({
|
|
2514
2521
|
objectId: objectId,
|
|
2515
2522
|
libraryId: libraryId,
|
|
2516
2523
|
metadataSubtree: "/live_recording/fabric_config/edge_write_token"
|
|
2517
2524
|
});
|
|
2518
|
-
case
|
|
2519
|
-
edgeWriteToken =
|
|
2525
|
+
case 5:
|
|
2526
|
+
edgeWriteToken = _context14.sent;
|
|
2520
2527
|
watermarkType = imageWatermark ? "image" : forensicWatermark ? "forensic" : "text";
|
|
2521
2528
|
metadataPath = "live_recording/playout_config";
|
|
2522
2529
|
this.Log("Adding watermarking type: ".concat(watermarkType, " ").concat(libraryId, " ").concat(objectId));
|
|
2523
|
-
|
|
2530
|
+
_context14.next = 6;
|
|
2524
2531
|
return this.ContentObjectMetadata({
|
|
2525
2532
|
libraryId: libraryId,
|
|
2526
2533
|
objectId: objectId,
|
|
@@ -2528,30 +2535,30 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2528
2535
|
metadataSubtree: metadataPath,
|
|
2529
2536
|
resolveLinks: false
|
|
2530
2537
|
});
|
|
2531
|
-
case
|
|
2532
|
-
objectMetadata =
|
|
2538
|
+
case 6:
|
|
2539
|
+
objectMetadata = _context14.sent;
|
|
2533
2540
|
if (objectMetadata) {
|
|
2534
|
-
|
|
2541
|
+
_context14.next = 7;
|
|
2535
2542
|
break;
|
|
2536
2543
|
}
|
|
2537
2544
|
throw Error("Stream object must be configured before adding a watermark");
|
|
2538
|
-
case
|
|
2545
|
+
case 7:
|
|
2539
2546
|
watermarkArgCount = [simpleWatermark, imageWatermark, forensicWatermark].filter(function (i) {
|
|
2540
2547
|
return !!i;
|
|
2541
2548
|
}).length;
|
|
2542
2549
|
console.log("watermark arg count", watermarkArgCount);
|
|
2543
2550
|
if (!(watermarkArgCount === 0)) {
|
|
2544
|
-
|
|
2551
|
+
_context14.next = 8;
|
|
2545
2552
|
break;
|
|
2546
2553
|
}
|
|
2547
2554
|
throw Error("No watermark was provided");
|
|
2548
|
-
case
|
|
2555
|
+
case 8:
|
|
2549
2556
|
if (!(watermarkArgCount > 1)) {
|
|
2550
|
-
|
|
2557
|
+
_context14.next = 9;
|
|
2551
2558
|
break;
|
|
2552
2559
|
}
|
|
2553
2560
|
throw Error("Only one watermark is allowed");
|
|
2554
|
-
case
|
|
2561
|
+
case 9:
|
|
2555
2562
|
if (simpleWatermark) {
|
|
2556
2563
|
objectMetadata.simple_watermark = simpleWatermark;
|
|
2557
2564
|
} else if (imageWatermark) {
|
|
@@ -2559,7 +2566,7 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2559
2566
|
} else if (forensicWatermark) {
|
|
2560
2567
|
objectMetadata.forensic_watermark = forensicWatermark;
|
|
2561
2568
|
}
|
|
2562
|
-
|
|
2569
|
+
_context14.next = 10;
|
|
2563
2570
|
return this.ReplaceMetadata({
|
|
2564
2571
|
libraryId: libraryId,
|
|
2565
2572
|
objectId: objectId,
|
|
@@ -2567,12 +2574,12 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2567
2574
|
metadataSubtree: metadataPath,
|
|
2568
2575
|
metadata: objectMetadata
|
|
2569
2576
|
});
|
|
2570
|
-
case
|
|
2577
|
+
case 10:
|
|
2571
2578
|
if (!edgeWriteToken) {
|
|
2572
|
-
|
|
2579
|
+
_context14.next = 11;
|
|
2573
2580
|
break;
|
|
2574
2581
|
}
|
|
2575
|
-
|
|
2582
|
+
_context14.next = 11;
|
|
2576
2583
|
return this.ReplaceMetadata({
|
|
2577
2584
|
libraryId: libraryId,
|
|
2578
2585
|
objectId: objectId,
|
|
@@ -2580,36 +2587,36 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2580
2587
|
metadataSubtree: metadataPath,
|
|
2581
2588
|
metadata: objectMetadata
|
|
2582
2589
|
});
|
|
2583
|
-
case
|
|
2590
|
+
case 11:
|
|
2584
2591
|
response = {
|
|
2585
2592
|
"imageWatermark": objectMetadata.image_watermark,
|
|
2586
2593
|
"textWatermark": objectMetadata.simple_watermark,
|
|
2587
2594
|
"forensicWatermark": objectMetadata.forensic_watermark
|
|
2588
2595
|
};
|
|
2589
2596
|
if (!finalize) {
|
|
2590
|
-
|
|
2597
|
+
_context14.next = 13;
|
|
2591
2598
|
break;
|
|
2592
2599
|
}
|
|
2593
|
-
|
|
2600
|
+
_context14.next = 12;
|
|
2594
2601
|
return this.FinalizeContentObject({
|
|
2595
2602
|
libraryId: libraryId,
|
|
2596
2603
|
objectId: objectId,
|
|
2597
2604
|
writeToken: writeToken,
|
|
2598
2605
|
commitMessage: "Watermark set"
|
|
2599
2606
|
});
|
|
2600
|
-
case
|
|
2601
|
-
finalizeResponse =
|
|
2607
|
+
case 12:
|
|
2608
|
+
finalizeResponse = _context14.sent;
|
|
2602
2609
|
response.hash = finalizeResponse.hash;
|
|
2603
|
-
case
|
|
2604
|
-
return
|
|
2605
|
-
case
|
|
2610
|
+
case 13:
|
|
2611
|
+
return _context14.abrupt("return", response);
|
|
2612
|
+
case 14:
|
|
2606
2613
|
case "end":
|
|
2607
|
-
return
|
|
2614
|
+
return _context14.stop();
|
|
2608
2615
|
}
|
|
2609
|
-
},
|
|
2616
|
+
}, _callee14, this);
|
|
2610
2617
|
}));
|
|
2611
|
-
return function (
|
|
2612
|
-
return
|
|
2618
|
+
return function (_x13) {
|
|
2619
|
+
return _ref29.apply(this, arguments);
|
|
2613
2620
|
};
|
|
2614
2621
|
}();
|
|
2615
2622
|
|
|
@@ -2627,13 +2634,13 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2627
2634
|
* @returns {Promise<Object>} - Response describing audit results
|
|
2628
2635
|
*/
|
|
2629
2636
|
exports.AuditStream = /*#__PURE__*/function () {
|
|
2630
|
-
var
|
|
2637
|
+
var _ref31 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref30) {
|
|
2631
2638
|
var objectId, versionHash, salt, samples, authorizationToken;
|
|
2632
|
-
return _regeneratorRuntime.wrap(function
|
|
2633
|
-
while (1) switch (
|
|
2639
|
+
return _regeneratorRuntime.wrap(function (_context15) {
|
|
2640
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
2634
2641
|
case 0:
|
|
2635
|
-
objectId =
|
|
2636
|
-
|
|
2642
|
+
objectId = _ref30.objectId, versionHash = _ref30.versionHash, salt = _ref30.salt, samples = _ref30.samples, authorizationToken = _ref30.authorizationToken;
|
|
2643
|
+
_context15.next = 1;
|
|
2637
2644
|
return ContentObjectAudit.AuditContentObject({
|
|
2638
2645
|
client: this,
|
|
2639
2646
|
objectId: objectId,
|
|
@@ -2643,15 +2650,15 @@ exports.AuditStream = /*#__PURE__*/function () {
|
|
|
2643
2650
|
live: true,
|
|
2644
2651
|
authorizationToken: authorizationToken
|
|
2645
2652
|
});
|
|
2646
|
-
case
|
|
2647
|
-
return
|
|
2648
|
-
case
|
|
2653
|
+
case 1:
|
|
2654
|
+
return _context15.abrupt("return", _context15.sent);
|
|
2655
|
+
case 2:
|
|
2649
2656
|
case "end":
|
|
2650
|
-
return
|
|
2657
|
+
return _context15.stop();
|
|
2651
2658
|
}
|
|
2652
|
-
},
|
|
2659
|
+
}, _callee15, this);
|
|
2653
2660
|
}));
|
|
2654
|
-
return function (
|
|
2655
|
-
return
|
|
2661
|
+
return function (_x14) {
|
|
2662
|
+
return _ref31.apply(this, arguments);
|
|
2656
2663
|
};
|
|
2657
2664
|
}();
|