@eluvio/elv-client-js 4.0.104 → 4.0.105
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 +35 -19
- 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 +2 -2
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +60 -78
- package/dist/src/client/LiveStream.js +41 -22
- 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/abr_profiles/abr_profile_live_drm.js +22 -0
- package/src/client/LiveConf.js +86 -111
- package/src/client/LiveStream.js +19 -0
|
@@ -7,8 +7,8 @@ var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
|
7
7
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
8
8
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
9
9
|
var _excluded = ["code", "address", "type", "authToken", "expiresAt"];
|
|
10
|
-
function ownKeys(
|
|
11
|
-
function _objectSpread(
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
12
|
var _require = require("../ElvClient"),
|
|
13
13
|
ElvClient = _require.ElvClient;
|
|
14
14
|
var Configuration = require("./Configuration");
|
|
@@ -79,7 +79,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
79
79
|
this.utils = client.utils;
|
|
80
80
|
this.ForbiddenMethods = ElvWalletClient.ForbiddenMethods;
|
|
81
81
|
}
|
|
82
|
-
_createClass(ElvWalletClient, [{
|
|
82
|
+
return _createClass(ElvWalletClient, [{
|
|
83
83
|
key: "Log",
|
|
84
84
|
value: function Log(message) {
|
|
85
85
|
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -136,7 +136,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
136
136
|
*/
|
|
137
137
|
}, {
|
|
138
138
|
key: "PersonalSign",
|
|
139
|
-
value: function () {
|
|
139
|
+
value: (function () {
|
|
140
140
|
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
|
141
141
|
var message, parameters, url;
|
|
142
142
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -265,7 +265,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
265
265
|
return _PersonalSign.apply(this, arguments);
|
|
266
266
|
}
|
|
267
267
|
return PersonalSign;
|
|
268
|
-
}()
|
|
268
|
+
}())
|
|
269
269
|
}, {
|
|
270
270
|
key: "LogInURL",
|
|
271
271
|
value: function () {
|
|
@@ -344,7 +344,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
344
344
|
*/
|
|
345
345
|
}, {
|
|
346
346
|
key: "LogIn",
|
|
347
|
-
value: function () {
|
|
347
|
+
value: (function () {
|
|
348
348
|
var _LogIn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref5) {
|
|
349
349
|
var _this = this;
|
|
350
350
|
var _ref5$method, method, provider, _ref5$mode, mode, callbackUrl, marketplaceParams, _ref5$clearLogin, clearLogin, callback, loginUrl;
|
|
@@ -463,9 +463,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
463
463
|
*
|
|
464
464
|
* @methodGroup Login
|
|
465
465
|
*/
|
|
466
|
+
)
|
|
466
467
|
}, {
|
|
467
468
|
key: "LogOut",
|
|
468
|
-
value: function () {
|
|
469
|
+
value: (function () {
|
|
469
470
|
var _LogOut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
470
471
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
471
472
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -508,7 +509,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
508
509
|
return _LogOut.apply(this, arguments);
|
|
509
510
|
}
|
|
510
511
|
return LogOut;
|
|
511
|
-
}()
|
|
512
|
+
}())
|
|
512
513
|
}, {
|
|
513
514
|
key: "TokenStatus",
|
|
514
515
|
value: function () {
|
|
@@ -548,7 +549,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
548
549
|
*/
|
|
549
550
|
}, {
|
|
550
551
|
key: "Authenticate",
|
|
551
|
-
value: function () {
|
|
552
|
+
value: (function () {
|
|
552
553
|
var _Authenticate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref7) {
|
|
553
554
|
var token, decodedToken;
|
|
554
555
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
@@ -614,9 +615,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
614
615
|
* - signingToken - Identical to `authToken`, but also includes the ability to perform arbitrary signatures with the custodial wallet. This token should be protected and should not be
|
|
615
616
|
* shared with third parties.
|
|
616
617
|
*/
|
|
618
|
+
)
|
|
617
619
|
}, {
|
|
618
620
|
key: "AuthenticateOAuth",
|
|
619
|
-
value: function () {
|
|
621
|
+
value: (function () {
|
|
620
622
|
var _AuthenticateOAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref8) {
|
|
621
623
|
var idToken, tenantId, email, signerURIs, _ref8$shareEmail, shareEmail, _ref8$extraData, extraData, nonce, _ref8$createRemoteTok, createRemoteToken, _ref8$force, force, tokenDuration, fabricToken, expiresAt, tokenResponse, address, decodedToken;
|
|
622
624
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
@@ -653,6 +655,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
653
655
|
return this.client.signer.RetrieveCSAT({
|
|
654
656
|
email: email,
|
|
655
657
|
nonce: nonce,
|
|
658
|
+
tenantId: tenantId,
|
|
656
659
|
force: force
|
|
657
660
|
});
|
|
658
661
|
case 12:
|
|
@@ -743,9 +746,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
743
746
|
* @returns {Promise<string>} - Returns an authorization token that can be used to initialize the client using <a href="#Authenticate">Authenticate</a>.
|
|
744
747
|
* Save this token to avoid having to reauthenticate. This token expires after 24 hours.
|
|
745
748
|
*/
|
|
749
|
+
)
|
|
746
750
|
}, {
|
|
747
751
|
key: "AuthenticateExternalWallet",
|
|
748
|
-
value: function () {
|
|
752
|
+
value: (function () {
|
|
749
753
|
var _AuthenticateExternalWallet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref9) {
|
|
750
754
|
var _this2 = this;
|
|
751
755
|
var address, _ref9$tokenDuration, tokenDuration, _ref9$walletName, walletName, Sign, expiresAt, fabricToken;
|
|
@@ -814,6 +818,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
814
818
|
*
|
|
815
819
|
* @returns {string} - The client auth token
|
|
816
820
|
*/
|
|
821
|
+
)
|
|
817
822
|
}, {
|
|
818
823
|
key: "ClientAuthToken",
|
|
819
824
|
value: function ClientAuthToken() {
|
|
@@ -1114,8 +1119,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1114
1119
|
produceLinkUrls: true,
|
|
1115
1120
|
authorizationToken: this.publicStaticToken,
|
|
1116
1121
|
noAuth: true,
|
|
1117
|
-
select: ["info/marketplace_order", "tenants/*/.", "tenants/*/info/branding", "tenants/*/
|
|
1118
|
-
remove: ["tenants/*/info/branding/wallet_css", "tenants/*/marketplaces/*/info/branding/custom_css"]
|
|
1122
|
+
select: ["info/marketplace_order", "tenants/*/.", "tenants/*/info/branding/show", "tenants/*/info/branding/name", "tenants/*/marketplaces/*/.", "tenants/*/marketplaces/*/info/tenant_id", "tenants/*/marketplaces/*/info/tenant_name", "tenants/*/marketplaces/*/info/branding/show", "tenants/*/marketplaces/*/info/branding/name"]
|
|
1119
1123
|
});
|
|
1120
1124
|
case 5:
|
|
1121
1125
|
metadata = _context18.sent;
|
|
@@ -1978,7 +1982,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1978
1982
|
*/
|
|
1979
1983
|
}, {
|
|
1980
1984
|
key: "Initialize",
|
|
1981
|
-
value: function () {
|
|
1985
|
+
value: (function () {
|
|
1982
1986
|
var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref24) {
|
|
1983
1987
|
var client, _ref24$appId, appId, _ref24$network, network, _ref24$mode, mode, localization, marketplaceParams, previewMarketplaceId, _ref24$storeAuthToken, storeAuthToken, _ref24$skipMarketplac, skipMarketplaceLoad, _ref25, tenantSlug, marketplaceSlug, marketplaceId, marketplaceHash, previewMarketplaceHash, walletClient, url, savedToken;
|
|
1984
1988
|
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
@@ -2096,9 +2100,8 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
2096
2100
|
return _Initialize.apply(this, arguments);
|
|
2097
2101
|
}
|
|
2098
2102
|
return Initialize;
|
|
2099
|
-
}()
|
|
2103
|
+
}())
|
|
2100
2104
|
}]);
|
|
2101
|
-
return ElvWalletClient;
|
|
2102
2105
|
}();
|
|
2103
2106
|
Object.assign(ElvWalletClient.prototype, require("./ClientMethods"));
|
|
2104
2107
|
Object.assign(ElvWalletClient.prototype, require("./Profile"));
|
package/package.json
CHANGED
|
@@ -1863,6 +1863,28 @@ const AbrProfileLiveDrm = {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
},
|
|
1865
1865
|
"playout_formats": {
|
|
1866
|
+
"dash-playready-cenc": {
|
|
1867
|
+
"drm": {
|
|
1868
|
+
"enc_scheme_name": "cenc",
|
|
1869
|
+
"type": "DrmPlayReady"
|
|
1870
|
+
},
|
|
1871
|
+
"protocol": {
|
|
1872
|
+
"min_buffer_length": 2,
|
|
1873
|
+
"type": "ProtoDash"
|
|
1874
|
+
}
|
|
1875
|
+
},
|
|
1876
|
+
"dash-widevine": {
|
|
1877
|
+
"drm": {
|
|
1878
|
+
"content_id": "",
|
|
1879
|
+
"enc_scheme_name": "cenc",
|
|
1880
|
+
"license_servers": [],
|
|
1881
|
+
"type": "DrmWidevine"
|
|
1882
|
+
},
|
|
1883
|
+
"protocol": {
|
|
1884
|
+
"min_buffer_length": 2,
|
|
1885
|
+
"type": "ProtoDash"
|
|
1886
|
+
}
|
|
1887
|
+
},
|
|
1866
1888
|
"hls-fairplay": {
|
|
1867
1889
|
"drm": {
|
|
1868
1890
|
"enc_scheme_name": "cbcs",
|
package/src/client/LiveConf.js
CHANGED
|
@@ -1,53 +1,48 @@
|
|
|
1
|
-
const
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
representation: "videovideo_960x540_h264@900000",
|
|
47
|
-
stream_name: "video",
|
|
48
|
-
stream_index: 0,
|
|
49
|
-
width: 960
|
|
50
|
-
}
|
|
1
|
+
const DefaultABRLadder = {
|
|
2
|
+
"video" : [
|
|
3
|
+
{
|
|
4
|
+
bit_rate: 14000000,
|
|
5
|
+
codecs: "avc1.640028,mp4a.40.2",
|
|
6
|
+
height: 2160,
|
|
7
|
+
width: 3840
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
bit_rate: 9500000,
|
|
11
|
+
codecs: "avc1.640028,mp4a.40.2",
|
|
12
|
+
height: 1080,
|
|
13
|
+
width: 1920
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
bit_rate: 4500000,
|
|
17
|
+
codecs: "avc1.640028,mp4a.40.2",
|
|
18
|
+
height: 720,
|
|
19
|
+
width: 1280
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
bit_rate: 2000000,
|
|
23
|
+
codecs: "avc1.640028,mp4a.40.2",
|
|
24
|
+
height: 540,
|
|
25
|
+
width: 960
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
bit_rate: 900000,
|
|
29
|
+
codecs: "avc1.640028,mp4a.40.2",
|
|
30
|
+
height: 540,
|
|
31
|
+
width: 960
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"audio" : [
|
|
35
|
+
{
|
|
36
|
+
bit_rate: 192000,
|
|
37
|
+
channels: 2,
|
|
38
|
+
codecs: "mp4a.40.2",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
bit_rate: 384000,
|
|
42
|
+
channels: 6,
|
|
43
|
+
codecs: "mp4a.40.2",
|
|
44
|
+
}
|
|
45
|
+
]
|
|
51
46
|
};
|
|
52
47
|
|
|
53
48
|
const LiveconfTemplate = {
|
|
@@ -115,16 +110,6 @@ const LiveconfTemplate = {
|
|
|
115
110
|
}
|
|
116
111
|
};
|
|
117
112
|
|
|
118
|
-
const LadderSpecAudio = {
|
|
119
|
-
bit_rate: 384000,
|
|
120
|
-
channels: 2,
|
|
121
|
-
codecs: "mp4a.40.2",
|
|
122
|
-
media_type: 2,
|
|
123
|
-
representation: "audioaudio_aac@384000",
|
|
124
|
-
stream_name: "audio",
|
|
125
|
-
stream_index: 0
|
|
126
|
-
};
|
|
127
|
-
|
|
128
113
|
class LiveConf {
|
|
129
114
|
constructor(probeData, nodeId, nodeUrl, includeAVSegDurations, overwriteOriginUrl, syncAudioToVideo) {
|
|
130
115
|
this.probeData = probeData;
|
|
@@ -390,7 +375,7 @@ class LiveConf {
|
|
|
390
375
|
generateAudioStreamsConfig({customSettings}) {
|
|
391
376
|
|
|
392
377
|
let audioStreams = {};
|
|
393
|
-
if(customSettings && customSettings.audio) {
|
|
378
|
+
if(customSettings && customSettings.audio && Object.keys(customSettings.audio).length > 0) {
|
|
394
379
|
for(let i = 0; i < Object.keys(customSettings.audio).length; i ++) {
|
|
395
380
|
let audioIdx = Object.keys(customSettings.audio)[i];
|
|
396
381
|
let audio = customSettings.audio[audioIdx];
|
|
@@ -405,7 +390,7 @@ class LiveConf {
|
|
|
405
390
|
}
|
|
406
391
|
|
|
407
392
|
// If no audio streams specified in custom config, set up all the suitable audio streams in the probe
|
|
408
|
-
if(!customSettings.audio) {
|
|
393
|
+
if(!customSettings.audio || Object.keys(customSettings.audio).length == 0) {
|
|
409
394
|
audioStreams = this.getAudioStreamsFromProbe();
|
|
410
395
|
}
|
|
411
396
|
|
|
@@ -506,68 +491,57 @@ class LiveConf {
|
|
|
506
491
|
conf.live_recording.recording_config.recording_params.xc_params.video_frame_duration_ts = segDurations.videoFrameDurationTs;
|
|
507
492
|
}
|
|
508
493
|
|
|
509
|
-
|
|
510
|
-
case 2160:
|
|
511
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(
|
|
512
|
-
LadderTemplate[2160],
|
|
513
|
-
LadderTemplate[1080],
|
|
514
|
-
LadderTemplate[720],
|
|
515
|
-
LadderTemplate[540],
|
|
516
|
-
LadderTemplate["540_low"]
|
|
517
|
-
);
|
|
518
|
-
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[2160].bit_rate;
|
|
519
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 2160;
|
|
520
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 3840;
|
|
494
|
+
const ladderProfile = customSettings.ladder_profile || DefaultABRLadder;
|
|
521
495
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(
|
|
525
|
-
LadderTemplate[1080],
|
|
526
|
-
LadderTemplate[720],
|
|
527
|
-
LadderTemplate[540],
|
|
528
|
-
LadderTemplate["540_low"]
|
|
529
|
-
);
|
|
530
|
-
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[1080].bit_rate;
|
|
531
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 1080;
|
|
532
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 1920;
|
|
533
|
-
break;
|
|
534
|
-
case 720:
|
|
535
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(
|
|
536
|
-
LadderTemplate[720],
|
|
537
|
-
LadderTemplate[540],
|
|
538
|
-
LadderTemplate["540_low"]
|
|
539
|
-
);
|
|
540
|
-
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = LadderTemplate[720].bit_rate;
|
|
541
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_height = 720;
|
|
542
|
-
conf.live_recording.recording_config.recording_params.xc_params.enc_width = 1280;
|
|
543
|
-
break;
|
|
544
|
-
case 540:
|
|
545
|
-
conf.live_recording.recording_config.recording_params.ladder_specs.unshift(
|
|
546
|
-
LadderTemplate[540],
|
|
547
|
-
LadderTemplate["540_low"]
|
|
548
|
-
);
|
|
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]");
|
|
555
|
-
}
|
|
496
|
+
conf.live_recording.recording_config.recording_params.xc_params.enc_height = videoStream.height;
|
|
497
|
+
conf.live_recording.recording_config.recording_params.xc_params.enc_width = videoStream.width;
|
|
556
498
|
|
|
499
|
+
// Determine video recording bitrate and ABR ladder
|
|
500
|
+
let topLadderRate = 0
|
|
501
|
+
for (let i = 0; i < ladderProfile.video.length; i ++) {
|
|
502
|
+
let elem = ladderProfile.video[i];
|
|
503
|
+
if (elem.height > videoStream.height)
|
|
504
|
+
continue;
|
|
505
|
+
if (elem.bit_rate > topLadderRate) {
|
|
506
|
+
topLadderRate = elem.bit_rate
|
|
507
|
+
}
|
|
508
|
+
elem.media_type = 1;
|
|
509
|
+
elem.stream_name = "video";
|
|
510
|
+
elem.stream_index = 0;
|
|
511
|
+
elem.representation = "videovideo_" + videoStream.width + "x" + videoStream.height + "_h264@" + elem.bit_rate;
|
|
512
|
+
conf.live_recording.recording_config.recording_params.ladder_specs.push(elem);
|
|
513
|
+
}
|
|
514
|
+
// Currently the recording bitrate is the top bitrate of the ladder (it will be configurable separately in the future)
|
|
515
|
+
conf.live_recording.recording_config.recording_params.xc_params.video_bitrate = topLadderRate;
|
|
557
516
|
|
|
517
|
+
// Determine audio recording bitrate and ABR ladder
|
|
558
518
|
let globalAudioBitrate = 0;
|
|
559
519
|
let nAudio = 0;
|
|
560
520
|
|
|
561
521
|
for(let i = 0; i < Object.keys(audioStreams).length; i ++ ) {
|
|
562
|
-
let audioLadderSpec = {
|
|
522
|
+
let audioLadderSpec = {};
|
|
563
523
|
const audioIndex = Object.keys(audioStreams)[i];
|
|
564
524
|
const audio = audioStreams[audioIndex];
|
|
565
|
-
|
|
566
|
-
|
|
525
|
+
|
|
526
|
+
// Find ladder rung for the specific channel layout (2 or 6 channels)
|
|
527
|
+
for (let j = 0; j < ladderProfile.audio.length; j ++) {
|
|
528
|
+
let elem = ladderProfile.audio[j];
|
|
529
|
+
if (elem.channels == audio.recordingChannels) {
|
|
530
|
+
audioLadderSpec = {...elem};
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if (Object.keys(audioLadderSpec).length === 0) {
|
|
535
|
+
// If no channels layout match, just use the first element in the ladder
|
|
536
|
+
audioLadderSpec = {...ladderProfile.audio[0]};
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
audioLadderSpec.representation = `audioaudio_aac@${audioLadderSpec.bit_rate}`;
|
|
567
540
|
audioLadderSpec.channels = audio.recordingChannels;
|
|
568
541
|
audioLadderSpec.stream_index = parseInt(audioIndex);
|
|
569
542
|
audioLadderSpec.stream_name = `audio_${audioIndex}`;
|
|
570
543
|
audioLadderSpec.stream_label = audio.playoutLabel ? audio.playoutLabel : null;
|
|
544
|
+
audioLadderSpec.media_type = 2;
|
|
571
545
|
|
|
572
546
|
conf.live_recording.recording_config.recording_params.ladder_specs.push(audioLadderSpec);
|
|
573
547
|
if(audio.recordingBitrate > globalAudioBitrate) {
|
|
@@ -583,4 +557,5 @@ class LiveConf {
|
|
|
583
557
|
return conf;
|
|
584
558
|
}
|
|
585
559
|
}
|
|
560
|
+
|
|
586
561
|
exports.LiveConf = LiveConf;
|
package/src/client/LiveStream.js
CHANGED
|
@@ -1030,6 +1030,18 @@ exports.StreamSetOfferingAndDRM = async function({name, typeAbrMaster, typeLiveS
|
|
|
1030
1030
|
};
|
|
1031
1031
|
continue;
|
|
1032
1032
|
}
|
|
1033
|
+
if(formats[i] === "dash-clear") {
|
|
1034
|
+
abrProfile.drm_optional = true;
|
|
1035
|
+
playoutFormats["dash-clear"] = {
|
|
1036
|
+
"drm": null,
|
|
1037
|
+
"protocol": {
|
|
1038
|
+
"min_buffer_length": 2,
|
|
1039
|
+
"type": "ProtoDash"
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
continue;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1033
1045
|
playoutFormats[formats[i]] = abrProfile.playout_formats[formats[i]];
|
|
1034
1046
|
}
|
|
1035
1047
|
} else if(!drm) {
|
|
@@ -1040,6 +1052,13 @@ exports.StreamSetOfferingAndDRM = async function({name, typeAbrMaster, typeLiveS
|
|
|
1040
1052
|
"protocol": {
|
|
1041
1053
|
"type": "ProtoHls"
|
|
1042
1054
|
}
|
|
1055
|
+
},
|
|
1056
|
+
"dash-clear": {
|
|
1057
|
+
"drm": null,
|
|
1058
|
+
"protocol": {
|
|
1059
|
+
"min_buffer_length": 2,
|
|
1060
|
+
"type": "ProtoDash"
|
|
1061
|
+
}
|
|
1043
1062
|
}
|
|
1044
1063
|
};
|
|
1045
1064
|
} else {
|