@eluvio/elv-client-js 4.0.88 → 4.0.89

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.88",
3
+ "version": "4.0.89",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -1210,20 +1210,29 @@ exports.AvailableDRMs = async function() {
1210
1210
  return availableDRMs;
1211
1211
  }
1212
1212
 
1213
- try {
1214
- const config = [{
1215
- initDataTypes: ["cenc"],
1216
- audioCapabilities: [{
1217
- contentType: "audio/mp4;codecs=\"mp4a.40.2\""
1218
- }],
1219
- videoCapabilities: [{
1220
- contentType: "video/mp4;codecs=\"avc1.42E01E\""
1221
- }]
1222
- }];
1213
+ const config = [{
1214
+ initDataTypes: ["cenc"],
1215
+ audioCapabilities: [{
1216
+ contentType: "audio/mp4;codecs=\"mp4a.40.2\""
1217
+ }],
1218
+ videoCapabilities: [{
1219
+ contentType: "video/mp4;codecs=\"avc1.42E01E\""
1220
+ }]
1221
+ }];
1223
1222
 
1223
+ try {
1224
1224
  await navigator.requestMediaKeySystemAccess("com.widevine.alpha", config);
1225
-
1226
1225
  availableDRMs.push("widevine");
1226
+ // console.log("widevine detected");
1227
+ // eslint-disable-next-line no-empty
1228
+ } catch(e) {}
1229
+
1230
+ try {
1231
+ // unused parameters:
1232
+ // robustness: "2000" // 150, 2000, or 3000 if we know the secruity level
1233
+ await navigator.requestMediaKeySystemAccess("com.microsoft.playready", config);
1234
+ availableDRMs.push("playready");
1235
+ // console.log("playready detected");
1227
1236
  // eslint-disable-next-line no-empty
1228
1237
  } catch(e) {}
1229
1238
 
@@ -1407,7 +1416,7 @@ exports.AvailableOfferings = async function({
1407
1416
  * @param {string=} linkPath - If playing from a link, the path to the link
1408
1417
  * @param {boolean=} signedLink - Specify if linkPath is referring to a signed link
1409
1418
  * @param {Array<string>} protocols=["dash","hls"]] - Acceptable playout protocols ("dash", "hls")
1410
- * @param {Array<string>} drms - Acceptable DRM formats ("clear", "aes-128", "widevine")
1419
+ * @param {Array<string>} drms - Acceptable DRM formats ("aes-128", "clear", "fairplay", "playready", "sample-aes", "widevine")
1411
1420
  * @param {string=} handler=playout - The handler to use for playout (not used with links)
1412
1421
  * @param {string=} offering=default - The offering to play
1413
1422
  * @param {string=} playoutType - The type of playout
@@ -1675,7 +1684,7 @@ exports.PlayoutOptions = async function({
1675
1684
  * @param {string=} linkPath - If playing from a link, the path to the link
1676
1685
  * @param {boolean=} signedLink - Specify if linkPath is referring to a signed link
1677
1686
  * @param {Array<string>} protocols=["dash","hls"]] - Acceptable playout protocols ("dash", "hls")
1678
- * @param {Array<string>} drms - Acceptable DRM formats ("clear", "aes-128", "sample-aes", "widevine")
1687
+ * @param {Array<string>} drms - Acceptable DRM formats ("aes-128", "clear", "fairplay", "playready", "sample-aes", "widevine")
1679
1688
  * @param {string=} handler=playout - The handler to use for playout
1680
1689
  * @param {string=} offering=default - The offering to play
1681
1690
  * @param {string=} playoutType - The type of playout
@@ -301,7 +301,6 @@ class LiveConf {
301
301
  break;
302
302
  default:
303
303
  throw "unsupported frame rate for MPEGTS - " + frameRate;
304
- break;
305
304
  }
306
305
  return seg;
307
306
  }
@@ -362,7 +361,6 @@ class LiveConf {
362
361
  break;
363
362
  default:
364
363
  throw "unsupported frame rate for RTMP - " + frameRate;
365
- break;
366
364
  }
367
365
  return seg;
368
366
  }
@@ -498,8 +498,8 @@ exports.StreamStatus = async function({name, stopLro=false, showParams=false}) {
498
498
  state = lroStatus.state;
499
499
  status.warnings = lroStatus.custom && lroStatus.custom.warnings;
500
500
  status.quality = lroStatus.custom && lroStatus.custom.quality;
501
- if (lroStatus.custom && lroStatus.custom.status) {
502
- status.recording_status = lroStatus.custom.status
501
+ if(lroStatus.custom && lroStatus.custom.status) {
502
+ status.recording_status = lroStatus.custom.status;
503
503
  }
504
504
  } catch(error) {
505
505
  console.log("LRO Status (failed): ", error.response.statusCode);
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-console */
2
2
 
3
- // Ensures that an existing offering has only strong DRM playout options (Widevine and Fairplay)
3
+ // Ensures that an existing offering has only strong DRM playout options (FairPlay, PlayReady, and Widevine)
4
4
 
5
5
  const ScriptOffering = require("./parentClasses/ScriptOffering");
6
6
 
@@ -49,7 +49,7 @@ class OfferingEnsureStrongDrm extends ScriptOffering {
49
49
  for(let i = 0; i < originalFormatCount; i++) {
50
50
  const key = playoutFormatKeys[i];
51
51
  const drm = metadata.offerings[offeringKey].playout.playout_formats[key].drm;
52
- if(!drm || !["DrmWidevine", "DrmFairplay"].includes(drm.type)) {
52
+ if(!drm || !["DrmWidevine", "DrmFairplay", "DrmPlayReady"].includes(drm.type)) {
53
53
  console.log("Deleting playout format '" + key + "'...");
54
54
  delete metadata.offerings[offeringKey].playout.playout_formats[key];
55
55
  changesMade = true;
@@ -9,6 +9,9 @@ const Test = async () => {
9
9
  const client = await ElvClient.FromNetworkName({
10
10
  networkName: "demo"
11
11
  });
12
+ // const client = await ElvClient.FromConfigurationUrl({
13
+ // configUrl: "http://localhost:8008/config?qspace=demov3&self"
14
+ // });
12
15
 
13
16
  const wallet = client.GenerateWallet();
14
17
  const signer = wallet.AddAccount({
@@ -126,6 +126,24 @@
126
126
  "protocol": {
127
127
  "type": "ProtoHls"
128
128
  }
129
+ },
130
+ "hls-fairplay": {
131
+ "drm": {
132
+ "enc_scheme_name": "cbcs",
133
+ "type": "DrmFairplay"
134
+ },
135
+ "protocol": {
136
+ "type": "ProtoHls"
137
+ }
138
+ },
139
+ "hls-playready-cenc": {
140
+ "drm": {
141
+ "enc_scheme_name": "cenc",
142
+ "type": "DrmPlayReady"
143
+ },
144
+ "protocol": {
145
+ "type": "ProtoHls"
146
+ }
129
147
  }
130
148
  },
131
149
  "segment_specs": {
@@ -123,6 +123,15 @@
123
123
  "protocol": {
124
124
  "type": "ProtoHls"
125
125
  }
126
+ },
127
+ "hls-playready-cenc": {
128
+ "drm": {
129
+ "enc_scheme_name": "cenc",
130
+ "type": "DrmPlayReady"
131
+ },
132
+ "protocol": {
133
+ "type": "ProtoHls"
134
+ }
126
135
  }
127
136
  },
128
137
  "segment_specs": {
@@ -113,6 +113,24 @@
113
113
  "protocol": {
114
114
  "type": "ProtoHls"
115
115
  }
116
+ },
117
+ "hls-fairplay": {
118
+ "drm": {
119
+ "enc_scheme_name": "cbcs",
120
+ "type": "DrmFairplay"
121
+ },
122
+ "protocol": {
123
+ "type": "ProtoHls"
124
+ }
125
+ },
126
+ "hls-playready-cenc": {
127
+ "drm": {
128
+ "enc_scheme_name": "cenc",
129
+ "type": "DrmPlayReady"
130
+ },
131
+ "protocol": {
132
+ "type": "ProtoHls"
133
+ }
116
134
  }
117
135
  },
118
136
  "segment_specs": {
@@ -1960,6 +1960,24 @@
1960
1960
  "protocol": {
1961
1961
  "type": "ProtoHls"
1962
1962
  }
1963
+ },
1964
+ "hls-fairplay": {
1965
+ "drm": {
1966
+ "enc_scheme_name": "cbcs",
1967
+ "type": "DrmFairplay"
1968
+ },
1969
+ "protocol": {
1970
+ "type": "ProtoHls"
1971
+ }
1972
+ },
1973
+ "hls-playready-cenc": {
1974
+ "drm": {
1975
+ "enc_scheme_name": "cenc",
1976
+ "type": "DrmPlayReady"
1977
+ },
1978
+ "protocol": {
1979
+ "type": "ProtoHls"
1980
+ }
1963
1981
  }
1964
1982
  },
1965
1983
  "segment_specs": {
@@ -1957,6 +1957,15 @@
1957
1957
  "protocol": {
1958
1958
  "type": "ProtoHls"
1959
1959
  }
1960
+ },
1961
+ "hls-playready-cenc": {
1962
+ "drm": {
1963
+ "enc_scheme_name": "cenc",
1964
+ "type": "DrmPlayReady"
1965
+ },
1966
+ "protocol": {
1967
+ "type": "ProtoHls"
1968
+ }
1960
1969
  }
1961
1970
  },
1962
1971
  "segment_specs": {
@@ -1947,6 +1947,24 @@
1947
1947
  "protocol": {
1948
1948
  "type": "ProtoHls"
1949
1949
  }
1950
+ },
1951
+ "hls-fairplay": {
1952
+ "drm": {
1953
+ "enc_scheme_name": "cbcs",
1954
+ "type": "DrmFairplay"
1955
+ },
1956
+ "protocol": {
1957
+ "type": "ProtoHls"
1958
+ }
1959
+ },
1960
+ "hls-playready-cenc": {
1961
+ "drm": {
1962
+ "enc_scheme_name": "cenc",
1963
+ "type": "DrmPlayReady"
1964
+ },
1965
+ "protocol": {
1966
+ "type": "ProtoHls"
1967
+ }
1950
1968
  }
1951
1969
  },
1952
1970
  "segment_specs": {
@@ -126,6 +126,24 @@
126
126
  "protocol": {
127
127
  "type": "ProtoHls"
128
128
  }
129
+ },
130
+ "hls-fairplay": {
131
+ "drm": {
132
+ "enc_scheme_name": "cbcs",
133
+ "type": "DrmFairplay"
134
+ },
135
+ "protocol": {
136
+ "type": "ProtoHls"
137
+ }
138
+ },
139
+ "hls-playready-cenc": {
140
+ "drm": {
141
+ "enc_scheme_name": "cenc",
142
+ "type": "DrmPlayReady"
143
+ },
144
+ "protocol": {
145
+ "type": "ProtoHls"
146
+ }
129
147
  }
130
148
  },
131
149
  "segment_specs": {
@@ -123,6 +123,15 @@
123
123
  "protocol": {
124
124
  "type": "ProtoHls"
125
125
  }
126
+ },
127
+ "hls-playready-cenc": {
128
+ "drm": {
129
+ "enc_scheme_name": "cenc",
130
+ "type": "DrmPlayReady"
131
+ },
132
+ "protocol": {
133
+ "type": "ProtoHls"
134
+ }
126
135
  }
127
136
  },
128
137
  "segment_specs": {
@@ -113,6 +113,24 @@
113
113
  "protocol": {
114
114
  "type": "ProtoHls"
115
115
  }
116
+ },
117
+ "hls-fairplay": {
118
+ "drm": {
119
+ "enc_scheme_name": "cbcs",
120
+ "type": "DrmFairplay"
121
+ },
122
+ "protocol": {
123
+ "type": "ProtoHls"
124
+ }
125
+ },
126
+ "hls-playready-cenc": {
127
+ "drm": {
128
+ "enc_scheme_name": "cenc",
129
+ "type": "DrmPlayReady"
130
+ },
131
+ "protocol": {
132
+ "type": "ProtoHls"
133
+ }
116
134
  }
117
135
  },
118
136
  "segment_specs": {
@@ -105,6 +105,15 @@
105
105
  "protocol": {
106
106
  "type": "ProtoHls"
107
107
  }
108
+ },
109
+ "hls-playready-cenc": {
110
+ "drm": {
111
+ "enc_scheme_name": "cenc",
112
+ "type": "DrmPlayReady"
113
+ },
114
+ "protocol": {
115
+ "type": "ProtoHls"
116
+ }
108
117
  }
109
118
  },
110
119
  "segment_specs": {
@@ -1914,6 +1914,24 @@
1914
1914
  "protocol": {
1915
1915
  "type": "ProtoHls"
1916
1916
  }
1917
+ },
1918
+ "hls-fairplay": {
1919
+ "drm": {
1920
+ "enc_scheme_name": "cbcs",
1921
+ "type": "DrmFairplay"
1922
+ },
1923
+ "protocol": {
1924
+ "type": "ProtoHls"
1925
+ }
1926
+ },
1927
+ "hls-playready-cenc": {
1928
+ "drm": {
1929
+ "enc_scheme_name": "cenc",
1930
+ "type": "DrmPlayReady"
1931
+ },
1932
+ "protocol": {
1933
+ "type": "ProtoHls"
1934
+ }
1917
1935
  }
1918
1936
  },
1919
1937
  "segment_specs": {
@@ -1911,6 +1911,15 @@
1911
1911
  "protocol": {
1912
1912
  "type": "ProtoHls"
1913
1913
  }
1914
+ },
1915
+ "hls-playready-cenc": {
1916
+ "drm": {
1917
+ "enc_scheme_name": "cenc",
1918
+ "type": "DrmPlayReady"
1919
+ },
1920
+ "protocol": {
1921
+ "type": "ProtoHls"
1922
+ }
1914
1923
  }
1915
1924
  },
1916
1925
  "segment_specs": {
@@ -1899,6 +1899,15 @@
1899
1899
  "protocol": {
1900
1900
  "type": "ProtoHls"
1901
1901
  }
1902
+ },
1903
+ "hls-playready-cenc": {
1904
+ "drm": {
1905
+ "enc_scheme_name": "cenc",
1906
+ "type": "DrmPlayReady"
1907
+ },
1908
+ "protocol": {
1909
+ "type": "ProtoHls"
1910
+ }
1902
1911
  }
1903
1912
  },
1904
1913
  "segment_specs": {
@@ -1901,6 +1901,24 @@
1901
1901
  "protocol": {
1902
1902
  "type": "ProtoHls"
1903
1903
  }
1904
+ },
1905
+ "hls-fairplay": {
1906
+ "drm": {
1907
+ "enc_scheme_name": "cbcs",
1908
+ "type": "DrmFairplay"
1909
+ },
1910
+ "protocol": {
1911
+ "type": "ProtoHls"
1912
+ }
1913
+ },
1914
+ "hls-playready-cenc": {
1915
+ "drm": {
1916
+ "enc_scheme_name": "cenc",
1917
+ "type": "DrmPlayReady"
1918
+ },
1919
+ "protocol": {
1920
+ "type": "ProtoHls"
1921
+ }
1904
1922
  }
1905
1923
  },
1906
1924
  "segment_specs": {
@@ -154,6 +154,15 @@
154
154
  "protocol": {
155
155
  "type": "ProtoHls"
156
156
  }
157
+ },
158
+ "hls-playready-cenc": {
159
+ "drm": {
160
+ "enc_scheme_name": "cenc",
161
+ "type": "DrmPlayReady"
162
+ },
163
+ "protocol": {
164
+ "type": "ProtoHls"
165
+ }
157
166
  }
158
167
  },
159
168
  "segment_specs": {