@eluvio/elv-client-js 4.0.58 → 4.0.60
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 +9 -9
- package/dist/ElvClient-node-min.js +6 -6
- package/dist/ElvFrameClient-min.js +6 -6
- package/dist/ElvPermissionsClient-min.js +9 -9
- package/dist/ElvWalletClient-min.js +8 -8
- package/dist/ElvWalletClient-node-min.js +6 -6
- package/dist/src/Utils.js +0 -15
- package/dist/src/client/ContentAccess.js +47 -69
- package/dist/src/client/ContentManagement.js +1 -1
- package/dist/src/client/Files.js +7 -50
- package/dist/src/client/LiveConf.js +20 -33
- package/dist/src/client/LiveStream.js +7 -21
- package/package.json +1 -1
- package/src/Utils.js +15 -1
- package/src/walletClient/Notifications.js +4 -3
package/dist/src/Utils.js
CHANGED
|
@@ -806,21 +806,6 @@ var Utils = {
|
|
|
806
806
|
} else {
|
|
807
807
|
return Utils.PLATFORM_WEB;
|
|
808
808
|
}
|
|
809
|
-
},
|
|
810
|
-
LiveHLSJSSettings: function LiveHLSJSSettings(_ref4) {
|
|
811
|
-
var _ref4$lowLatency = _ref4.lowLatency,
|
|
812
|
-
lowLatency = _ref4$lowLatency === void 0 ? false : _ref4$lowLatency;
|
|
813
|
-
var isSafari = typeof window !== "undefined" && typeof window.navigator !== "undefined" && /^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);
|
|
814
|
-
return {
|
|
815
|
-
"enableWorker": true,
|
|
816
|
-
"lowLatencyMode": true,
|
|
817
|
-
"maxBufferLength": 5,
|
|
818
|
-
"backBufferLength": 5,
|
|
819
|
-
"liveSyncDuration": 5,
|
|
820
|
-
"liveMaxLatencyDuration": !lowLatency || isSafari ? 15 : 10,
|
|
821
|
-
"liveDurationInfinity": false,
|
|
822
|
-
"highBufferWatchdogPeriod": 1
|
|
823
|
-
};
|
|
824
809
|
}
|
|
825
810
|
};
|
|
826
811
|
module.exports = Utils;
|
|
@@ -3244,16 +3244,6 @@ exports.ContentObjectImageUrl = /*#__PURE__*/function () {
|
|
|
3244
3244
|
return _ref71.apply(this, arguments);
|
|
3245
3245
|
};
|
|
3246
3246
|
}();
|
|
3247
|
-
var EmbedMediaTypes = {
|
|
3248
|
-
"video": "v",
|
|
3249
|
-
"live_video": "lv",
|
|
3250
|
-
"audio": "a",
|
|
3251
|
-
"image": "i",
|
|
3252
|
-
"html": "h",
|
|
3253
|
-
"ebook": "b",
|
|
3254
|
-
"gallery": "g",
|
|
3255
|
-
"link": "l"
|
|
3256
|
-
};
|
|
3257
3247
|
|
|
3258
3248
|
/**
|
|
3259
3249
|
* Get an embed URL for the specified object
|
|
@@ -3263,14 +3253,6 @@ var EmbedMediaTypes = {
|
|
|
3263
3253
|
* @param {string} objectId - ID of the object
|
|
3264
3254
|
* @param {string} versionHash - Version hash of the object
|
|
3265
3255
|
* @param {number} duration - Time until the token expires, in milliseconds (1 day = 24 * 60 * 60 * 1000 = 86400000)
|
|
3266
|
-
* @param {string=} mediaType=video - The type of the media. Available options:
|
|
3267
|
-
- `video`
|
|
3268
|
-
- `live_video`
|
|
3269
|
-
- `audio`
|
|
3270
|
-
- `image`
|
|
3271
|
-
- `gallery`
|
|
3272
|
-
- `ebook`
|
|
3273
|
-
- `html`
|
|
3274
3256
|
* @param {Object} options - Additional video/player options
|
|
3275
3257
|
- `autoplay` - If enabled, video will autoplay. Note that videos block autoplay of videos with audio by default
|
|
3276
3258
|
- `capLevelToPlayerSize` - Caps video quality to player size
|
|
@@ -3294,11 +3276,11 @@ var EmbedMediaTypes = {
|
|
|
3294
3276
|
*/
|
|
3295
3277
|
exports.EmbedUrl = /*#__PURE__*/function () {
|
|
3296
3278
|
var _ref73 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref72) {
|
|
3297
|
-
var objectId, versionHash, _ref72$duration, duration, _ref72$
|
|
3279
|
+
var objectId, versionHash, _ref72$duration, duration, _ref72$options, options, controlsMap, embedUrl, networkInfo, networkName, permission, data, _i, _Object$keys, option, token;
|
|
3298
3280
|
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
3299
3281
|
while (1) switch (_context41.prev = _context41.next) {
|
|
3300
3282
|
case 0:
|
|
3301
|
-
objectId = _ref72.objectId, versionHash = _ref72.versionHash, _ref72$duration = _ref72.duration, duration = _ref72$duration === void 0 ? 86400000 : _ref72$duration, _ref72$
|
|
3283
|
+
objectId = _ref72.objectId, versionHash = _ref72.versionHash, _ref72$duration = _ref72.duration, duration = _ref72$duration === void 0 ? 86400000 : _ref72$duration, _ref72$options = _ref72.options, options = _ref72$options === void 0 ? {} : _ref72$options;
|
|
3302
3284
|
if (versionHash) {
|
|
3303
3285
|
ValidateVersion(versionHash);
|
|
3304
3286
|
} else if (objectId) {
|
|
@@ -3332,100 +3314,96 @@ exports.EmbedUrl = /*#__PURE__*/function () {
|
|
|
3332
3314
|
} else if (objectId) {
|
|
3333
3315
|
embedUrl.searchParams.set("oid", objectId);
|
|
3334
3316
|
}
|
|
3335
|
-
embedUrl.searchParams.set("mt", EmbedMediaTypes[mediaType.toLowerCase()] || "v");
|
|
3336
3317
|
data = {};
|
|
3337
3318
|
_i = 0, _Object$keys = Object.keys(options);
|
|
3338
|
-
case
|
|
3319
|
+
case 17:
|
|
3339
3320
|
if (!(_i < _Object$keys.length)) {
|
|
3340
|
-
_context41.next =
|
|
3321
|
+
_context41.next = 59;
|
|
3341
3322
|
break;
|
|
3342
3323
|
}
|
|
3343
3324
|
option = _Object$keys[_i];
|
|
3344
3325
|
_context41.t0 = option;
|
|
3345
|
-
_context41.next = _context41.t0 === "
|
|
3326
|
+
_context41.next = _context41.t0 === "autoplay" ? 22 : _context41.t0 === "capLevelToPlayerSize" ? 24 : _context41.t0 === "clipEnd" ? 26 : _context41.t0 === "clipStart" ? 28 : _context41.t0 === "controls" ? 30 : _context41.t0 === "description" ? 32 : _context41.t0 === "directLink" ? 34 : _context41.t0 === "linkPath" ? 36 : _context41.t0 === "loop" ? 38 : _context41.t0 === "muted" ? 40 : _context41.t0 === "offerings" ? 42 : _context41.t0 === "posterUrl" ? 44 : _context41.t0 === "protocols" ? 46 : _context41.t0 === "showShare" ? 48 : _context41.t0 === "showTitle" ? 50 : _context41.t0 === "title" ? 52 : _context41.t0 === "viewRecordKey" ? 54 : 56;
|
|
3346
3327
|
break;
|
|
3347
|
-
case
|
|
3348
|
-
embedUrl.searchParams.set("awm", "");
|
|
3349
|
-
return _context41.abrupt("break", 59);
|
|
3350
|
-
case 25:
|
|
3328
|
+
case 22:
|
|
3351
3329
|
embedUrl.searchParams.set("ap", "");
|
|
3352
|
-
return _context41.abrupt("break",
|
|
3353
|
-
case
|
|
3330
|
+
return _context41.abrupt("break", 56);
|
|
3331
|
+
case 24:
|
|
3354
3332
|
embedUrl.searchParams.set("cap", "");
|
|
3355
|
-
return _context41.abrupt("break",
|
|
3356
|
-
case
|
|
3333
|
+
return _context41.abrupt("break", 56);
|
|
3334
|
+
case 26:
|
|
3357
3335
|
embedUrl.searchParams.set("end", options.clipEnd);
|
|
3358
|
-
return _context41.abrupt("break",
|
|
3359
|
-
case
|
|
3336
|
+
return _context41.abrupt("break", 56);
|
|
3337
|
+
case 28:
|
|
3360
3338
|
embedUrl.searchParams.set("start", options.clipStart);
|
|
3361
|
-
return _context41.abrupt("break",
|
|
3362
|
-
case
|
|
3339
|
+
return _context41.abrupt("break", 56);
|
|
3340
|
+
case 30:
|
|
3363
3341
|
if (options.controls !== "hide") {
|
|
3364
3342
|
embedUrl.searchParams.set("ct", controlsMap[options.controls]);
|
|
3365
3343
|
}
|
|
3366
|
-
return _context41.abrupt("break",
|
|
3367
|
-
case
|
|
3344
|
+
return _context41.abrupt("break", 56);
|
|
3345
|
+
case 32:
|
|
3368
3346
|
data["og:description"] = options.description;
|
|
3369
|
-
return _context41.abrupt("break",
|
|
3370
|
-
case
|
|
3347
|
+
return _context41.abrupt("break", 56);
|
|
3348
|
+
case 34:
|
|
3371
3349
|
embedUrl.searchParams.set("dr", "");
|
|
3372
|
-
return _context41.abrupt("break",
|
|
3373
|
-
case
|
|
3350
|
+
return _context41.abrupt("break", 56);
|
|
3351
|
+
case 36:
|
|
3374
3352
|
embedUrl.searchParams.set("ln", this.utils.B64(options.linkPath));
|
|
3375
|
-
return _context41.abrupt("break",
|
|
3376
|
-
case
|
|
3353
|
+
return _context41.abrupt("break", 56);
|
|
3354
|
+
case 38:
|
|
3377
3355
|
embedUrl.searchParams.set("lp", "");
|
|
3378
|
-
return _context41.abrupt("break",
|
|
3379
|
-
case
|
|
3356
|
+
return _context41.abrupt("break", 56);
|
|
3357
|
+
case 40:
|
|
3380
3358
|
embedUrl.searchParams.set("m", "");
|
|
3381
|
-
return _context41.abrupt("break",
|
|
3382
|
-
case
|
|
3359
|
+
return _context41.abrupt("break", 56);
|
|
3360
|
+
case 42:
|
|
3383
3361
|
embedUrl.searchParams.set("off", options.offerings.join(","));
|
|
3384
|
-
return _context41.abrupt("break",
|
|
3385
|
-
case
|
|
3362
|
+
return _context41.abrupt("break", 56);
|
|
3363
|
+
case 44:
|
|
3386
3364
|
embedUrl.searchParams.set("pst", options.posterUrl);
|
|
3387
|
-
return _context41.abrupt("break",
|
|
3388
|
-
case
|
|
3365
|
+
return _context41.abrupt("break", 56);
|
|
3366
|
+
case 46:
|
|
3389
3367
|
embedUrl.searchParams.set("ptc", options.protocols.join(","));
|
|
3390
|
-
return _context41.abrupt("break",
|
|
3391
|
-
case
|
|
3368
|
+
return _context41.abrupt("break", 56);
|
|
3369
|
+
case 48:
|
|
3392
3370
|
embedUrl.searchParams.set("sh", "");
|
|
3393
|
-
return _context41.abrupt("break",
|
|
3394
|
-
case
|
|
3371
|
+
return _context41.abrupt("break", 56);
|
|
3372
|
+
case 50:
|
|
3395
3373
|
embedUrl.searchParams.set("st", "");
|
|
3396
|
-
return _context41.abrupt("break",
|
|
3397
|
-
case
|
|
3374
|
+
return _context41.abrupt("break", 56);
|
|
3375
|
+
case 52:
|
|
3398
3376
|
data["og:title"] = options.title;
|
|
3399
|
-
return _context41.abrupt("break",
|
|
3400
|
-
case
|
|
3377
|
+
return _context41.abrupt("break", 56);
|
|
3378
|
+
case 54:
|
|
3401
3379
|
embedUrl.searchParams.set("vrk", options.viewRecordKey);
|
|
3402
|
-
return _context41.abrupt("break",
|
|
3403
|
-
case
|
|
3380
|
+
return _context41.abrupt("break", 56);
|
|
3381
|
+
case 56:
|
|
3404
3382
|
_i++;
|
|
3405
|
-
_context41.next =
|
|
3383
|
+
_context41.next = 17;
|
|
3406
3384
|
break;
|
|
3407
|
-
case
|
|
3385
|
+
case 59:
|
|
3408
3386
|
if (Object.keys(data).length > 0) {
|
|
3409
3387
|
embedUrl.searchParams.set("data", this.utils.B64(JSON.stringify({
|
|
3410
3388
|
meta_tags: data
|
|
3411
3389
|
})));
|
|
3412
3390
|
}
|
|
3413
3391
|
if (!["owner", "editable", "viewable"].includes(permission)) {
|
|
3414
|
-
_context41.next =
|
|
3392
|
+
_context41.next = 65;
|
|
3415
3393
|
break;
|
|
3416
3394
|
}
|
|
3417
|
-
_context41.next =
|
|
3395
|
+
_context41.next = 63;
|
|
3418
3396
|
return this.CreateSignedToken({
|
|
3419
3397
|
objectId: objectId,
|
|
3420
3398
|
versionHash: versionHash,
|
|
3421
3399
|
duration: duration
|
|
3422
3400
|
});
|
|
3423
|
-
case
|
|
3401
|
+
case 63:
|
|
3424
3402
|
token = _context41.sent;
|
|
3425
3403
|
embedUrl.searchParams.set("ath", token);
|
|
3426
|
-
case
|
|
3404
|
+
case 65:
|
|
3427
3405
|
return _context41.abrupt("return", embedUrl.toString());
|
|
3428
|
-
case
|
|
3406
|
+
case 66:
|
|
3429
3407
|
case "end":
|
|
3430
3408
|
return _context41.stop();
|
|
3431
3409
|
}
|
|
@@ -2215,7 +2215,7 @@ exports.UpdateContentObjectGraph = /*#__PURE__*/function () {
|
|
|
2215
2215
|
return _context30.delegateYield(_loop(), "t0", 8);
|
|
2216
2216
|
case 8:
|
|
2217
2217
|
_ret = _context30.t0;
|
|
2218
|
-
if (!_ret) {
|
|
2218
|
+
if (!(_typeof(_ret) === "object")) {
|
|
2219
2219
|
_context30.next = 11;
|
|
2220
2220
|
break;
|
|
2221
2221
|
}
|
package/dist/src/client/Files.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
|
|
2
1
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
3
2
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
@@ -773,7 +772,7 @@ exports.UploadStatus = /*#__PURE__*/function () {
|
|
|
773
772
|
}();
|
|
774
773
|
exports.UploadJobStatus = /*#__PURE__*/function () {
|
|
775
774
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref14) {
|
|
776
|
-
var libraryId, objectId, writeToken, uploadId, jobId, path
|
|
775
|
+
var libraryId, objectId, writeToken, uploadId, jobId, path;
|
|
777
776
|
return _regeneratorRuntime.wrap(function _callee9$(_context10) {
|
|
778
777
|
while (1) switch (_context10.prev = _context10.next) {
|
|
779
778
|
case 0:
|
|
@@ -796,59 +795,17 @@ exports.UploadJobStatus = /*#__PURE__*/function () {
|
|
|
796
795
|
_context10.t2 = _context10.sent;
|
|
797
796
|
_context10.t3 = path;
|
|
798
797
|
_context10.t4 = {
|
|
799
|
-
start: 0,
|
|
800
|
-
limit: 10000
|
|
801
|
-
};
|
|
802
|
-
_context10.t5 = {
|
|
803
798
|
headers: _context10.t2,
|
|
804
799
|
method: "GET",
|
|
805
800
|
path: _context10.t3,
|
|
806
|
-
allowFailover: false
|
|
807
|
-
queryParams: _context10.t4
|
|
801
|
+
allowFailover: false
|
|
808
802
|
};
|
|
809
|
-
_context10.
|
|
810
|
-
_context10.next =
|
|
811
|
-
return _context10.t0.ResponseToJson.call(_context10.t0, _context10.
|
|
803
|
+
_context10.t5 = _context10.t1.Request.call(_context10.t1, _context10.t4);
|
|
804
|
+
_context10.next = 14;
|
|
805
|
+
return _context10.t0.ResponseToJson.call(_context10.t0, _context10.t5);
|
|
806
|
+
case 14:
|
|
807
|
+
return _context10.abrupt("return", _context10.sent);
|
|
812
808
|
case 15:
|
|
813
|
-
response = _context10.sent;
|
|
814
|
-
case 16:
|
|
815
|
-
if (!(response.next !== response.total && response.next >= 0)) {
|
|
816
|
-
_context10.next = 33;
|
|
817
|
-
break;
|
|
818
|
-
}
|
|
819
|
-
_context10.t7 = this.utils;
|
|
820
|
-
_context10.t8 = this.HttpClient;
|
|
821
|
-
_context10.next = 21;
|
|
822
|
-
return this.authClient.AuthorizationHeader({
|
|
823
|
-
libraryId: libraryId,
|
|
824
|
-
objectId: objectId,
|
|
825
|
-
update: true
|
|
826
|
-
});
|
|
827
|
-
case 21:
|
|
828
|
-
_context10.t9 = _context10.sent;
|
|
829
|
-
_context10.t10 = path;
|
|
830
|
-
_context10.t11 = {
|
|
831
|
-
start: response.next
|
|
832
|
-
};
|
|
833
|
-
_context10.t12 = {
|
|
834
|
-
headers: _context10.t9,
|
|
835
|
-
method: "GET",
|
|
836
|
-
path: _context10.t10,
|
|
837
|
-
allowFailover: false,
|
|
838
|
-
queryParams: _context10.t11
|
|
839
|
-
};
|
|
840
|
-
_context10.t13 = _context10.t8.Request.call(_context10.t8, _context10.t12);
|
|
841
|
-
_context10.next = 28;
|
|
842
|
-
return _context10.t7.ResponseToJson.call(_context10.t7, _context10.t13);
|
|
843
|
-
case 28:
|
|
844
|
-
newResponse = _context10.sent;
|
|
845
|
-
response.files = [].concat(_toConsumableArray(response.files), _toConsumableArray(newResponse.files));
|
|
846
|
-
response.next = newResponse.next;
|
|
847
|
-
_context10.next = 16;
|
|
848
|
-
break;
|
|
849
|
-
case 33:
|
|
850
|
-
return _context10.abrupt("return", response);
|
|
851
|
-
case 34:
|
|
852
809
|
case "end":
|
|
853
810
|
return _context10.stop();
|
|
854
811
|
}
|
|
@@ -37,14 +37,14 @@ var LadderTemplate = {
|
|
|
37
37
|
stream_name: "video",
|
|
38
38
|
width: 960
|
|
39
39
|
},
|
|
40
|
-
"
|
|
41
|
-
bit_rate:
|
|
40
|
+
"360": {
|
|
41
|
+
bit_rate: 520000,
|
|
42
42
|
codecs: "avc1.640028,mp4a.40.2",
|
|
43
|
-
height:
|
|
43
|
+
height: 360,
|
|
44
44
|
media_type: 1,
|
|
45
|
-
representation: "
|
|
45
|
+
representation: "videovideo_640x360_h264@520000",
|
|
46
46
|
stream_name: "video",
|
|
47
|
-
width:
|
|
47
|
+
width: 640
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
var LiveconfTemplate = {
|
|
@@ -235,13 +235,9 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
235
235
|
}
|
|
236
236
|
}, {
|
|
237
237
|
key: "generateLiveConf",
|
|
238
|
-
value: function generateLiveConf(
|
|
239
|
-
var audioBitrate = _ref2.audioBitrate,
|
|
240
|
-
audioIndex = _ref2.audioIndex,
|
|
241
|
-
partTtl = _ref2.partTtl,
|
|
242
|
-
channelLayout = _ref2.channelLayout;
|
|
238
|
+
value: function generateLiveConf() {
|
|
243
239
|
// gather required data
|
|
244
|
-
var conf =
|
|
240
|
+
var conf = LiveconfTemplate;
|
|
245
241
|
var fileName = this.overwriteOriginUrl || this.probeData.format.filename;
|
|
246
242
|
var audioStream = this.getStreamDataForCodecType("audio");
|
|
247
243
|
var sampleRate = parseInt(audioStream.sample_rate);
|
|
@@ -257,16 +253,13 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
257
253
|
conf.live_recording.recording_config.recording_params.origin_url = fileName;
|
|
258
254
|
conf.live_recording.recording_config.recording_params.description = "Ingest stream ".concat(fileName);
|
|
259
255
|
conf.live_recording.recording_config.recording_params.name = "Ingest stream ".concat(fileName);
|
|
260
|
-
conf.live_recording.recording_config.recording_params.xc_params.audio_index[0] =
|
|
256
|
+
conf.live_recording.recording_config.recording_params.xc_params.audio_index[0] = audioStream.stream_index;
|
|
261
257
|
conf.live_recording.recording_config.recording_params.xc_params.sample_rate = sampleRate;
|
|
262
258
|
conf.live_recording.recording_config.recording_params.xc_params.enc_height = videoStream.height;
|
|
263
259
|
conf.live_recording.recording_config.recording_params.xc_params.enc_width = videoStream.width;
|
|
264
260
|
if (this.syncAudioToVideo) {
|
|
265
261
|
conf.live_recording.recording_config.recording_params.xc_params.sync_audio_to_stream_id = this.syncAudioToStreamIdValue();
|
|
266
262
|
}
|
|
267
|
-
if (partTtl) {
|
|
268
|
-
conf.live_recording.recording_config.recording_params.part_ttl = partTtl;
|
|
269
|
-
}
|
|
270
263
|
|
|
271
264
|
// Fill in specifics for protocol
|
|
272
265
|
switch (this.probeKind()) {
|
|
@@ -296,44 +289,38 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
296
289
|
conf.live_recording.recording_config.recording_params.xc_params.force_keyint = segDurations.keyint;
|
|
297
290
|
switch (videoStream.height) {
|
|
298
291
|
case 2160:
|
|
299
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[2160], LadderTemplate[1080], LadderTemplate[720], LadderTemplate[540], LadderTemplate[
|
|
292
|
+
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[2160], LadderTemplate[1080], LadderTemplate[720], LadderTemplate[540], LadderTemplate[360]);
|
|
300
293
|
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[2160].bit_rate;
|
|
301
294
|
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 2160;
|
|
302
295
|
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 3840;
|
|
303
296
|
break;
|
|
304
297
|
case 1080:
|
|
305
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[1080], LadderTemplate[720], LadderTemplate[540], LadderTemplate[
|
|
298
|
+
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[1080], LadderTemplate[720], LadderTemplate[540], LadderTemplate[360]);
|
|
306
299
|
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[1080].bit_rate;
|
|
307
300
|
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 1080;
|
|
308
301
|
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 1920;
|
|
309
302
|
break;
|
|
310
303
|
case 720:
|
|
311
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[720], LadderTemplate[540], LadderTemplate[
|
|
304
|
+
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[720], LadderTemplate[540], LadderTemplate[360]);
|
|
312
305
|
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[720].bit_rate;
|
|
313
306
|
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 720;
|
|
314
307
|
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 1280;
|
|
315
308
|
break;
|
|
316
309
|
case 540:
|
|
317
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[540], LadderTemplate[
|
|
310
|
+
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[540], LadderTemplate[360]);
|
|
318
311
|
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[540].bit_rate;
|
|
319
312
|
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 540;
|
|
320
313
|
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 960;
|
|
321
314
|
break;
|
|
315
|
+
case 360:
|
|
316
|
+
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[360]);
|
|
317
|
+
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[360]);
|
|
318
|
+
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[360].bit_rate;
|
|
319
|
+
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 360;
|
|
320
|
+
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 640;
|
|
321
|
+
break;
|
|
322
322
|
default:
|
|
323
|
-
throw new Error("ERROR: Probed stream does not conform to one of the following built in resolution ladders [4096, 2160], [1920, 1080] [1280, 720], [960, 540]");
|
|
324
|
-
}
|
|
325
|
-
if (audioBitrate || channelLayout) {
|
|
326
|
-
var audioLadderSpec = conf.live_recording.recording_config.recording_params.ladder_specs.find(function (spec) {
|
|
327
|
-
return spec.stream_name === "audio";
|
|
328
|
-
});
|
|
329
|
-
if (audioBitrate) {
|
|
330
|
-
conf.live_recording.recording_config.recording_params.xc_params.audio_bitrate = audioBitrate;
|
|
331
|
-
audioLadderSpec.bit_rate = audioBitrate;
|
|
332
|
-
audioLadderSpec.representation = "audioaudio_aac@".concat(audioBitrate);
|
|
333
|
-
}
|
|
334
|
-
if (channelLayout) {
|
|
335
|
-
audioLadderSpec.channels = channelLayout;
|
|
336
|
-
}
|
|
323
|
+
throw new Error("ERROR: Probed stream does not conform to one of the following built in resolution ladders [4096, 2160], [1920, 1080] [1280, 720], [960, 540], [640, 360]");
|
|
337
324
|
}
|
|
338
325
|
return JSON.stringify(conf, null, 2);
|
|
339
326
|
}
|
|
@@ -346,7 +346,7 @@ exports.StreamStatus = /*#__PURE__*/function () {
|
|
|
346
346
|
if (networkInfo.name.includes("demo")) {
|
|
347
347
|
embed_net = "demo";
|
|
348
348
|
}
|
|
349
|
-
embed_url = "https://embed.v3.contentfabric.io/?net=".concat(embed_net, "&p&ct=h&oid=").concat(conf.objectId, "&mt=
|
|
349
|
+
embed_url = "https://embed.v3.contentfabric.io/?net=".concat(embed_net, "&p&ct=h&oid=").concat(conf.objectId, "&mt=v&ath=").concat(token);
|
|
350
350
|
playout_urls.embed_url = embed_url;
|
|
351
351
|
status.playout_urls = playout_urls;
|
|
352
352
|
case 128:
|
|
@@ -1310,11 +1310,11 @@ exports.LoadConf = /*#__PURE__*/function () {
|
|
|
1310
1310
|
*/
|
|
1311
1311
|
exports.StreamConfig = /*#__PURE__*/function () {
|
|
1312
1312
|
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref11) {
|
|
1313
|
-
var name,
|
|
1313
|
+
var name, conf, status, libraryId, mainMeta, userConfig, hostName, streamUrl, nodes, node, endpoint, probe, controller, timeoutId, probeUrl, lc, liveRecordingConfigStr, liveRecordingConfig, e, writeToken;
|
|
1314
1314
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
1315
1315
|
while (1) switch (_context6.prev = _context6.next) {
|
|
1316
1316
|
case 0:
|
|
1317
|
-
name = _ref11.name
|
|
1317
|
+
name = _ref11.name;
|
|
1318
1318
|
_context6.next = 3;
|
|
1319
1319
|
return this.LoadConf({
|
|
1320
1320
|
name: name
|
|
@@ -1422,14 +1422,9 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1422
1422
|
console.log("PROBE", probe);
|
|
1423
1423
|
probe.format.filename = streamUrl.href;
|
|
1424
1424
|
|
|
1425
|
-
// Create live
|
|
1425
|
+
// Create live reocording config
|
|
1426
1426
|
lc = new LiveConf(probe, node.id, endpoint, false, false, true);
|
|
1427
|
-
liveRecordingConfigStr = lc.generateLiveConf(
|
|
1428
|
-
audioBitrate: customSettings.audioBitrate,
|
|
1429
|
-
audioIndex: customSettings.audioIndex,
|
|
1430
|
-
partTtl: customSettings.partTtl,
|
|
1431
|
-
channelLayout: customSettings.channelLayout
|
|
1432
|
-
});
|
|
1427
|
+
liveRecordingConfigStr = lc.generateLiveConf();
|
|
1433
1428
|
liveRecordingConfig = JSON.parse(liveRecordingConfigStr);
|
|
1434
1429
|
console.log("CONFIG", JSON.stringify(liveRecordingConfig.live_recording));
|
|
1435
1430
|
|
|
@@ -1452,25 +1447,16 @@ exports.StreamConfig = /*#__PURE__*/function () {
|
|
|
1452
1447
|
});
|
|
1453
1448
|
case 66:
|
|
1454
1449
|
_context6.next = 68;
|
|
1455
|
-
return this.ReplaceMetadata({
|
|
1456
|
-
libraryId: libraryId,
|
|
1457
|
-
objectId: conf.objectId,
|
|
1458
|
-
writeToken: writeToken,
|
|
1459
|
-
metadataSubtree: "probe",
|
|
1460
|
-
metadata: probe
|
|
1461
|
-
});
|
|
1462
|
-
case 68:
|
|
1463
|
-
_context6.next = 70;
|
|
1464
1450
|
return this.FinalizeContentObject({
|
|
1465
1451
|
libraryId: libraryId,
|
|
1466
1452
|
objectId: conf.objectId,
|
|
1467
1453
|
writeToken: writeToken,
|
|
1468
1454
|
commitMessage: "Apply live stream configuration"
|
|
1469
1455
|
});
|
|
1470
|
-
case
|
|
1456
|
+
case 68:
|
|
1471
1457
|
status.fin = _context6.sent;
|
|
1472
1458
|
return _context6.abrupt("return", status);
|
|
1473
|
-
case
|
|
1459
|
+
case 70:
|
|
1474
1460
|
case "end":
|
|
1475
1461
|
return _context6.stop();
|
|
1476
1462
|
}
|
package/package.json
CHANGED
package/src/Utils.js
CHANGED
|
@@ -743,12 +743,26 @@ const Utils = {
|
|
|
743
743
|
}
|
|
744
744
|
},
|
|
745
745
|
|
|
746
|
-
LiveHLSJSSettings({lowLatency=false}) {
|
|
746
|
+
LiveHLSJSSettings({lowLatency=false, ultraLowLatency=false}) {
|
|
747
747
|
const isSafari =
|
|
748
748
|
typeof window !== "undefined" &&
|
|
749
749
|
typeof window.navigator !== "undefined" &&
|
|
750
750
|
/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);
|
|
751
751
|
|
|
752
|
+
if(ultraLowLatency && !isSafari) {
|
|
753
|
+
return {
|
|
754
|
+
"capLevelToPlayerSize": false,
|
|
755
|
+
"enableWorker": true,
|
|
756
|
+
"lowLatencyMode": true,
|
|
757
|
+
"maxBufferLength": 8,
|
|
758
|
+
"backBufferLength": 4,
|
|
759
|
+
"liveSyncDuration": 4,
|
|
760
|
+
"liveMaxLatencyDuration": 5,
|
|
761
|
+
"liveDurationInfinity": false,
|
|
762
|
+
"highBufferWatchdogPeriod": 1
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
|
|
752
766
|
return {
|
|
753
767
|
"enableWorker": true,
|
|
754
768
|
"lowLatencyMode": true,
|
|
@@ -13,17 +13,18 @@ const NotificationPath = ({network, path}) => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Push a notification to
|
|
16
|
+
* Push a notification to a user
|
|
17
17
|
*
|
|
18
18
|
* @methodGroup Notifications
|
|
19
19
|
* @param {string} tenantId - The tenant associated with this notification
|
|
20
20
|
* @param {string} eventType - The type of the notification
|
|
21
21
|
* @param {(Object | string)=} data - Data associated with this notification
|
|
22
|
+
* @param {string=} userAddress - Address of the user to notify. If not specified, it will be sent to the current user.
|
|
22
23
|
*/
|
|
23
|
-
exports.PushNotification = async function({tenantId, eventType, data}) {
|
|
24
|
+
exports.PushNotification = async function({tenantId, eventType, data, userAddress}) {
|
|
24
25
|
await this.stateStoreClient.Request({
|
|
25
26
|
method: "POST",
|
|
26
|
-
path: NotificationPath({network: this.network, path: UrlJoin("notify_user", this.UserAddress(), tenantId, eventType)}),
|
|
27
|
+
path: NotificationPath({network: this.network, path: UrlJoin("notify_user", userAddress || this.UserAddress(), tenantId, eventType)}),
|
|
27
28
|
body: data,
|
|
28
29
|
headers: {
|
|
29
30
|
Authorization: `Bearer ${this.AuthToken()}`
|