@eluvio/elv-client-js 4.0.146 → 4.1.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 -68
- package/dist/ElvClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvClient-node-min.js +2 -67
- 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 -68
- package/dist/ElvWalletClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-node-min.js +2 -67
- package/dist/ElvWalletClient-node-min.js.LICENSE.txt +72 -0
- package/dist/src/AuthorizationClient.js +704 -703
- package/dist/src/ContentObjectAudit.js +56 -56
- package/dist/src/Crypto.js +85 -86
- package/dist/src/ElvClient.js +483 -471
- package/dist/src/ElvWallet.js +23 -23
- package/dist/src/EthClient.js +308 -307
- package/dist/src/FrameClient.js +62 -62
- package/dist/src/HttpClient.js +59 -58
- package/dist/src/PermissionsClient.js +470 -470
- package/dist/src/RemoteSigner.js +77 -76
- package/dist/src/UserProfileClient.js +357 -354
- package/dist/src/Utils.js +65 -64
- package/dist/src/Validation.js +10 -10
- package/dist/src/client/ABRPublishing.js +237 -237
- package/dist/src/client/AccessGroups.js +477 -474
- package/dist/src/client/ContentAccess.js +1749 -1802
- package/dist/src/client/ContentManagement.js +871 -871
- package/dist/src/client/Contracts.js +575 -578
- package/dist/src/client/Files.js +700 -684
- package/dist/src/client/LiveStream.js +659 -650
- package/dist/src/client/NFT.js +14 -14
- package/dist/src/client/NTP.js +84 -84
- package/dist/src/client/Shares.js +49 -49
- package/dist/src/walletClient/ClientMethods.js +977 -951
- package/dist/src/walletClient/Notifications.js +14 -14
- package/dist/src/walletClient/Profile.js +66 -66
- package/dist/src/walletClient/Utils.js +15 -15
- package/dist/src/walletClient/index.js +557 -550
- package/package.json +17 -16
- package/src/ElvClient.js +1 -0
- package/src/FrameClient.js +12 -0
- package/src/client/AccessGroups.js +1 -1
- package/src/client/ContentAccess.js +44 -71
- 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,
|
|
@@ -846,16 +846,16 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
});
|
|
849
|
-
case
|
|
849
|
+
case 7:
|
|
850
850
|
this.Log("Finalizing content draft: ", libraryId, objectId, writeToken);
|
|
851
|
-
_context5.next =
|
|
851
|
+
_context5.next = 8;
|
|
852
852
|
return this.FinalizeContentObject({
|
|
853
853
|
libraryId: libraryId,
|
|
854
854
|
objectId: objectId,
|
|
855
855
|
writeToken: writeToken,
|
|
856
856
|
commitMessage: "Create stream edge write token " + edgeToken
|
|
857
857
|
});
|
|
858
|
-
case
|
|
858
|
+
case 8:
|
|
859
859
|
response = _context5.sent;
|
|
860
860
|
objectHash = response.hash;
|
|
861
861
|
this.Log("Finalized object: ", objectHash);
|
|
@@ -875,14 +875,14 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
877
|
return _context5.abrupt("return", status);
|
|
878
|
-
case
|
|
878
|
+
case 9:
|
|
879
879
|
case "end":
|
|
880
880
|
return _context5.stop();
|
|
881
881
|
}
|
|
882
882
|
}, _callee5, this);
|
|
883
883
|
}));
|
|
884
884
|
return function (_x5) {
|
|
885
|
-
return
|
|
885
|
+
return _ref0.apply(this, arguments);
|
|
886
886
|
};
|
|
887
887
|
}();
|
|
888
888
|
|
|
@@ -903,36 +903,36 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
903
903
|
*
|
|
904
904
|
*/
|
|
905
905
|
exports.StreamStartOrStopOrReset = /*#__PURE__*/function () {
|
|
906
|
-
var
|
|
907
|
-
var name, op, status, _tries, tries;
|
|
908
|
-
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) {
|
|
909
909
|
while (1) switch (_context6.prev = _context6.next) {
|
|
910
910
|
case 0:
|
|
911
|
-
name =
|
|
911
|
+
name = _ref1.name, op = _ref1.op;
|
|
912
912
|
_context6.prev = 1;
|
|
913
|
-
_context6.next =
|
|
913
|
+
_context6.next = 2;
|
|
914
914
|
return this.StreamStatus({
|
|
915
915
|
name: name
|
|
916
916
|
});
|
|
917
|
-
case
|
|
917
|
+
case 2:
|
|
918
918
|
status = _context6.sent;
|
|
919
919
|
if (!(status.state != "stopped")) {
|
|
920
|
-
_context6.next =
|
|
920
|
+
_context6.next = 3;
|
|
921
921
|
break;
|
|
922
922
|
}
|
|
923
923
|
if (!(op === "start")) {
|
|
924
|
-
_context6.next =
|
|
924
|
+
_context6.next = 3;
|
|
925
925
|
break;
|
|
926
926
|
}
|
|
927
927
|
status.error = "Unable to start stream - state: " + status.state;
|
|
928
928
|
return _context6.abrupt("return", status);
|
|
929
|
-
case
|
|
929
|
+
case 3:
|
|
930
930
|
if (!(status.state == "running" || status.state == "starting" || status.state == "stalled")) {
|
|
931
|
-
_context6.next =
|
|
931
|
+
_context6.next = 12;
|
|
932
932
|
break;
|
|
933
933
|
}
|
|
934
|
-
_context6.prev =
|
|
935
|
-
_context6.next =
|
|
934
|
+
_context6.prev = 4;
|
|
935
|
+
_context6.next = 5;
|
|
936
936
|
return this.CallBitcodeMethod({
|
|
937
937
|
libraryId: status.library_id,
|
|
938
938
|
objectId: status.object_id,
|
|
@@ -940,50 +940,50 @@ exports.StreamStartOrStopOrReset = /*#__PURE__*/function () {
|
|
|
940
940
|
method: "/live/stop/" + status.tlro,
|
|
941
941
|
constant: false
|
|
942
942
|
});
|
|
943
|
-
case
|
|
944
|
-
_context6.next =
|
|
943
|
+
case 5:
|
|
944
|
+
_context6.next = 7;
|
|
945
945
|
break;
|
|
946
|
-
case
|
|
947
|
-
_context6.prev =
|
|
948
|
-
|
|
949
|
-
case
|
|
946
|
+
case 6:
|
|
947
|
+
_context6.prev = 6;
|
|
948
|
+
_t11 = _context6["catch"](4);
|
|
949
|
+
case 7:
|
|
950
950
|
// Wait until LRO is terminated
|
|
951
951
|
_tries = 10;
|
|
952
|
-
case
|
|
952
|
+
case 8:
|
|
953
953
|
if (!(status.state != "stopped" && _tries-- > 0)) {
|
|
954
|
-
_context6.next =
|
|
954
|
+
_context6.next = 11;
|
|
955
955
|
break;
|
|
956
956
|
}
|
|
957
957
|
console.log("Wait to terminate - ", status.state);
|
|
958
|
-
_context6.next =
|
|
958
|
+
_context6.next = 9;
|
|
959
959
|
return Sleep(1000);
|
|
960
|
-
case
|
|
961
|
-
_context6.next =
|
|
960
|
+
case 9:
|
|
961
|
+
_context6.next = 10;
|
|
962
962
|
return this.StreamStatus({
|
|
963
963
|
name: name
|
|
964
964
|
});
|
|
965
|
-
case
|
|
965
|
+
case 10:
|
|
966
966
|
status = _context6.sent;
|
|
967
|
-
_context6.next =
|
|
967
|
+
_context6.next = 8;
|
|
968
968
|
break;
|
|
969
|
-
case
|
|
969
|
+
case 11:
|
|
970
970
|
console.log("Status after stop - ", status.state);
|
|
971
971
|
if (!(_tries <= 0)) {
|
|
972
|
-
_context6.next =
|
|
972
|
+
_context6.next = 12;
|
|
973
973
|
break;
|
|
974
974
|
}
|
|
975
975
|
console.log("Failed to stop");
|
|
976
976
|
return _context6.abrupt("return", status);
|
|
977
|
-
case
|
|
977
|
+
case 12:
|
|
978
978
|
if (!(op === "stop")) {
|
|
979
|
-
_context6.next =
|
|
979
|
+
_context6.next = 13;
|
|
980
980
|
break;
|
|
981
981
|
}
|
|
982
982
|
return _context6.abrupt("return", status);
|
|
983
|
-
case
|
|
983
|
+
case 13:
|
|
984
984
|
console.log("STARTING", "edge_write_token", status.edge_write_token);
|
|
985
|
-
_context6.prev =
|
|
986
|
-
_context6.next =
|
|
985
|
+
_context6.prev = 14;
|
|
986
|
+
_context6.next = 15;
|
|
987
987
|
return this.CallBitcodeMethod({
|
|
988
988
|
libraryId: status.library_id,
|
|
989
989
|
objectId: status.object_id,
|
|
@@ -991,52 +991,52 @@ exports.StreamStartOrStopOrReset = /*#__PURE__*/function () {
|
|
|
991
991
|
method: "/live/start",
|
|
992
992
|
constant: false
|
|
993
993
|
});
|
|
994
|
-
case
|
|
995
|
-
_context6.next =
|
|
994
|
+
case 15:
|
|
995
|
+
_context6.next = 17;
|
|
996
996
|
break;
|
|
997
|
-
case
|
|
998
|
-
_context6.prev =
|
|
999
|
-
|
|
1000
|
-
console.log("LRO Start (failed): ",
|
|
997
|
+
case 16:
|
|
998
|
+
_context6.prev = 16;
|
|
999
|
+
_t12 = _context6["catch"](14);
|
|
1000
|
+
console.log("LRO Start (failed): ", _t12);
|
|
1001
1001
|
return _context6.abrupt("return", {
|
|
1002
1002
|
state: status.state,
|
|
1003
1003
|
error: "LRO start failed - must create a stream first"
|
|
1004
1004
|
});
|
|
1005
|
-
case
|
|
1005
|
+
case 17:
|
|
1006
1006
|
// Wait until LRO is 'starting'
|
|
1007
1007
|
tries = 10;
|
|
1008
|
-
case
|
|
1008
|
+
case 18:
|
|
1009
1009
|
if (!(status.state != "starting" && tries-- > 0)) {
|
|
1010
|
-
_context6.next =
|
|
1010
|
+
_context6.next = 21;
|
|
1011
1011
|
break;
|
|
1012
1012
|
}
|
|
1013
1013
|
console.log("Wait to start - ", status.state);
|
|
1014
|
-
_context6.next =
|
|
1014
|
+
_context6.next = 19;
|
|
1015
1015
|
return Sleep(1000);
|
|
1016
|
-
case
|
|
1017
|
-
_context6.next =
|
|
1016
|
+
case 19:
|
|
1017
|
+
_context6.next = 20;
|
|
1018
1018
|
return this.StreamStatus({
|
|
1019
1019
|
name: name
|
|
1020
1020
|
});
|
|
1021
|
-
case
|
|
1021
|
+
case 20:
|
|
1022
1022
|
status = _context6.sent;
|
|
1023
|
-
_context6.next =
|
|
1023
|
+
_context6.next = 18;
|
|
1024
1024
|
break;
|
|
1025
|
-
case
|
|
1025
|
+
case 21:
|
|
1026
1026
|
console.log("Status after restart - ", status.state);
|
|
1027
1027
|
return _context6.abrupt("return", status);
|
|
1028
|
-
case
|
|
1029
|
-
_context6.prev =
|
|
1030
|
-
|
|
1031
|
-
console.error(
|
|
1032
|
-
case
|
|
1028
|
+
case 22:
|
|
1029
|
+
_context6.prev = 22;
|
|
1030
|
+
_t13 = _context6["catch"](1);
|
|
1031
|
+
console.error(_t13);
|
|
1032
|
+
case 23:
|
|
1033
1033
|
case "end":
|
|
1034
1034
|
return _context6.stop();
|
|
1035
1035
|
}
|
|
1036
|
-
}, _callee6, this, [[1,
|
|
1036
|
+
}, _callee6, this, [[1, 22], [4, 6], [14, 16]]);
|
|
1037
1037
|
}));
|
|
1038
1038
|
return function (_x6) {
|
|
1039
|
-
return
|
|
1039
|
+
return _ref10.apply(this, arguments);
|
|
1040
1040
|
};
|
|
1041
1041
|
}();
|
|
1042
1042
|
|
|
@@ -1050,27 +1050,27 @@ exports.StreamStartOrStopOrReset = /*#__PURE__*/function () {
|
|
|
1050
1050
|
* @return {Promise<Object>} - The finalize response for the stream object
|
|
1051
1051
|
*/
|
|
1052
1052
|
exports.StreamStopSession = /*#__PURE__*/function () {
|
|
1053
|
-
var
|
|
1054
|
-
var name, objectId, libraryId, mainMeta, fabURI, metaEdgeWriteToken, streamMetadata, status, _yield$this$EditConte, writeToken, newState, stopTime, finalizeMetadata, fin;
|
|
1055
|
-
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) {
|
|
1056
1056
|
while (1) switch (_context7.prev = _context7.next) {
|
|
1057
1057
|
case 0:
|
|
1058
|
-
name =
|
|
1058
|
+
name = _ref11.name;
|
|
1059
1059
|
_context7.prev = 1;
|
|
1060
1060
|
this.Log("Terminating stream session for: ".concat(name));
|
|
1061
1061
|
objectId = name;
|
|
1062
|
-
_context7.next =
|
|
1062
|
+
_context7.next = 2;
|
|
1063
1063
|
return this.ContentObjectLibraryId({
|
|
1064
1064
|
objectId: objectId
|
|
1065
1065
|
});
|
|
1066
|
-
case
|
|
1066
|
+
case 2:
|
|
1067
1067
|
libraryId = _context7.sent;
|
|
1068
|
-
_context7.next =
|
|
1068
|
+
_context7.next = 3;
|
|
1069
1069
|
return this.ContentObjectMetadata({
|
|
1070
1070
|
libraryId: libraryId,
|
|
1071
1071
|
objectId: objectId
|
|
1072
1072
|
});
|
|
1073
|
-
case
|
|
1073
|
+
case 3:
|
|
1074
1074
|
mainMeta = _context7.sent;
|
|
1075
1075
|
fabURI = mainMeta.live_recording.fabric_config.ingress_node_api; // Support both hostname and URL ingress_node_api
|
|
1076
1076
|
if (!fabURI.startsWith("http")) {
|
|
@@ -1082,56 +1082,56 @@ exports.StreamStopSession = /*#__PURE__*/function () {
|
|
|
1082
1082
|
});
|
|
1083
1083
|
metaEdgeWriteToken = mainMeta.live_recording.fabric_config.edge_write_token;
|
|
1084
1084
|
if (metaEdgeWriteToken) {
|
|
1085
|
-
_context7.next =
|
|
1085
|
+
_context7.next = 4;
|
|
1086
1086
|
break;
|
|
1087
1087
|
}
|
|
1088
1088
|
return _context7.abrupt("return", {
|
|
1089
1089
|
state: "inactive",
|
|
1090
1090
|
error: "The stream is not active"
|
|
1091
1091
|
});
|
|
1092
|
-
case
|
|
1093
|
-
_context7.prev =
|
|
1094
|
-
_context7.next =
|
|
1092
|
+
case 4:
|
|
1093
|
+
_context7.prev = 4;
|
|
1094
|
+
_context7.next = 5;
|
|
1095
1095
|
return this.ContentObjectMetadata({
|
|
1096
1096
|
libraryId: libraryId,
|
|
1097
1097
|
objectId: objectId,
|
|
1098
1098
|
writeToken: metaEdgeWriteToken
|
|
1099
1099
|
});
|
|
1100
|
-
case
|
|
1100
|
+
case 5:
|
|
1101
1101
|
streamMetadata = _context7.sent;
|
|
1102
|
-
_context7.next =
|
|
1102
|
+
_context7.next = 6;
|
|
1103
1103
|
return this.StreamStatus({
|
|
1104
1104
|
name: name
|
|
1105
1105
|
});
|
|
1106
|
-
case
|
|
1106
|
+
case 6:
|
|
1107
1107
|
status = _context7.sent;
|
|
1108
1108
|
if (!(status.state !== "stopped")) {
|
|
1109
|
-
_context7.next =
|
|
1109
|
+
_context7.next = 7;
|
|
1110
1110
|
break;
|
|
1111
1111
|
}
|
|
1112
1112
|
return _context7.abrupt("return", {
|
|
1113
1113
|
state: status.state,
|
|
1114
1114
|
error: "The stream must be stopped before terminating"
|
|
1115
1115
|
});
|
|
1116
|
-
case
|
|
1117
|
-
_context7.next =
|
|
1116
|
+
case 7:
|
|
1117
|
+
_context7.next = 8;
|
|
1118
1118
|
return this.DeleteWriteToken({
|
|
1119
1119
|
writeToken: metaEdgeWriteToken
|
|
1120
1120
|
});
|
|
1121
|
-
case
|
|
1122
|
-
_context7.next =
|
|
1121
|
+
case 8:
|
|
1122
|
+
_context7.next = 10;
|
|
1123
1123
|
break;
|
|
1124
|
-
case
|
|
1125
|
-
_context7.prev =
|
|
1126
|
-
|
|
1124
|
+
case 9:
|
|
1125
|
+
_context7.prev = 9;
|
|
1126
|
+
_t14 = _context7["catch"](4);
|
|
1127
1127
|
this.Log("Unable to retrieve metadata for edge write token");
|
|
1128
|
-
case
|
|
1129
|
-
_context7.next =
|
|
1128
|
+
case 10:
|
|
1129
|
+
_context7.next = 11;
|
|
1130
1130
|
return this.EditContentObject({
|
|
1131
1131
|
libraryId: libraryId,
|
|
1132
1132
|
objectId: objectId
|
|
1133
1133
|
});
|
|
1134
|
-
case
|
|
1134
|
+
case 11:
|
|
1135
1135
|
_yield$this$EditConte = _context7.sent;
|
|
1136
1136
|
writeToken = _yield$this$EditConte.writeToken;
|
|
1137
1137
|
// Set stop time and inactive state
|
|
@@ -1149,40 +1149,40 @@ exports.StreamStopSession = /*#__PURE__*/function () {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
1151
|
};
|
|
1152
|
-
_context7.next =
|
|
1152
|
+
_context7.next = 12;
|
|
1153
1153
|
return this.MergeMetadata({
|
|
1154
1154
|
libraryId: libraryId,
|
|
1155
1155
|
objectId: objectId,
|
|
1156
1156
|
writeToken: writeToken,
|
|
1157
1157
|
metadata: finalizeMetadata
|
|
1158
1158
|
});
|
|
1159
|
-
case
|
|
1160
|
-
_context7.next =
|
|
1159
|
+
case 12:
|
|
1160
|
+
_context7.next = 13;
|
|
1161
1161
|
return this.FinalizeContentObject({
|
|
1162
1162
|
libraryId: libraryId,
|
|
1163
1163
|
objectId: objectId,
|
|
1164
1164
|
writeToken: writeToken,
|
|
1165
1165
|
commitMessage: "Deactivate live stream - stop time ".concat(stopTime)
|
|
1166
1166
|
});
|
|
1167
|
-
case
|
|
1167
|
+
case 13:
|
|
1168
1168
|
fin = _context7.sent;
|
|
1169
1169
|
return _context7.abrupt("return", {
|
|
1170
1170
|
fin: fin,
|
|
1171
1171
|
name: name,
|
|
1172
1172
|
state: newState
|
|
1173
1173
|
});
|
|
1174
|
-
case
|
|
1175
|
-
_context7.prev =
|
|
1176
|
-
|
|
1177
|
-
console.error(
|
|
1178
|
-
case
|
|
1174
|
+
case 14:
|
|
1175
|
+
_context7.prev = 14;
|
|
1176
|
+
_t15 = _context7["catch"](1);
|
|
1177
|
+
console.error(_t15);
|
|
1178
|
+
case 15:
|
|
1179
1179
|
case "end":
|
|
1180
1180
|
return _context7.stop();
|
|
1181
1181
|
}
|
|
1182
|
-
}, _callee7, this, [[1,
|
|
1182
|
+
}, _callee7, this, [[1, 14], [4, 9]]);
|
|
1183
1183
|
}));
|
|
1184
1184
|
return function (_x7) {
|
|
1185
|
-
return
|
|
1185
|
+
return _ref12.apply(this, arguments);
|
|
1186
1186
|
};
|
|
1187
1187
|
}();
|
|
1188
1188
|
|
|
@@ -1200,24 +1200,24 @@ exports.StreamStopSession = /*#__PURE__*/function () {
|
|
|
1200
1200
|
* @return {Promise<Object>} - The name, object ID, and state of the stream
|
|
1201
1201
|
*/
|
|
1202
1202
|
exports.StreamInitialize = /*#__PURE__*/function () {
|
|
1203
|
-
var
|
|
1204
|
-
var name,
|
|
1205
|
-
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) {
|
|
1206
1206
|
while (1) switch (_context8.prev = _context8.next) {
|
|
1207
1207
|
case 0:
|
|
1208
|
-
name =
|
|
1209
|
-
_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;
|
|
1210
1210
|
return this.userProfileClient.TenantContractId();
|
|
1211
|
-
case
|
|
1211
|
+
case 1:
|
|
1212
1212
|
tenantContractId = _context8.sent;
|
|
1213
|
-
_context8.next =
|
|
1213
|
+
_context8.next = 2;
|
|
1214
1214
|
return this.ContentObjectMetadata({
|
|
1215
1215
|
libraryId: tenantContractId.replace("iten", "ilib"),
|
|
1216
1216
|
objectId: tenantContractId.replace("iten", "iq__"),
|
|
1217
1217
|
metadataSubtree: "public/content_types",
|
|
1218
1218
|
select: ["live_stream", "title"]
|
|
1219
1219
|
});
|
|
1220
|
-
case
|
|
1220
|
+
case 2:
|
|
1221
1221
|
_yield$this$ContentOb = _context8.sent;
|
|
1222
1222
|
live_stream = _yield$this$ContentOb.live_stream;
|
|
1223
1223
|
title = _yield$this$ContentOb.title;
|
|
@@ -1228,13 +1228,13 @@ exports.StreamInitialize = /*#__PURE__*/function () {
|
|
|
1228
1228
|
typeAbrMaster = title;
|
|
1229
1229
|
}
|
|
1230
1230
|
if (!(typeAbrMaster === undefined || typeLiveStream === undefined)) {
|
|
1231
|
-
_context8.next =
|
|
1231
|
+
_context8.next = 3;
|
|
1232
1232
|
break;
|
|
1233
1233
|
}
|
|
1234
1234
|
console.log("ERROR - unable to find content types", "ABR Master", typeAbrMaster, "Live Stream", typeLiveStream);
|
|
1235
1235
|
return _context8.abrupt("return", {});
|
|
1236
|
-
case
|
|
1237
|
-
_context8.next =
|
|
1236
|
+
case 3:
|
|
1237
|
+
_context8.next = 4;
|
|
1238
1238
|
return this.StreamSetOfferingAndDRM({
|
|
1239
1239
|
name: name,
|
|
1240
1240
|
typeAbrMaster: typeAbrMaster,
|
|
@@ -1242,17 +1242,17 @@ exports.StreamInitialize = /*#__PURE__*/function () {
|
|
|
1242
1242
|
drm: drm,
|
|
1243
1243
|
format: format
|
|
1244
1244
|
});
|
|
1245
|
-
case
|
|
1245
|
+
case 4:
|
|
1246
1246
|
res = _context8.sent;
|
|
1247
1247
|
return _context8.abrupt("return", res);
|
|
1248
|
-
case
|
|
1248
|
+
case 5:
|
|
1249
1249
|
case "end":
|
|
1250
1250
|
return _context8.stop();
|
|
1251
1251
|
}
|
|
1252
1252
|
}, _callee8, this);
|
|
1253
1253
|
}));
|
|
1254
1254
|
return function (_x8) {
|
|
1255
|
-
return
|
|
1255
|
+
return _ref14.apply(this, arguments);
|
|
1256
1256
|
};
|
|
1257
1257
|
}();
|
|
1258
1258
|
|
|
@@ -1272,27 +1272,27 @@ exports.StreamInitialize = /*#__PURE__*/function () {
|
|
|
1272
1272
|
* @return {Promise<Object>} - The name, object ID, and state of the stream
|
|
1273
1273
|
*/
|
|
1274
1274
|
exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
1275
|
-
var
|
|
1276
|
-
var name, typeAbrMaster, typeLiveStream,
|
|
1277
|
-
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) {
|
|
1278
1278
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1279
1279
|
case 0:
|
|
1280
|
-
name =
|
|
1281
|
-
_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;
|
|
1282
1282
|
return this.StreamStatus({
|
|
1283
1283
|
name: name
|
|
1284
1284
|
});
|
|
1285
|
-
case
|
|
1285
|
+
case 1:
|
|
1286
1286
|
status = _context9.sent;
|
|
1287
1287
|
if (!(status.state != "uninitialized" && status.state != "inactive" && status.state != "stopped")) {
|
|
1288
|
-
_context9.next =
|
|
1288
|
+
_context9.next = 2;
|
|
1289
1289
|
break;
|
|
1290
1290
|
}
|
|
1291
1291
|
return _context9.abrupt("return", {
|
|
1292
1292
|
state: status.state,
|
|
1293
1293
|
error: "stream still active - must terminate first"
|
|
1294
1294
|
});
|
|
1295
|
-
case
|
|
1295
|
+
case 2:
|
|
1296
1296
|
objectId = status.object_id;
|
|
1297
1297
|
console.log("INIT: ", name, objectId);
|
|
1298
1298
|
aBitRate = 128000;
|
|
@@ -1311,20 +1311,20 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1311
1311
|
abrProfileDefault = require("../abr_profiles/abr_profile_live_drm.js");
|
|
1312
1312
|
abrProfile = JSON.parse(JSON.stringify(abrProfileDefault));
|
|
1313
1313
|
if (!format) {
|
|
1314
|
-
_context9.next =
|
|
1314
|
+
_context9.next = 8;
|
|
1315
1315
|
break;
|
|
1316
1316
|
}
|
|
1317
1317
|
drm = true; // Override DRM parameter
|
|
1318
1318
|
playoutFormats = {};
|
|
1319
1319
|
formats = format.split(",");
|
|
1320
1320
|
i = 0;
|
|
1321
|
-
case
|
|
1321
|
+
case 3:
|
|
1322
1322
|
if (!(i < formats.length)) {
|
|
1323
|
-
_context9.next =
|
|
1323
|
+
_context9.next = 7;
|
|
1324
1324
|
break;
|
|
1325
1325
|
}
|
|
1326
1326
|
if (!(formats[i] === "hls-clear")) {
|
|
1327
|
-
_context9.next =
|
|
1327
|
+
_context9.next = 4;
|
|
1328
1328
|
break;
|
|
1329
1329
|
}
|
|
1330
1330
|
abrProfile.drm_optional = true;
|
|
@@ -1334,10 +1334,10 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1334
1334
|
"type": "ProtoHls"
|
|
1335
1335
|
}
|
|
1336
1336
|
};
|
|
1337
|
-
return _context9.abrupt("continue",
|
|
1338
|
-
case
|
|
1337
|
+
return _context9.abrupt("continue", 6);
|
|
1338
|
+
case 4:
|
|
1339
1339
|
if (!(formats[i] === "dash-clear")) {
|
|
1340
|
-
_context9.next =
|
|
1340
|
+
_context9.next = 5;
|
|
1341
1341
|
break;
|
|
1342
1342
|
}
|
|
1343
1343
|
abrProfile.drm_optional = true;
|
|
@@ -1348,17 +1348,17 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1348
1348
|
"type": "ProtoDash"
|
|
1349
1349
|
}
|
|
1350
1350
|
};
|
|
1351
|
-
return _context9.abrupt("continue",
|
|
1352
|
-
case
|
|
1351
|
+
return _context9.abrupt("continue", 6);
|
|
1352
|
+
case 5:
|
|
1353
1353
|
playoutFormats[formats[i]] = abrProfile.playout_formats[formats[i]];
|
|
1354
|
-
case
|
|
1354
|
+
case 6:
|
|
1355
1355
|
i++;
|
|
1356
|
-
_context9.next =
|
|
1356
|
+
_context9.next = 3;
|
|
1357
1357
|
break;
|
|
1358
|
-
case
|
|
1359
|
-
_context9.next =
|
|
1358
|
+
case 7:
|
|
1359
|
+
_context9.next = 9;
|
|
1360
1360
|
break;
|
|
1361
|
-
case
|
|
1361
|
+
case 8:
|
|
1362
1362
|
if (!drm) {
|
|
1363
1363
|
abrProfile.drm_optional = true;
|
|
1364
1364
|
playoutFormats = {
|
|
@@ -1379,21 +1379,21 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1379
1379
|
} else {
|
|
1380
1380
|
playoutFormats = Object.assign({}, abrProfile.playout_formats);
|
|
1381
1381
|
}
|
|
1382
|
-
case
|
|
1382
|
+
case 9:
|
|
1383
1383
|
abrProfile.playout_formats = playoutFormats;
|
|
1384
|
-
_context9.next =
|
|
1384
|
+
_context9.next = 10;
|
|
1385
1385
|
return this.ContentObjectLibraryId({
|
|
1386
1386
|
objectId: objectId
|
|
1387
1387
|
});
|
|
1388
|
-
case
|
|
1388
|
+
case 10:
|
|
1389
1389
|
libraryId = _context9.sent;
|
|
1390
|
-
_context9.prev =
|
|
1391
|
-
_context9.next =
|
|
1390
|
+
_context9.prev = 11;
|
|
1391
|
+
_context9.next = 12;
|
|
1392
1392
|
return this.ContentObjectMetadata({
|
|
1393
1393
|
libraryId: libraryId,
|
|
1394
1394
|
objectId: objectId
|
|
1395
1395
|
});
|
|
1396
|
-
case
|
|
1396
|
+
case 12:
|
|
1397
1397
|
mainMeta = _context9.sent;
|
|
1398
1398
|
fabURI = mainMeta.live_recording.fabric_config.ingress_node_api; // Support both hostname and URL ingress_node_api
|
|
1399
1399
|
if (!fabURI.startsWith("http")) {
|
|
@@ -1404,7 +1404,7 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1404
1404
|
fabricURIs: [fabURI]
|
|
1405
1405
|
});
|
|
1406
1406
|
streamUrl = mainMeta.live_recording.recording_config.recording_params.origin_url;
|
|
1407
|
-
_context9.next =
|
|
1407
|
+
_context9.next = 13;
|
|
1408
1408
|
return StreamGenerateOffering({
|
|
1409
1409
|
client: this,
|
|
1410
1410
|
libraryId: libraryId,
|
|
@@ -1427,25 +1427,25 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1427
1427
|
vFrameRate: vFrameRate,
|
|
1428
1428
|
vTimeBase: vTimeBase
|
|
1429
1429
|
});
|
|
1430
|
-
case
|
|
1430
|
+
case 13:
|
|
1431
1431
|
console.log("Finished generating offering");
|
|
1432
1432
|
return _context9.abrupt("return", {
|
|
1433
1433
|
name: name,
|
|
1434
1434
|
object_id: objectId,
|
|
1435
1435
|
state: "initialized"
|
|
1436
1436
|
});
|
|
1437
|
-
case
|
|
1438
|
-
_context9.prev =
|
|
1439
|
-
|
|
1440
|
-
console.error(
|
|
1441
|
-
case
|
|
1437
|
+
case 14:
|
|
1438
|
+
_context9.prev = 14;
|
|
1439
|
+
_t16 = _context9["catch"](11);
|
|
1440
|
+
console.error(_t16);
|
|
1441
|
+
case 15:
|
|
1442
1442
|
case "end":
|
|
1443
1443
|
return _context9.stop();
|
|
1444
1444
|
}
|
|
1445
|
-
}, _callee9, this, [[
|
|
1445
|
+
}, _callee9, this, [[11, 14]]);
|
|
1446
1446
|
}));
|
|
1447
1447
|
return function (_x9) {
|
|
1448
|
-
return
|
|
1448
|
+
return _ref16.apply(this, arguments);
|
|
1449
1449
|
};
|
|
1450
1450
|
}();
|
|
1451
1451
|
|
|
@@ -1465,19 +1465,19 @@ exports.StreamSetOfferingAndDRM = /*#__PURE__*/function () {
|
|
|
1465
1465
|
* @return {Promise<Object>} - Insertions, as well as any errors from bad insertions
|
|
1466
1466
|
*/
|
|
1467
1467
|
exports.StreamInsertion = /*#__PURE__*/function () {
|
|
1468
|
-
var
|
|
1469
|
-
var name, insertionTime,
|
|
1470
|
-
return _regeneratorRuntime.wrap(function
|
|
1471
|
-
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) {
|
|
1472
1472
|
case 0:
|
|
1473
|
-
name =
|
|
1474
|
-
|
|
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;
|
|
1475
1475
|
return this.ContentObjectMetadata({
|
|
1476
1476
|
versionHash: targetHash,
|
|
1477
1477
|
metadataSubtree: "/offerings/default"
|
|
1478
1478
|
});
|
|
1479
|
-
case
|
|
1480
|
-
offeringMeta =
|
|
1479
|
+
case 1:
|
|
1480
|
+
offeringMeta = _context0.sent;
|
|
1481
1481
|
insertionInfo = {
|
|
1482
1482
|
duration_sec: 0 // Minimum of video and audio duration
|
|
1483
1483
|
};
|
|
@@ -1495,39 +1495,39 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1495
1495
|
audioAbrDuration = insertionInfo.audio.seg_duration_sec;
|
|
1496
1496
|
videoAbrDuration = insertionInfo.video.seg_duration_sec;
|
|
1497
1497
|
if (!(audioAbrDuration === 0 || videoAbrDuration === 0)) {
|
|
1498
|
-
|
|
1498
|
+
_context0.next = 2;
|
|
1499
1499
|
break;
|
|
1500
1500
|
}
|
|
1501
1501
|
throw new Error("Bad segment duration hash:", targetHash);
|
|
1502
|
-
case
|
|
1502
|
+
case 2:
|
|
1503
1503
|
if (!(duration === undefined)) {
|
|
1504
|
-
|
|
1504
|
+
_context0.next = 3;
|
|
1505
1505
|
break;
|
|
1506
1506
|
}
|
|
1507
1507
|
duration = insertionInfo.duration_sec; // Use full duration of the insertion
|
|
1508
|
-
|
|
1508
|
+
_context0.next = 4;
|
|
1509
1509
|
break;
|
|
1510
|
-
case
|
|
1510
|
+
case 3:
|
|
1511
1511
|
if (!(duration > insertionInfo.duration_sec)) {
|
|
1512
|
-
|
|
1512
|
+
_context0.next = 4;
|
|
1513
1513
|
break;
|
|
1514
1514
|
}
|
|
1515
1515
|
throw new Error("Bad duration - larger than insertion object duration", insertionInfo.duration_sec);
|
|
1516
|
-
case
|
|
1516
|
+
case 4:
|
|
1517
1517
|
objectId = name;
|
|
1518
|
-
|
|
1518
|
+
_context0.next = 5;
|
|
1519
1519
|
return this.ContentObjectLibraryId({
|
|
1520
1520
|
objectId: objectId
|
|
1521
1521
|
});
|
|
1522
|
-
case
|
|
1523
|
-
libraryId =
|
|
1524
|
-
|
|
1522
|
+
case 5:
|
|
1523
|
+
libraryId = _context0.sent;
|
|
1524
|
+
_context0.next = 6;
|
|
1525
1525
|
return this.ContentObjectMetadata({
|
|
1526
1526
|
libraryId: libraryId,
|
|
1527
1527
|
objectId: objectId
|
|
1528
1528
|
});
|
|
1529
|
-
case
|
|
1530
|
-
mainMeta =
|
|
1529
|
+
case 6:
|
|
1530
|
+
mainMeta = _context0.sent;
|
|
1531
1531
|
fabURI = mainMeta.live_recording.fabric_config.ingress_node_api; // Support both hostname and URL ingress_node_api
|
|
1532
1532
|
if (!fabURI.startsWith("http")) {
|
|
1533
1533
|
// Assume https
|
|
@@ -1537,14 +1537,14 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1537
1537
|
fabricURIs: [fabURI]
|
|
1538
1538
|
});
|
|
1539
1539
|
edgeWriteToken = mainMeta.live_recording.fabric_config.edge_write_token;
|
|
1540
|
-
|
|
1540
|
+
_context0.next = 7;
|
|
1541
1541
|
return this.ContentObjectMetadata({
|
|
1542
1542
|
libraryId: libraryId,
|
|
1543
1543
|
objectId: objectId,
|
|
1544
1544
|
writeToken: edgeWriteToken
|
|
1545
1545
|
});
|
|
1546
|
-
case
|
|
1547
|
-
edgeMeta =
|
|
1546
|
+
case 7:
|
|
1547
|
+
edgeMeta = _context0.sent;
|
|
1548
1548
|
// Find stream start time (from the most recent recording section)
|
|
1549
1549
|
recordings = edgeMeta.live_recording.recordings;
|
|
1550
1550
|
sequence = 1;
|
|
@@ -1562,15 +1562,15 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
}
|
|
1564
1564
|
if (!(streamStartTime === 0)) {
|
|
1565
|
-
|
|
1565
|
+
_context0.next = 8;
|
|
1566
1566
|
break;
|
|
1567
1567
|
}
|
|
1568
1568
|
if (!(sinceStart === false)) {
|
|
1569
|
-
|
|
1569
|
+
_context0.next = 8;
|
|
1570
1570
|
break;
|
|
1571
1571
|
}
|
|
1572
1572
|
throw new Error("Stream not running - must use 'time since start'");
|
|
1573
|
-
case
|
|
1573
|
+
case 8:
|
|
1574
1574
|
// Find the current period playout configuration
|
|
1575
1575
|
if (edgeMeta.live_recording.playout_config.interleaves === undefined) {
|
|
1576
1576
|
edgeMeta.live_recording.playout_config.interleaves = {};
|
|
@@ -1597,9 +1597,9 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1597
1597
|
playout: "/qfab/" + targetHash + "/rep/playout" // TO FIX - should be a link
|
|
1598
1598
|
};
|
|
1599
1599
|
i = 0;
|
|
1600
|
-
case
|
|
1600
|
+
case 9:
|
|
1601
1601
|
if (!(i < insertions.length)) {
|
|
1602
|
-
|
|
1602
|
+
_context0.next = 13;
|
|
1603
1603
|
break;
|
|
1604
1604
|
}
|
|
1605
1605
|
if (insertions[i].insertion_time <= currentTime) {
|
|
@@ -1607,21 +1607,21 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1607
1607
|
append(errs, "Bad insertion - time:", insertions[i].insertion_time);
|
|
1608
1608
|
}
|
|
1609
1609
|
if (!remove) {
|
|
1610
|
-
|
|
1610
|
+
_context0.next = 11;
|
|
1611
1611
|
break;
|
|
1612
1612
|
}
|
|
1613
1613
|
if (!(insertions[i].insertion_time === insertionTime)) {
|
|
1614
|
-
|
|
1614
|
+
_context0.next = 10;
|
|
1615
1615
|
break;
|
|
1616
1616
|
}
|
|
1617
1617
|
insertions.splice(i, 1);
|
|
1618
|
-
return
|
|
1619
|
-
case
|
|
1620
|
-
|
|
1618
|
+
return _context0.abrupt("continue", 13);
|
|
1619
|
+
case 10:
|
|
1620
|
+
_context0.next = 12;
|
|
1621
1621
|
break;
|
|
1622
|
-
case
|
|
1622
|
+
case 11:
|
|
1623
1623
|
if (!(insertions[i].insertion_time > insertionTime)) {
|
|
1624
|
-
|
|
1624
|
+
_context0.next = 12;
|
|
1625
1625
|
break;
|
|
1626
1626
|
}
|
|
1627
1627
|
if (i > 0) {
|
|
@@ -1630,12 +1630,12 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1630
1630
|
insertions = [newInsertion].concat(_toConsumableArray(insertions.splice(i)));
|
|
1631
1631
|
}
|
|
1632
1632
|
insertionDone = true;
|
|
1633
|
-
return
|
|
1634
|
-
case
|
|
1633
|
+
return _context0.abrupt("continue", 13);
|
|
1634
|
+
case 12:
|
|
1635
1635
|
i++;
|
|
1636
|
-
|
|
1636
|
+
_context0.next = 9;
|
|
1637
1637
|
break;
|
|
1638
|
-
case
|
|
1638
|
+
case 13:
|
|
1639
1639
|
if (!remove && !insertionDone) {
|
|
1640
1640
|
// Add to the end of the insertions list
|
|
1641
1641
|
console.log("Add insertion at the end");
|
|
@@ -1644,7 +1644,7 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1644
1644
|
playoutConfig.interleaves[sequence] = insertions;
|
|
1645
1645
|
|
|
1646
1646
|
// Store the new insertions in the write token
|
|
1647
|
-
|
|
1647
|
+
_context0.next = 14;
|
|
1648
1648
|
return this.ReplaceMetadata({
|
|
1649
1649
|
libraryId: libraryId,
|
|
1650
1650
|
objectId: objectId,
|
|
@@ -1652,18 +1652,18 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1652
1652
|
metadataSubtree: "/live_recording/playout_config",
|
|
1653
1653
|
metadata: edgeMeta.live_recording.playout_config
|
|
1654
1654
|
});
|
|
1655
|
-
case
|
|
1655
|
+
case 14:
|
|
1656
1656
|
res.errors = errs;
|
|
1657
1657
|
res.insertions = insertions;
|
|
1658
|
-
return
|
|
1659
|
-
case
|
|
1658
|
+
return _context0.abrupt("return", res);
|
|
1659
|
+
case 15:
|
|
1660
1660
|
case "end":
|
|
1661
|
-
return
|
|
1661
|
+
return _context0.stop();
|
|
1662
1662
|
}
|
|
1663
|
-
},
|
|
1663
|
+
}, _callee0, this);
|
|
1664
1664
|
}));
|
|
1665
|
-
return function (
|
|
1666
|
-
return
|
|
1665
|
+
return function (_x0) {
|
|
1666
|
+
return _ref18.apply(this, arguments);
|
|
1667
1667
|
};
|
|
1668
1668
|
}();
|
|
1669
1669
|
|
|
@@ -1701,32 +1701,32 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1701
1701
|
*
|
|
1702
1702
|
*/
|
|
1703
1703
|
exports.StreamConfig = /*#__PURE__*/function () {
|
|
1704
|
-
var
|
|
1705
|
-
var name,
|
|
1706
|
-
return _regeneratorRuntime.wrap(function
|
|
1707
|
-
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) {
|
|
1708
1708
|
case 0:
|
|
1709
|
-
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;
|
|
1710
1710
|
objectId = name;
|
|
1711
1711
|
status = {
|
|
1712
1712
|
name: name
|
|
1713
1713
|
};
|
|
1714
|
-
|
|
1714
|
+
_context1.next = 1;
|
|
1715
1715
|
return this.ContentObjectLibraryId({
|
|
1716
1716
|
objectId: objectId
|
|
1717
1717
|
});
|
|
1718
|
-
case
|
|
1719
|
-
libraryId =
|
|
1718
|
+
case 1:
|
|
1719
|
+
libraryId = _context1.sent;
|
|
1720
1720
|
status.library_id = libraryId;
|
|
1721
1721
|
status.object_id = objectId;
|
|
1722
1722
|
probe = probeMetadata;
|
|
1723
|
-
|
|
1723
|
+
_context1.next = 2;
|
|
1724
1724
|
return this.ContentObjectMetadata({
|
|
1725
1725
|
libraryId: libraryId,
|
|
1726
1726
|
objectId: objectId
|
|
1727
1727
|
});
|
|
1728
|
-
case
|
|
1729
|
-
mainMeta =
|
|
1728
|
+
case 2:
|
|
1729
|
+
mainMeta = _context1.sent;
|
|
1730
1730
|
userConfig = mainMeta.live_recording_config;
|
|
1731
1731
|
status.user_config = userConfig;
|
|
1732
1732
|
|
|
@@ -1735,19 +1735,19 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1735
1735
|
hostName = new URL(parsedName).hostname;
|
|
1736
1736
|
streamUrl = new URL(userConfig.url);
|
|
1737
1737
|
this.Log("Retrieving nodes - matching: ".concat(hostName));
|
|
1738
|
-
|
|
1738
|
+
_context1.next = 3;
|
|
1739
1739
|
return this.SpaceNodes({
|
|
1740
1740
|
matchEndpoint: hostName
|
|
1741
1741
|
});
|
|
1742
|
-
case
|
|
1743
|
-
nodes =
|
|
1742
|
+
case 3:
|
|
1743
|
+
nodes = _context1.sent;
|
|
1744
1744
|
if (!(nodes.length < 1)) {
|
|
1745
|
-
|
|
1745
|
+
_context1.next = 4;
|
|
1746
1746
|
break;
|
|
1747
1747
|
}
|
|
1748
1748
|
status.error = "No node matching stream URL " + streamUrl.href;
|
|
1749
|
-
return
|
|
1750
|
-
case
|
|
1749
|
+
return _context1.abrupt("return", status);
|
|
1750
|
+
case 4:
|
|
1751
1751
|
node = {
|
|
1752
1752
|
endpoints: nodes[0].services.fabric_api.urls,
|
|
1753
1753
|
id: nodes[0].id
|
|
@@ -1755,7 +1755,7 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1755
1755
|
status.node = node;
|
|
1756
1756
|
endpoint = node.endpoints[0];
|
|
1757
1757
|
if (probe) {
|
|
1758
|
-
|
|
1758
|
+
_context1.next = 13;
|
|
1759
1759
|
break;
|
|
1760
1760
|
}
|
|
1761
1761
|
this.SetNodes({
|
|
@@ -1764,17 +1764,17 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1764
1764
|
|
|
1765
1765
|
// Probe the stream
|
|
1766
1766
|
probe = {};
|
|
1767
|
-
|
|
1768
|
-
|
|
1767
|
+
_context1.prev = 5;
|
|
1768
|
+
_context1.next = 6;
|
|
1769
1769
|
return this.Rep({
|
|
1770
1770
|
libraryId: libraryId,
|
|
1771
1771
|
objectId: objectId,
|
|
1772
1772
|
rep: "probe"
|
|
1773
1773
|
});
|
|
1774
|
-
case
|
|
1775
|
-
probeUrl =
|
|
1776
|
-
|
|
1777
|
-
|
|
1774
|
+
case 6:
|
|
1775
|
+
probeUrl = _context1.sent;
|
|
1776
|
+
_t17 = this.utils;
|
|
1777
|
+
_context1.next = 7;
|
|
1778
1778
|
return HttpClient.Fetch(probeUrl, {
|
|
1779
1779
|
body: JSON.stringify({
|
|
1780
1780
|
"filename": streamUrl.href,
|
|
@@ -1782,52 +1782,52 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1782
1782
|
}),
|
|
1783
1783
|
method: "POST"
|
|
1784
1784
|
});
|
|
1785
|
-
case
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
return
|
|
1789
|
-
case
|
|
1790
|
-
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;
|
|
1791
1791
|
if (!probe.errors) {
|
|
1792
|
-
|
|
1792
|
+
_context1.next = 9;
|
|
1793
1793
|
break;
|
|
1794
1794
|
}
|
|
1795
1795
|
throw probe.errors[0];
|
|
1796
|
-
case
|
|
1797
|
-
|
|
1796
|
+
case 9:
|
|
1797
|
+
_context1.next = 12;
|
|
1798
1798
|
break;
|
|
1799
|
-
case
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
if (!(
|
|
1803
|
-
|
|
1799
|
+
case 10:
|
|
1800
|
+
_context1.prev = 10;
|
|
1801
|
+
_t19 = _context1["catch"](5);
|
|
1802
|
+
if (!(_t19.code === "ETIMEDOUT")) {
|
|
1803
|
+
_context1.next = 11;
|
|
1804
1804
|
break;
|
|
1805
1805
|
}
|
|
1806
1806
|
throw "Stream probe time out - make sure the stream source is available";
|
|
1807
|
-
case
|
|
1808
|
-
throw
|
|
1809
|
-
case
|
|
1807
|
+
case 11:
|
|
1808
|
+
throw _t19;
|
|
1809
|
+
case 12:
|
|
1810
1810
|
probe.format.filename = streamUrl.href;
|
|
1811
|
-
case
|
|
1811
|
+
case 13:
|
|
1812
1812
|
// Create live recording config
|
|
1813
1813
|
lc = new LiveConf(probe, node.id, endpoint, false, false, true);
|
|
1814
1814
|
liveRecordingConfig = lc.generateLiveConf({
|
|
1815
1815
|
customSettings: customSettings
|
|
1816
1816
|
}); // Store live recording config into the stream object
|
|
1817
1817
|
if (writeToken) {
|
|
1818
|
-
|
|
1818
|
+
_context1.next = 15;
|
|
1819
1819
|
break;
|
|
1820
1820
|
}
|
|
1821
|
-
|
|
1821
|
+
_context1.next = 14;
|
|
1822
1822
|
return this.EditContentObject({
|
|
1823
1823
|
libraryId: libraryId,
|
|
1824
1824
|
objectId: objectId
|
|
1825
1825
|
});
|
|
1826
|
-
case
|
|
1827
|
-
e =
|
|
1826
|
+
case 14:
|
|
1827
|
+
e = _context1.sent;
|
|
1828
1828
|
writeToken = e.write_token;
|
|
1829
|
-
case
|
|
1830
|
-
|
|
1829
|
+
case 15:
|
|
1830
|
+
_context1.next = 16;
|
|
1831
1831
|
return this.ReplaceMetadata({
|
|
1832
1832
|
libraryId: libraryId,
|
|
1833
1833
|
objectId: objectId,
|
|
@@ -1835,8 +1835,8 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1835
1835
|
metadataSubtree: "live_recording",
|
|
1836
1836
|
metadata: liveRecordingConfig.live_recording
|
|
1837
1837
|
});
|
|
1838
|
-
case
|
|
1839
|
-
|
|
1838
|
+
case 16:
|
|
1839
|
+
_context1.next = 17;
|
|
1840
1840
|
return this.ReplaceMetadata({
|
|
1841
1841
|
libraryId: libraryId,
|
|
1842
1842
|
objectId: objectId,
|
|
@@ -1844,30 +1844,30 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1844
1844
|
metadataSubtree: "live_recording_config/probe_info",
|
|
1845
1845
|
metadata: probe
|
|
1846
1846
|
});
|
|
1847
|
-
case
|
|
1847
|
+
case 17:
|
|
1848
1848
|
if (!finalize) {
|
|
1849
|
-
|
|
1849
|
+
_context1.next = 19;
|
|
1850
1850
|
break;
|
|
1851
1851
|
}
|
|
1852
|
-
|
|
1852
|
+
_context1.next = 18;
|
|
1853
1853
|
return this.FinalizeContentObject({
|
|
1854
1854
|
libraryId: libraryId,
|
|
1855
1855
|
objectId: objectId,
|
|
1856
1856
|
writeToken: writeToken,
|
|
1857
1857
|
commitMessage: "Apply live stream configuration"
|
|
1858
1858
|
});
|
|
1859
|
-
case
|
|
1860
|
-
status.fin =
|
|
1861
|
-
case
|
|
1862
|
-
return
|
|
1863
|
-
case
|
|
1859
|
+
case 18:
|
|
1860
|
+
status.fin = _context1.sent;
|
|
1861
|
+
case 19:
|
|
1862
|
+
return _context1.abrupt("return", status);
|
|
1863
|
+
case 20:
|
|
1864
1864
|
case "end":
|
|
1865
|
-
return
|
|
1865
|
+
return _context1.stop();
|
|
1866
1866
|
}
|
|
1867
|
-
},
|
|
1867
|
+
}, _callee1, this, [[5, 10]]);
|
|
1868
1868
|
}));
|
|
1869
|
-
return function (
|
|
1870
|
-
return
|
|
1869
|
+
return function (_x1) {
|
|
1870
|
+
return _ref20.apply(this, arguments);
|
|
1871
1871
|
};
|
|
1872
1872
|
}();
|
|
1873
1873
|
|
|
@@ -1880,9 +1880,9 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1880
1880
|
*
|
|
1881
1881
|
* @return {Promise<Object>} - The list of stream URLs
|
|
1882
1882
|
*/
|
|
1883
|
-
exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator(
|
|
1883
|
+
exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
1884
1884
|
var _this2 = this;
|
|
1885
|
-
var
|
|
1885
|
+
var _ref22,
|
|
1886
1886
|
siteId,
|
|
1887
1887
|
STATUS_MAP,
|
|
1888
1888
|
tenantContractId,
|
|
@@ -1890,12 +1890,21 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
1890
1890
|
activeUrlMap,
|
|
1891
1891
|
streamUrlStatus,
|
|
1892
1892
|
streamUrls,
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
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) {
|
|
1896
1905
|
case 0:
|
|
1897
|
-
|
|
1898
|
-
|
|
1906
|
+
_ref22 = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {}, siteId = _ref22.siteId;
|
|
1907
|
+
_context11.prev = 1;
|
|
1899
1908
|
STATUS_MAP = {
|
|
1900
1909
|
UNCONFIGURED: "unconfigured",
|
|
1901
1910
|
UNINITIALIZED: "uninitialized",
|
|
@@ -1906,78 +1915,78 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
1906
1915
|
STALLED: "stalled"
|
|
1907
1916
|
};
|
|
1908
1917
|
if (siteId) {
|
|
1909
|
-
|
|
1918
|
+
_context11.next = 5;
|
|
1910
1919
|
break;
|
|
1911
1920
|
}
|
|
1912
|
-
|
|
1921
|
+
_context11.next = 2;
|
|
1913
1922
|
return this.userProfileClient.TenantContractId();
|
|
1914
|
-
case
|
|
1915
|
-
tenantContractId =
|
|
1923
|
+
case 2:
|
|
1924
|
+
tenantContractId = _context11.sent;
|
|
1916
1925
|
if (tenantContractId) {
|
|
1917
|
-
|
|
1926
|
+
_context11.next = 3;
|
|
1918
1927
|
break;
|
|
1919
1928
|
}
|
|
1920
1929
|
throw Error("No tenant contract ID configured");
|
|
1921
|
-
case
|
|
1922
|
-
|
|
1930
|
+
case 3:
|
|
1931
|
+
_context11.next = 4;
|
|
1923
1932
|
return this.ContentObjectMetadata({
|
|
1924
1933
|
libraryId: tenantContractId.replace("iten", "ilib"),
|
|
1925
1934
|
objectId: tenantContractId.replace("iten", "iq__"),
|
|
1926
1935
|
metadataSubtree: "public/sites/live_streams"
|
|
1927
1936
|
});
|
|
1928
|
-
case
|
|
1929
|
-
siteId =
|
|
1930
|
-
case
|
|
1931
|
-
|
|
1932
|
-
|
|
1937
|
+
case 4:
|
|
1938
|
+
siteId = _context11.sent;
|
|
1939
|
+
case 5:
|
|
1940
|
+
_t20 = this;
|
|
1941
|
+
_context11.next = 6;
|
|
1933
1942
|
return this.ContentObjectLibraryId({
|
|
1934
1943
|
objectId: siteId
|
|
1935
1944
|
});
|
|
1936
|
-
case
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
libraryId:
|
|
1941
|
-
objectId:
|
|
1945
|
+
case 6:
|
|
1946
|
+
_t21 = _context11.sent;
|
|
1947
|
+
_t22 = siteId;
|
|
1948
|
+
_t23 = {
|
|
1949
|
+
libraryId: _t21,
|
|
1950
|
+
objectId: _t22,
|
|
1942
1951
|
metadataSubtree: "public/asset_metadata/live_streams",
|
|
1943
1952
|
resolveLinks: true,
|
|
1944
1953
|
resolveIgnoreErrors: true,
|
|
1945
1954
|
resolveIncludeSource: true
|
|
1946
1955
|
};
|
|
1947
|
-
|
|
1948
|
-
return
|
|
1949
|
-
case
|
|
1950
|
-
streamMetadata =
|
|
1956
|
+
_context11.next = 7;
|
|
1957
|
+
return _t20.ContentObjectMetadata.call(_t20, _t23);
|
|
1958
|
+
case 7:
|
|
1959
|
+
streamMetadata = _context11.sent;
|
|
1951
1960
|
activeUrlMap = {};
|
|
1952
|
-
|
|
1961
|
+
_context11.next = 8;
|
|
1953
1962
|
return this.utils.LimitedMap(10, Object.keys(streamMetadata || {}), /*#__PURE__*/function () {
|
|
1954
|
-
var
|
|
1963
|
+
var _ref23 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(slug) {
|
|
1955
1964
|
var stream, versionHash, objectId, libraryId, status, streamMeta, url, isActive;
|
|
1956
|
-
return _regeneratorRuntime.wrap(function
|
|
1957
|
-
while (1) switch (
|
|
1965
|
+
return _regeneratorRuntime.wrap(function (_context10) {
|
|
1966
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1958
1967
|
case 0:
|
|
1959
1968
|
stream = streamMetadata[slug];
|
|
1960
1969
|
if (stream && stream["."] && stream["."].source) {
|
|
1961
1970
|
versionHash = stream["."].source;
|
|
1962
1971
|
}
|
|
1963
1972
|
if (!versionHash) {
|
|
1964
|
-
|
|
1973
|
+
_context10.next = 4;
|
|
1965
1974
|
break;
|
|
1966
1975
|
}
|
|
1967
1976
|
objectId = _this2.utils.DecodeVersionHash(versionHash).objectId;
|
|
1968
|
-
|
|
1977
|
+
_context10.next = 1;
|
|
1969
1978
|
return _this2.ContentObjectLibraryId({
|
|
1970
1979
|
objectId: objectId
|
|
1971
1980
|
});
|
|
1972
|
-
case
|
|
1973
|
-
libraryId =
|
|
1974
|
-
|
|
1981
|
+
case 1:
|
|
1982
|
+
libraryId = _context10.sent;
|
|
1983
|
+
_context10.next = 2;
|
|
1975
1984
|
return _this2.StreamStatus({
|
|
1976
1985
|
name: objectId
|
|
1977
1986
|
});
|
|
1978
|
-
case
|
|
1979
|
-
status =
|
|
1980
|
-
|
|
1987
|
+
case 2:
|
|
1988
|
+
status = _context10.sent;
|
|
1989
|
+
_context10.next = 3;
|
|
1981
1990
|
return _this2.ContentObjectMetadata({
|
|
1982
1991
|
objectId: objectId,
|
|
1983
1992
|
libraryId: libraryId,
|
|
@@ -1985,50 +1994,50 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
1985
1994
|
// live_recording_config/url is the old path
|
|
1986
1995
|
"live_recording_config/url"]
|
|
1987
1996
|
});
|
|
1988
|
-
case
|
|
1989
|
-
streamMeta =
|
|
1997
|
+
case 3:
|
|
1998
|
+
streamMeta = _context10.sent;
|
|
1990
1999
|
url = streamMeta.live_recording_config.reference_url || streamMeta.live_recording_config.url;
|
|
1991
2000
|
isActive = [STATUS_MAP.STARTING, STATUS_MAP.RUNNING, STATUS_MAP.STALLED, STATUS_MAP.STOPPED].includes(status.state);
|
|
1992
2001
|
if (url && isActive) {
|
|
1993
2002
|
activeUrlMap[url] = true;
|
|
1994
2003
|
}
|
|
1995
|
-
case
|
|
2004
|
+
case 4:
|
|
1996
2005
|
case "end":
|
|
1997
|
-
return
|
|
2006
|
+
return _context10.stop();
|
|
1998
2007
|
}
|
|
1999
|
-
},
|
|
2008
|
+
}, _callee10);
|
|
2000
2009
|
}));
|
|
2001
|
-
return function (
|
|
2002
|
-
return
|
|
2010
|
+
return function (_x10) {
|
|
2011
|
+
return _ref23.apply(this, arguments);
|
|
2003
2012
|
};
|
|
2004
2013
|
}());
|
|
2005
|
-
case
|
|
2014
|
+
case 8:
|
|
2006
2015
|
streamUrlStatus = {};
|
|
2007
|
-
|
|
2008
|
-
|
|
2016
|
+
_t24 = this;
|
|
2017
|
+
_context11.next = 9;
|
|
2009
2018
|
return this.ContentObjectLibraryId({
|
|
2010
2019
|
objectId: siteId
|
|
2011
2020
|
});
|
|
2012
|
-
case
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
libraryId:
|
|
2017
|
-
objectId:
|
|
2021
|
+
case 9:
|
|
2022
|
+
_t25 = _context11.sent;
|
|
2023
|
+
_t26 = siteId;
|
|
2024
|
+
_t27 = {
|
|
2025
|
+
libraryId: _t25,
|
|
2026
|
+
objectId: _t26,
|
|
2018
2027
|
metadataSubtree: "/live_stream_urls",
|
|
2019
2028
|
resolveLinks: true,
|
|
2020
2029
|
resolveIgnoreErrors: true
|
|
2021
2030
|
};
|
|
2022
|
-
|
|
2023
|
-
return
|
|
2024
|
-
case
|
|
2025
|
-
streamUrls =
|
|
2031
|
+
_context11.next = 10;
|
|
2032
|
+
return _t24.ContentObjectMetadata.call(_t24, _t27);
|
|
2033
|
+
case 10:
|
|
2034
|
+
streamUrls = _context11.sent;
|
|
2026
2035
|
if (streamUrls) {
|
|
2027
|
-
|
|
2036
|
+
_context11.next = 11;
|
|
2028
2037
|
break;
|
|
2029
2038
|
}
|
|
2030
2039
|
throw Error("No pre-allocated URLs configured");
|
|
2031
|
-
case
|
|
2040
|
+
case 11:
|
|
2032
2041
|
Object.keys(streamUrls || {}).forEach(function (protocol) {
|
|
2033
2042
|
streamUrlStatus[protocol] = streamUrls[protocol].map(function (url) {
|
|
2034
2043
|
return {
|
|
@@ -2037,16 +2046,16 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
2037
2046
|
};
|
|
2038
2047
|
});
|
|
2039
2048
|
});
|
|
2040
|
-
return
|
|
2041
|
-
case
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
console.error(
|
|
2045
|
-
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:
|
|
2046
2055
|
case "end":
|
|
2047
|
-
return
|
|
2056
|
+
return _context11.stop();
|
|
2048
2057
|
}
|
|
2049
|
-
},
|
|
2058
|
+
}, _callee11, this, [[1, 12]]);
|
|
2050
2059
|
}));
|
|
2051
2060
|
|
|
2052
2061
|
/**
|
|
@@ -2105,89 +2114,89 @@ exports.StreamListUrls = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerat
|
|
|
2105
2114
|
*/
|
|
2106
2115
|
|
|
2107
2116
|
exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
2108
|
-
var
|
|
2109
|
-
var name, targetObjectId, eventId,
|
|
2110
|
-
return _regeneratorRuntime.wrap(function
|
|
2111
|
-
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) {
|
|
2112
2121
|
case 0:
|
|
2113
|
-
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;
|
|
2114
2123
|
objectId = name;
|
|
2115
2124
|
abrProfile = require("../abr_profiles/abr_profile_live_to_vod.js");
|
|
2116
|
-
|
|
2125
|
+
_context12.next = 1;
|
|
2117
2126
|
return this.StreamStatus({
|
|
2118
2127
|
name: name
|
|
2119
2128
|
});
|
|
2120
|
-
case
|
|
2121
|
-
status =
|
|
2129
|
+
case 1:
|
|
2130
|
+
status = _context12.sent;
|
|
2122
2131
|
libraryId = status.library_id;
|
|
2123
2132
|
this.Log("Copying stream ".concat(name, " to target ").concat(targetObjectId));
|
|
2124
2133
|
ValidateObject(targetObjectId);
|
|
2125
|
-
|
|
2134
|
+
_context12.next = 2;
|
|
2126
2135
|
return this.ContentObjectLibraryId({
|
|
2127
2136
|
objectId: targetObjectId
|
|
2128
2137
|
});
|
|
2129
|
-
case
|
|
2130
|
-
targetLibraryId =
|
|
2131
|
-
|
|
2138
|
+
case 2:
|
|
2139
|
+
targetLibraryId = _context12.sent;
|
|
2140
|
+
_context12.next = 3;
|
|
2132
2141
|
return this.authClient.KMSAddress({
|
|
2133
2142
|
objectId: targetObjectId
|
|
2134
2143
|
});
|
|
2135
|
-
case
|
|
2136
|
-
kmsAddress =
|
|
2144
|
+
case 3:
|
|
2145
|
+
kmsAddress = _context12.sent;
|
|
2137
2146
|
kmsCapId = "eluv.caps.ikms".concat(this.utils.AddressToHash(kmsAddress));
|
|
2138
|
-
|
|
2147
|
+
_context12.next = 4;
|
|
2139
2148
|
return this.ContentObjectMetadata({
|
|
2140
2149
|
libraryId: targetLibraryId,
|
|
2141
2150
|
objectId: targetObjectId,
|
|
2142
2151
|
metadataSubtree: kmsCapId
|
|
2143
2152
|
});
|
|
2144
|
-
case
|
|
2145
|
-
kmsCap =
|
|
2153
|
+
case 4:
|
|
2154
|
+
kmsCap = _context12.sent;
|
|
2146
2155
|
if (kmsCap) {
|
|
2147
|
-
|
|
2156
|
+
_context12.next = 5;
|
|
2148
2157
|
break;
|
|
2149
2158
|
}
|
|
2150
2159
|
throw Error("No content encryption key set for object ".concat(targetObjectId));
|
|
2151
|
-
case
|
|
2152
|
-
|
|
2160
|
+
case 5:
|
|
2161
|
+
_context12.prev = 5;
|
|
2153
2162
|
status.live_object_id = objectId;
|
|
2154
|
-
|
|
2163
|
+
_context12.next = 6;
|
|
2155
2164
|
return this.LatestVersionHash({
|
|
2156
2165
|
objectId: objectId,
|
|
2157
2166
|
libraryId: libraryId
|
|
2158
2167
|
});
|
|
2159
|
-
case
|
|
2160
|
-
liveHash =
|
|
2168
|
+
case 6:
|
|
2169
|
+
liveHash = _context12.sent;
|
|
2161
2170
|
status.live_hash = liveHash;
|
|
2162
2171
|
if (!eventId) {
|
|
2163
|
-
|
|
2172
|
+
_context12.next = 8;
|
|
2164
2173
|
break;
|
|
2165
2174
|
}
|
|
2166
|
-
|
|
2175
|
+
_context12.next = 7;
|
|
2167
2176
|
return this.CueInfo({
|
|
2168
2177
|
eventId: eventId,
|
|
2169
2178
|
status: status
|
|
2170
2179
|
});
|
|
2171
|
-
case
|
|
2172
|
-
event =
|
|
2180
|
+
case 7:
|
|
2181
|
+
event = _context12.sent;
|
|
2173
2182
|
if (event.eventStart && event.eventEnd) {
|
|
2174
2183
|
startTime = event.eventStart;
|
|
2175
2184
|
endTime = event.eventEnd;
|
|
2176
2185
|
}
|
|
2177
|
-
case
|
|
2178
|
-
|
|
2186
|
+
case 8:
|
|
2187
|
+
_context12.next = 9;
|
|
2179
2188
|
return this.EditContentObject({
|
|
2180
2189
|
objectId: targetObjectId,
|
|
2181
2190
|
libraryId: targetLibraryId
|
|
2182
2191
|
});
|
|
2183
|
-
case
|
|
2184
|
-
_yield$this$EditConte2 =
|
|
2192
|
+
case 9:
|
|
2193
|
+
_yield$this$EditConte2 = _context12.sent;
|
|
2185
2194
|
writeToken = _yield$this$EditConte2.writeToken;
|
|
2186
2195
|
status.target_object_id = targetObjectId;
|
|
2187
2196
|
status.target_library_id = targetLibraryId;
|
|
2188
2197
|
status.target_write_token = writeToken;
|
|
2189
2198
|
this.Log("Process live source (takes around 20 sec per hour of content)");
|
|
2190
|
-
|
|
2199
|
+
_context12.next = 10;
|
|
2191
2200
|
return this.CallBitcodeMethod({
|
|
2192
2201
|
libraryId: targetLibraryId,
|
|
2193
2202
|
objectId: targetObjectId,
|
|
@@ -2206,7 +2215,7 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2206
2215
|
constant: false,
|
|
2207
2216
|
format: "text"
|
|
2208
2217
|
});
|
|
2209
|
-
case
|
|
2218
|
+
case 10:
|
|
2210
2219
|
abrMezInitBody = {
|
|
2211
2220
|
abr_profile: abrProfile,
|
|
2212
2221
|
"offering_key": "default",
|
|
@@ -2214,7 +2223,7 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2214
2223
|
"variant_key": "default",
|
|
2215
2224
|
"keep_other_streams": false
|
|
2216
2225
|
};
|
|
2217
|
-
|
|
2226
|
+
_context12.next = 11;
|
|
2218
2227
|
return this.CallBitcodeMethod({
|
|
2219
2228
|
libraryId: targetLibraryId,
|
|
2220
2229
|
objectId: targetObjectId,
|
|
@@ -2224,9 +2233,9 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2224
2233
|
constant: false,
|
|
2225
2234
|
format: "text"
|
|
2226
2235
|
});
|
|
2227
|
-
case
|
|
2228
|
-
|
|
2229
|
-
|
|
2236
|
+
case 11:
|
|
2237
|
+
_context12.prev = 11;
|
|
2238
|
+
_context12.next = 12;
|
|
2230
2239
|
return this.CallBitcodeMethod({
|
|
2231
2240
|
libraryId: targetLibraryId,
|
|
2232
2241
|
objectId: targetObjectId,
|
|
@@ -2236,16 +2245,16 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2236
2245
|
constant: false,
|
|
2237
2246
|
format: "text"
|
|
2238
2247
|
});
|
|
2239
|
-
case
|
|
2240
|
-
|
|
2248
|
+
case 12:
|
|
2249
|
+
_context12.next = 14;
|
|
2241
2250
|
break;
|
|
2242
|
-
case
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
console.error("Unable to call /media/live_to_vod/copy",
|
|
2246
|
-
throw
|
|
2247
|
-
case
|
|
2248
|
-
|
|
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;
|
|
2249
2258
|
return this.CallBitcodeMethod({
|
|
2250
2259
|
libraryId: targetLibraryId,
|
|
2251
2260
|
objectId: targetObjectId,
|
|
@@ -2255,22 +2264,22 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2255
2264
|
constant: false,
|
|
2256
2265
|
format: "text"
|
|
2257
2266
|
});
|
|
2258
|
-
case
|
|
2267
|
+
case 15:
|
|
2259
2268
|
if (!finalize) {
|
|
2260
|
-
|
|
2269
|
+
_context12.next = 17;
|
|
2261
2270
|
break;
|
|
2262
2271
|
}
|
|
2263
|
-
|
|
2272
|
+
_context12.next = 16;
|
|
2264
2273
|
return this.FinalizeContentObject({
|
|
2265
2274
|
libraryId: targetLibraryId,
|
|
2266
2275
|
objectId: targetObjectId,
|
|
2267
2276
|
writeToken: writeToken,
|
|
2268
2277
|
commitMessage: "Live Stream to VoD"
|
|
2269
2278
|
});
|
|
2270
|
-
case
|
|
2271
|
-
finalizeResponse =
|
|
2279
|
+
case 16:
|
|
2280
|
+
finalizeResponse = _context12.sent;
|
|
2272
2281
|
status.target_hash = finalizeResponse.hash;
|
|
2273
|
-
case
|
|
2282
|
+
case 17:
|
|
2274
2283
|
// Clean up unnecessary status items
|
|
2275
2284
|
delete status.playout_urls;
|
|
2276
2285
|
delete status.lro_status_url;
|
|
@@ -2278,20 +2287,20 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2278
2287
|
delete status.recording_period_sequence;
|
|
2279
2288
|
delete status.edge_meta_size;
|
|
2280
2289
|
delete status.insertions;
|
|
2281
|
-
return
|
|
2282
|
-
case
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
this.Log(
|
|
2286
|
-
throw
|
|
2287
|
-
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:
|
|
2288
2297
|
case "end":
|
|
2289
|
-
return
|
|
2298
|
+
return _context12.stop();
|
|
2290
2299
|
}
|
|
2291
|
-
},
|
|
2300
|
+
}, _callee12, this, [[5, 18], [11, 13]]);
|
|
2292
2301
|
}));
|
|
2293
|
-
return function (
|
|
2294
|
-
return
|
|
2302
|
+
return function (_x11) {
|
|
2303
|
+
return _ref25.apply(this, arguments);
|
|
2295
2304
|
};
|
|
2296
2305
|
}();
|
|
2297
2306
|
|
|
@@ -2312,48 +2321,48 @@ exports.StreamCopyToVod = /*#__PURE__*/function () {
|
|
|
2312
2321
|
* @return {Promise<Object>} - The finalize response
|
|
2313
2322
|
*/
|
|
2314
2323
|
exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
2315
|
-
var
|
|
2316
|
-
var libraryId, objectId, writeToken, types,
|
|
2317
|
-
return _regeneratorRuntime.wrap(function
|
|
2318
|
-
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) {
|
|
2319
2328
|
case 0:
|
|
2320
|
-
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;
|
|
2321
2330
|
ValidateObject(objectId);
|
|
2322
2331
|
if (libraryId) {
|
|
2323
|
-
|
|
2332
|
+
_context13.next = 2;
|
|
2324
2333
|
break;
|
|
2325
2334
|
}
|
|
2326
|
-
|
|
2335
|
+
_context13.next = 1;
|
|
2327
2336
|
return this.ContentObjectLibraryId({
|
|
2328
2337
|
objectId: objectId
|
|
2329
2338
|
});
|
|
2330
|
-
case
|
|
2331
|
-
libraryId =
|
|
2332
|
-
case
|
|
2339
|
+
case 1:
|
|
2340
|
+
libraryId = _context13.sent;
|
|
2341
|
+
case 2:
|
|
2333
2342
|
if (writeToken) {
|
|
2334
|
-
|
|
2343
|
+
_context13.next = 4;
|
|
2335
2344
|
break;
|
|
2336
2345
|
}
|
|
2337
|
-
|
|
2346
|
+
_context13.next = 3;
|
|
2338
2347
|
return this.EditContentObject({
|
|
2339
2348
|
objectId: objectId,
|
|
2340
2349
|
libraryId: libraryId
|
|
2341
2350
|
});
|
|
2342
|
-
case
|
|
2343
|
-
_yield$this$EditConte3 =
|
|
2351
|
+
case 3:
|
|
2352
|
+
_yield$this$EditConte3 = _context13.sent;
|
|
2344
2353
|
writeToken = _yield$this$EditConte3.writeToken;
|
|
2345
|
-
case
|
|
2354
|
+
case 4:
|
|
2346
2355
|
this.Log("Removing watermark types: ".concat(types.join(", "), " ").concat(libraryId, " ").concat(objectId));
|
|
2347
|
-
|
|
2356
|
+
_context13.next = 5;
|
|
2348
2357
|
return this.ContentObjectMetadata({
|
|
2349
2358
|
objectId: objectId,
|
|
2350
2359
|
libraryId: libraryId,
|
|
2351
2360
|
metadataSubtree: "/live_recording/fabric_config/edge_write_token"
|
|
2352
2361
|
});
|
|
2353
|
-
case
|
|
2354
|
-
edgeWriteToken =
|
|
2362
|
+
case 5:
|
|
2363
|
+
edgeWriteToken = _context13.sent;
|
|
2355
2364
|
metadataPath = "live_recording/playout_config";
|
|
2356
|
-
|
|
2365
|
+
_context13.next = 6;
|
|
2357
2366
|
return this.ContentObjectMetadata({
|
|
2358
2367
|
libraryId: libraryId,
|
|
2359
2368
|
objectId: objectId,
|
|
@@ -2361,14 +2370,14 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2361
2370
|
metadataSubtree: metadataPath,
|
|
2362
2371
|
resolveLinks: false
|
|
2363
2372
|
});
|
|
2364
|
-
case
|
|
2365
|
-
objectMetadata =
|
|
2373
|
+
case 6:
|
|
2374
|
+
objectMetadata = _context13.sent;
|
|
2366
2375
|
if (objectMetadata) {
|
|
2367
|
-
|
|
2376
|
+
_context13.next = 7;
|
|
2368
2377
|
break;
|
|
2369
2378
|
}
|
|
2370
2379
|
throw Error("Stream object must be configured before removing a watermark");
|
|
2371
|
-
case
|
|
2380
|
+
case 7:
|
|
2372
2381
|
types.forEach(function (type) {
|
|
2373
2382
|
if (type === "text") {
|
|
2374
2383
|
delete objectMetadata.simple_watermark;
|
|
@@ -2378,7 +2387,7 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2378
2387
|
delete objectMetadata.forensic_watermark;
|
|
2379
2388
|
}
|
|
2380
2389
|
});
|
|
2381
|
-
|
|
2390
|
+
_context13.next = 8;
|
|
2382
2391
|
return this.ReplaceMetadata({
|
|
2383
2392
|
libraryId: libraryId,
|
|
2384
2393
|
objectId: objectId,
|
|
@@ -2386,12 +2395,12 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2386
2395
|
metadataSubtree: metadataPath,
|
|
2387
2396
|
metadata: objectMetadata
|
|
2388
2397
|
});
|
|
2389
|
-
case
|
|
2398
|
+
case 8:
|
|
2390
2399
|
if (!edgeWriteToken) {
|
|
2391
|
-
|
|
2400
|
+
_context13.next = 9;
|
|
2392
2401
|
break;
|
|
2393
2402
|
}
|
|
2394
|
-
|
|
2403
|
+
_context13.next = 9;
|
|
2395
2404
|
return this.ReplaceMetadata({
|
|
2396
2405
|
libraryId: libraryId,
|
|
2397
2406
|
objectId: objectId,
|
|
@@ -2399,29 +2408,29 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2399
2408
|
metadataSubtree: metadataPath,
|
|
2400
2409
|
metadata: objectMetadata
|
|
2401
2410
|
});
|
|
2402
|
-
case
|
|
2411
|
+
case 9:
|
|
2403
2412
|
if (!finalize) {
|
|
2404
|
-
|
|
2413
|
+
_context13.next = 11;
|
|
2405
2414
|
break;
|
|
2406
2415
|
}
|
|
2407
|
-
|
|
2416
|
+
_context13.next = 10;
|
|
2408
2417
|
return this.FinalizeContentObject({
|
|
2409
2418
|
libraryId: libraryId,
|
|
2410
2419
|
objectId: objectId,
|
|
2411
2420
|
writeToken: writeToken,
|
|
2412
2421
|
commitMessage: "Watermark removed"
|
|
2413
2422
|
});
|
|
2414
|
-
case
|
|
2415
|
-
finalizeResponse =
|
|
2416
|
-
return
|
|
2417
|
-
case
|
|
2423
|
+
case 10:
|
|
2424
|
+
finalizeResponse = _context13.sent;
|
|
2425
|
+
return _context13.abrupt("return", finalizeResponse);
|
|
2426
|
+
case 11:
|
|
2418
2427
|
case "end":
|
|
2419
|
-
return
|
|
2428
|
+
return _context13.stop();
|
|
2420
2429
|
}
|
|
2421
|
-
},
|
|
2430
|
+
}, _callee13, this);
|
|
2422
2431
|
}));
|
|
2423
|
-
return function (
|
|
2424
|
-
return
|
|
2432
|
+
return function (_x12) {
|
|
2433
|
+
return _ref27.apply(this, arguments);
|
|
2425
2434
|
};
|
|
2426
2435
|
}();
|
|
2427
2436
|
|
|
@@ -2476,49 +2485,49 @@ exports.StreamRemoveWatermark = /*#__PURE__*/function () {
|
|
|
2476
2485
|
* @return {Promise<Object>} - The finalize response
|
|
2477
2486
|
*/
|
|
2478
2487
|
exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
2479
|
-
var
|
|
2480
|
-
var libraryId, objectId, writeToken, simpleWatermark, imageWatermark, forensicWatermark,
|
|
2481
|
-
return _regeneratorRuntime.wrap(function
|
|
2482
|
-
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) {
|
|
2483
2492
|
case 0:
|
|
2484
|
-
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;
|
|
2485
2494
|
ValidateObject(objectId);
|
|
2486
2495
|
if (libraryId) {
|
|
2487
|
-
|
|
2496
|
+
_context14.next = 2;
|
|
2488
2497
|
break;
|
|
2489
2498
|
}
|
|
2490
|
-
|
|
2499
|
+
_context14.next = 1;
|
|
2491
2500
|
return this.ContentObjectLibraryId({
|
|
2492
2501
|
objectId: objectId
|
|
2493
2502
|
});
|
|
2494
|
-
case
|
|
2495
|
-
libraryId =
|
|
2496
|
-
case
|
|
2503
|
+
case 1:
|
|
2504
|
+
libraryId = _context14.sent;
|
|
2505
|
+
case 2:
|
|
2497
2506
|
if (writeToken) {
|
|
2498
|
-
|
|
2507
|
+
_context14.next = 4;
|
|
2499
2508
|
break;
|
|
2500
2509
|
}
|
|
2501
|
-
|
|
2510
|
+
_context14.next = 3;
|
|
2502
2511
|
return this.EditContentObject({
|
|
2503
2512
|
objectId: objectId,
|
|
2504
2513
|
libraryId: libraryId
|
|
2505
2514
|
});
|
|
2506
|
-
case
|
|
2507
|
-
_yield$this$EditConte4 =
|
|
2515
|
+
case 3:
|
|
2516
|
+
_yield$this$EditConte4 = _context14.sent;
|
|
2508
2517
|
writeToken = _yield$this$EditConte4.writeToken;
|
|
2509
|
-
case
|
|
2510
|
-
|
|
2518
|
+
case 4:
|
|
2519
|
+
_context14.next = 5;
|
|
2511
2520
|
return this.ContentObjectMetadata({
|
|
2512
2521
|
objectId: objectId,
|
|
2513
2522
|
libraryId: libraryId,
|
|
2514
2523
|
metadataSubtree: "/live_recording/fabric_config/edge_write_token"
|
|
2515
2524
|
});
|
|
2516
|
-
case
|
|
2517
|
-
edgeWriteToken =
|
|
2525
|
+
case 5:
|
|
2526
|
+
edgeWriteToken = _context14.sent;
|
|
2518
2527
|
watermarkType = imageWatermark ? "image" : forensicWatermark ? "forensic" : "text";
|
|
2519
2528
|
metadataPath = "live_recording/playout_config";
|
|
2520
2529
|
this.Log("Adding watermarking type: ".concat(watermarkType, " ").concat(libraryId, " ").concat(objectId));
|
|
2521
|
-
|
|
2530
|
+
_context14.next = 6;
|
|
2522
2531
|
return this.ContentObjectMetadata({
|
|
2523
2532
|
libraryId: libraryId,
|
|
2524
2533
|
objectId: objectId,
|
|
@@ -2526,30 +2535,30 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2526
2535
|
metadataSubtree: metadataPath,
|
|
2527
2536
|
resolveLinks: false
|
|
2528
2537
|
});
|
|
2529
|
-
case
|
|
2530
|
-
objectMetadata =
|
|
2538
|
+
case 6:
|
|
2539
|
+
objectMetadata = _context14.sent;
|
|
2531
2540
|
if (objectMetadata) {
|
|
2532
|
-
|
|
2541
|
+
_context14.next = 7;
|
|
2533
2542
|
break;
|
|
2534
2543
|
}
|
|
2535
2544
|
throw Error("Stream object must be configured before adding a watermark");
|
|
2536
|
-
case
|
|
2545
|
+
case 7:
|
|
2537
2546
|
watermarkArgCount = [simpleWatermark, imageWatermark, forensicWatermark].filter(function (i) {
|
|
2538
2547
|
return !!i;
|
|
2539
2548
|
}).length;
|
|
2540
2549
|
console.log("watermark arg count", watermarkArgCount);
|
|
2541
2550
|
if (!(watermarkArgCount === 0)) {
|
|
2542
|
-
|
|
2551
|
+
_context14.next = 8;
|
|
2543
2552
|
break;
|
|
2544
2553
|
}
|
|
2545
2554
|
throw Error("No watermark was provided");
|
|
2546
|
-
case
|
|
2555
|
+
case 8:
|
|
2547
2556
|
if (!(watermarkArgCount > 1)) {
|
|
2548
|
-
|
|
2557
|
+
_context14.next = 9;
|
|
2549
2558
|
break;
|
|
2550
2559
|
}
|
|
2551
2560
|
throw Error("Only one watermark is allowed");
|
|
2552
|
-
case
|
|
2561
|
+
case 9:
|
|
2553
2562
|
if (simpleWatermark) {
|
|
2554
2563
|
objectMetadata.simple_watermark = simpleWatermark;
|
|
2555
2564
|
} else if (imageWatermark) {
|
|
@@ -2557,7 +2566,7 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2557
2566
|
} else if (forensicWatermark) {
|
|
2558
2567
|
objectMetadata.forensic_watermark = forensicWatermark;
|
|
2559
2568
|
}
|
|
2560
|
-
|
|
2569
|
+
_context14.next = 10;
|
|
2561
2570
|
return this.ReplaceMetadata({
|
|
2562
2571
|
libraryId: libraryId,
|
|
2563
2572
|
objectId: objectId,
|
|
@@ -2565,12 +2574,12 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2565
2574
|
metadataSubtree: metadataPath,
|
|
2566
2575
|
metadata: objectMetadata
|
|
2567
2576
|
});
|
|
2568
|
-
case
|
|
2577
|
+
case 10:
|
|
2569
2578
|
if (!edgeWriteToken) {
|
|
2570
|
-
|
|
2579
|
+
_context14.next = 11;
|
|
2571
2580
|
break;
|
|
2572
2581
|
}
|
|
2573
|
-
|
|
2582
|
+
_context14.next = 11;
|
|
2574
2583
|
return this.ReplaceMetadata({
|
|
2575
2584
|
libraryId: libraryId,
|
|
2576
2585
|
objectId: objectId,
|
|
@@ -2578,36 +2587,36 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2578
2587
|
metadataSubtree: metadataPath,
|
|
2579
2588
|
metadata: objectMetadata
|
|
2580
2589
|
});
|
|
2581
|
-
case
|
|
2590
|
+
case 11:
|
|
2582
2591
|
response = {
|
|
2583
2592
|
"imageWatermark": objectMetadata.image_watermark,
|
|
2584
2593
|
"textWatermark": objectMetadata.simple_watermark,
|
|
2585
2594
|
"forensicWatermark": objectMetadata.forensic_watermark
|
|
2586
2595
|
};
|
|
2587
2596
|
if (!finalize) {
|
|
2588
|
-
|
|
2597
|
+
_context14.next = 13;
|
|
2589
2598
|
break;
|
|
2590
2599
|
}
|
|
2591
|
-
|
|
2600
|
+
_context14.next = 12;
|
|
2592
2601
|
return this.FinalizeContentObject({
|
|
2593
2602
|
libraryId: libraryId,
|
|
2594
2603
|
objectId: objectId,
|
|
2595
2604
|
writeToken: writeToken,
|
|
2596
2605
|
commitMessage: "Watermark set"
|
|
2597
2606
|
});
|
|
2598
|
-
case
|
|
2599
|
-
finalizeResponse =
|
|
2607
|
+
case 12:
|
|
2608
|
+
finalizeResponse = _context14.sent;
|
|
2600
2609
|
response.hash = finalizeResponse.hash;
|
|
2601
|
-
case
|
|
2602
|
-
return
|
|
2603
|
-
case
|
|
2610
|
+
case 13:
|
|
2611
|
+
return _context14.abrupt("return", response);
|
|
2612
|
+
case 14:
|
|
2604
2613
|
case "end":
|
|
2605
|
-
return
|
|
2614
|
+
return _context14.stop();
|
|
2606
2615
|
}
|
|
2607
|
-
},
|
|
2616
|
+
}, _callee14, this);
|
|
2608
2617
|
}));
|
|
2609
|
-
return function (
|
|
2610
|
-
return
|
|
2618
|
+
return function (_x13) {
|
|
2619
|
+
return _ref29.apply(this, arguments);
|
|
2611
2620
|
};
|
|
2612
2621
|
}();
|
|
2613
2622
|
|
|
@@ -2625,13 +2634,13 @@ exports.StreamAddWatermark = /*#__PURE__*/function () {
|
|
|
2625
2634
|
* @returns {Promise<Object>} - Response describing audit results
|
|
2626
2635
|
*/
|
|
2627
2636
|
exports.AuditStream = /*#__PURE__*/function () {
|
|
2628
|
-
var
|
|
2637
|
+
var _ref31 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref30) {
|
|
2629
2638
|
var objectId, versionHash, salt, samples, authorizationToken;
|
|
2630
|
-
return _regeneratorRuntime.wrap(function
|
|
2631
|
-
while (1) switch (
|
|
2639
|
+
return _regeneratorRuntime.wrap(function (_context15) {
|
|
2640
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
2632
2641
|
case 0:
|
|
2633
|
-
objectId =
|
|
2634
|
-
|
|
2642
|
+
objectId = _ref30.objectId, versionHash = _ref30.versionHash, salt = _ref30.salt, samples = _ref30.samples, authorizationToken = _ref30.authorizationToken;
|
|
2643
|
+
_context15.next = 1;
|
|
2635
2644
|
return ContentObjectAudit.AuditContentObject({
|
|
2636
2645
|
client: this,
|
|
2637
2646
|
objectId: objectId,
|
|
@@ -2641,15 +2650,15 @@ exports.AuditStream = /*#__PURE__*/function () {
|
|
|
2641
2650
|
live: true,
|
|
2642
2651
|
authorizationToken: authorizationToken
|
|
2643
2652
|
});
|
|
2644
|
-
case
|
|
2645
|
-
return
|
|
2646
|
-
case
|
|
2653
|
+
case 1:
|
|
2654
|
+
return _context15.abrupt("return", _context15.sent);
|
|
2655
|
+
case 2:
|
|
2647
2656
|
case "end":
|
|
2648
|
-
return
|
|
2657
|
+
return _context15.stop();
|
|
2649
2658
|
}
|
|
2650
|
-
},
|
|
2659
|
+
}, _callee15, this);
|
|
2651
2660
|
}));
|
|
2652
|
-
return function (
|
|
2653
|
-
return
|
|
2661
|
+
return function (_x14) {
|
|
2662
|
+
return _ref31.apply(this, arguments);
|
|
2654
2663
|
};
|
|
2655
2664
|
}();
|