@eluvio/elv-client-js 4.0.104 → 4.0.107
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 +15 -14
- package/dist/ElvClient-node-min.js +14 -13
- package/dist/ElvFrameClient-min.js +10 -10
- package/dist/ElvPermissionsClient-min.js +9 -9
- package/dist/ElvWalletClient-min.js +15 -14
- package/dist/ElvWalletClient-node-min.js +14 -13
- package/dist/src/AuthorizationClient.js +9 -12
- package/dist/src/ContentObjectAudit.js +3 -3
- package/dist/src/ContentObjectVerification.js +3 -3
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +47 -28
- package/dist/src/ElvWallet.js +7 -5
- package/dist/src/EthClient.js +8 -9
- package/dist/src/FrameClient.js +8 -9
- package/dist/src/HttpClient.js +1 -2
- package/dist/src/Id.js +1 -2
- package/dist/src/PermissionsClient.js +31 -19
- package/dist/src/RemoteSigner.js +10 -11
- package/dist/src/UserProfileClient.js +194 -150
- package/dist/src/Utils.js +2 -3
- package/dist/src/abr_profiles/abr_profile_live_drm.js +22 -0
- package/dist/src/client/ABRPublishing.js +2 -2
- package/dist/src/client/AccessGroups.js +2 -2
- package/dist/src/client/ContentAccess.js +9 -6
- package/dist/src/client/ContentManagement.js +3 -3
- package/dist/src/client/Contracts.js +433 -108
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +60 -78
- package/dist/src/client/LiveStream.js +270 -158
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/walletClient/ClientMethods.js +2 -2
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +2 -2
- package/dist/src/walletClient/index.js +19 -16
- package/package.json +1 -1
- package/src/UserProfileClient.js +19 -20
- package/src/abr_profiles/abr_profile_live_drm.js +22 -0
- package/src/client/Contracts.js +244 -42
- package/src/client/LiveConf.js +86 -111
- package/src/client/LiveStream.js +141 -44
- package/testScripts/TestAddTenantContractId.js +45 -4
package/dist/src/client/Files.js
CHANGED
|
@@ -2,8 +2,8 @@ var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
|
|
|
2
2
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
3
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
4
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
/**
|
|
8
8
|
* Methods for accessing and managing access groups
|
|
9
9
|
*
|
|
@@ -1,58 +1,44 @@
|
|
|
1
1
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
2
2
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
3
3
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
6
|
-
var
|
|
7
|
-
"
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
var DefaultABRLadder = {
|
|
7
|
+
"video": [{
|
|
8
8
|
bit_rate: 14000000,
|
|
9
9
|
codecs: "avc1.640028,mp4a.40.2",
|
|
10
10
|
height: 2160,
|
|
11
|
-
media_type: 1,
|
|
12
|
-
representation: "videovideo_3840x2160_h264@14000000",
|
|
13
|
-
stream_name: "video",
|
|
14
11
|
width: 3840
|
|
15
|
-
},
|
|
16
|
-
"1080": {
|
|
12
|
+
}, {
|
|
17
13
|
bit_rate: 9500000,
|
|
18
14
|
codecs: "avc1.640028,mp4a.40.2",
|
|
19
15
|
height: 1080,
|
|
20
|
-
media_type: 1,
|
|
21
|
-
representation: "videovideo_1920x1080_h264@9500000",
|
|
22
|
-
stream_name: "video",
|
|
23
|
-
stream_index: 0,
|
|
24
16
|
width: 1920
|
|
25
|
-
},
|
|
26
|
-
"720": {
|
|
17
|
+
}, {
|
|
27
18
|
bit_rate: 4500000,
|
|
28
19
|
codecs: "avc1.640028,mp4a.40.2",
|
|
29
20
|
height: 720,
|
|
30
|
-
media_type: 1,
|
|
31
|
-
representation: "videovideo_1280x720_h264@4500000",
|
|
32
|
-
stream_name: "video",
|
|
33
|
-
stream_index: 0,
|
|
34
21
|
width: 1280
|
|
35
|
-
},
|
|
36
|
-
"540": {
|
|
22
|
+
}, {
|
|
37
23
|
bit_rate: 2000000,
|
|
38
24
|
codecs: "avc1.640028,mp4a.40.2",
|
|
39
25
|
height: 540,
|
|
40
|
-
media_type: 1,
|
|
41
|
-
representation: "videovideo_960x540_h264@2000000",
|
|
42
|
-
stream_name: "video",
|
|
43
|
-
stream_index: 0,
|
|
44
26
|
width: 960
|
|
45
|
-
},
|
|
46
|
-
"540_low": {
|
|
27
|
+
}, {
|
|
47
28
|
bit_rate: 900000,
|
|
48
29
|
codecs: "avc1.640028,mp4a.40.2",
|
|
49
30
|
height: 540,
|
|
50
|
-
media_type: 1,
|
|
51
|
-
representation: "videovideo_960x540_h264@900000",
|
|
52
|
-
stream_name: "video",
|
|
53
|
-
stream_index: 0,
|
|
54
31
|
width: 960
|
|
55
|
-
}
|
|
32
|
+
}],
|
|
33
|
+
"audio": [{
|
|
34
|
+
bit_rate: 192000,
|
|
35
|
+
channels: 2,
|
|
36
|
+
codecs: "mp4a.40.2"
|
|
37
|
+
}, {
|
|
38
|
+
bit_rate: 384000,
|
|
39
|
+
channels: 6,
|
|
40
|
+
codecs: "mp4a.40.2"
|
|
41
|
+
}]
|
|
56
42
|
};
|
|
57
43
|
var LiveconfTemplate = {
|
|
58
44
|
live_recording: {
|
|
@@ -109,15 +95,6 @@ var LiveconfTemplate = {
|
|
|
109
95
|
}
|
|
110
96
|
}
|
|
111
97
|
};
|
|
112
|
-
var LadderSpecAudio = {
|
|
113
|
-
bit_rate: 384000,
|
|
114
|
-
channels: 2,
|
|
115
|
-
codecs: "mp4a.40.2",
|
|
116
|
-
media_type: 2,
|
|
117
|
-
representation: "audioaudio_aac@384000",
|
|
118
|
-
stream_name: "audio",
|
|
119
|
-
stream_index: 0
|
|
120
|
-
};
|
|
121
98
|
var LiveConf = /*#__PURE__*/function () {
|
|
122
99
|
"use strict";
|
|
123
100
|
|
|
@@ -130,7 +107,7 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
130
107
|
this.overwriteOriginUrl = overwriteOriginUrl;
|
|
131
108
|
this.syncAudioToVideo = syncAudioToVideo;
|
|
132
109
|
}
|
|
133
|
-
_createClass(LiveConf, [{
|
|
110
|
+
return _createClass(LiveConf, [{
|
|
134
111
|
key: "probeKind",
|
|
135
112
|
value: function probeKind() {
|
|
136
113
|
var fileNameSplit = this.probeData.format.filename.split(":");
|
|
@@ -245,7 +222,6 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
245
222
|
} else {
|
|
246
223
|
seg.audio = 29.76 * 48000; // Other codecs are resampled @48000
|
|
247
224
|
}
|
|
248
|
-
|
|
249
225
|
return seg;
|
|
250
226
|
}
|
|
251
227
|
|
|
@@ -410,7 +386,7 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
410
386
|
value: function generateAudioStreamsConfig(_ref4) {
|
|
411
387
|
var customSettings = _ref4.customSettings;
|
|
412
388
|
var audioStreams = {};
|
|
413
|
-
if (customSettings && customSettings.audio) {
|
|
389
|
+
if (customSettings && customSettings.audio && Object.keys(customSettings.audio).length > 0) {
|
|
414
390
|
for (var i = 0; i < Object.keys(customSettings.audio).length; i++) {
|
|
415
391
|
var audioIdx = Object.keys(customSettings.audio)[i];
|
|
416
392
|
var audio = customSettings.audio[audioIdx];
|
|
@@ -425,7 +401,7 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
425
401
|
}
|
|
426
402
|
|
|
427
403
|
// If no audio streams specified in custom config, set up all the suitable audio streams in the probe
|
|
428
|
-
if (!customSettings.audio) {
|
|
404
|
+
if (!customSettings.audio || Object.keys(customSettings.audio).length == 0) {
|
|
429
405
|
audioStreams = this.getAudioStreamsFromProbe();
|
|
430
406
|
}
|
|
431
407
|
return audioStreams;
|
|
@@ -525,46 +501,53 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
525
501
|
if (segDurations.videoFrameDurationTs) {
|
|
526
502
|
conf.live_recording.recording_config.recording_params.xc_params.video_frame_duration_ts = segDurations.videoFrameDurationTs;
|
|
527
503
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 1280;
|
|
546
|
-
break;
|
|
547
|
-
case 540:
|
|
548
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(LadderTemplate[540], LadderTemplate["540_low"]);
|
|
549
|
-
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[540].bit_rate;
|
|
550
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 540;
|
|
551
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 960;
|
|
552
|
-
break;
|
|
553
|
-
default:
|
|
554
|
-
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]");
|
|
504
|
+
var ladderProfile = customSettings.ladder_profile || DefaultABRLadder;
|
|
505
|
+
conf.live_recording.recording_config.recording_params.xc_params.enc_height = videoStream.height;
|
|
506
|
+
conf.live_recording.recording_config.recording_params.xc_params.enc_width = videoStream.width;
|
|
507
|
+
|
|
508
|
+
// Determine video recording bitrate and ABR ladder
|
|
509
|
+
var topLadderRate = 0;
|
|
510
|
+
for (var _i = 0; _i < ladderProfile.video.length; _i++) {
|
|
511
|
+
var elem = ladderProfile.video[_i];
|
|
512
|
+
if (elem.height > videoStream.height) continue;
|
|
513
|
+
if (elem.bit_rate > topLadderRate) {
|
|
514
|
+
topLadderRate = elem.bit_rate;
|
|
515
|
+
}
|
|
516
|
+
elem.media_type = 1;
|
|
517
|
+
elem.stream_name = "video";
|
|
518
|
+
elem.stream_index = 0;
|
|
519
|
+
elem.representation = "videovideo_" + elem.width + "x" + elem.height + "_h264@" + elem.bit_rate;
|
|
520
|
+
conf.live_recording.recording_config.recording_params.ladder_specs.push(elem);
|
|
555
521
|
}
|
|
522
|
+
// Currently the recording bitrate is the top bitrate of the ladder (it will be configurable separately in the future)
|
|
523
|
+
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = topLadderRate;
|
|
524
|
+
|
|
525
|
+
// Determine audio recording bitrate and ABR ladder
|
|
556
526
|
var globalAudioBitrate = 0;
|
|
557
527
|
var nAudio = 0;
|
|
558
|
-
for (var
|
|
559
|
-
var audioLadderSpec =
|
|
560
|
-
var audioIndex = Object.keys(audioStreams)[
|
|
528
|
+
for (var _i2 = 0; _i2 < Object.keys(audioStreams).length; _i2++) {
|
|
529
|
+
var audioLadderSpec = {};
|
|
530
|
+
var audioIndex = Object.keys(audioStreams)[_i2];
|
|
561
531
|
var audio = audioStreams[audioIndex];
|
|
562
|
-
|
|
563
|
-
|
|
532
|
+
|
|
533
|
+
// Find ladder rung for the specific channel layout (2 or 6 channels)
|
|
534
|
+
for (var j = 0; j < ladderProfile.audio.length; j++) {
|
|
535
|
+
var _elem = ladderProfile.audio[j];
|
|
536
|
+
if (_elem.channels == audio.recordingChannels) {
|
|
537
|
+
audioLadderSpec = _objectSpread({}, _elem);
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
if (Object.keys(audioLadderSpec).length === 0) {
|
|
542
|
+
// If no channels layout match, just use the first element in the ladder
|
|
543
|
+
audioLadderSpec = _objectSpread({}, ladderProfile.audio[0]);
|
|
544
|
+
}
|
|
545
|
+
audioLadderSpec.representation = "audioaudio_aac@".concat(audioLadderSpec.bit_rate);
|
|
564
546
|
audioLadderSpec.channels = audio.recordingChannels;
|
|
565
547
|
audioLadderSpec.stream_index = parseInt(audioIndex);
|
|
566
548
|
audioLadderSpec.stream_name = "audio_".concat(audioIndex);
|
|
567
549
|
audioLadderSpec.stream_label = audio.playoutLabel ? audio.playoutLabel : null;
|
|
550
|
+
audioLadderSpec.media_type = 2;
|
|
568
551
|
conf.live_recording.recording_config.recording_params.ladder_specs.push(audioLadderSpec);
|
|
569
552
|
if (audio.recordingBitrate > globalAudioBitrate) {
|
|
570
553
|
globalAudioBitrate = audio.recordingBitrate;
|
|
@@ -578,6 +561,5 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
578
561
|
return conf;
|
|
579
562
|
}
|
|
580
563
|
}]);
|
|
581
|
-
return LiveConf;
|
|
582
564
|
}();
|
|
583
565
|
exports.LiveConf = LiveConf;
|