@whereby.com/media 9.7.2 → 9.7.4

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/index.cjs CHANGED
@@ -7401,8 +7401,12 @@ function getInitialStream(constraintOpt) {
7401
7401
  }
7402
7402
  catch (e) {
7403
7403
  logger.error(e);
7404
+ lastError = e;
7404
7405
  }
7405
7406
  }
7407
+ if ((lastError === null || lastError === void 0 ? void 0 : lastError.name) === "NotAllowedError") {
7408
+ return;
7409
+ }
7406
7410
  try {
7407
7411
  retryOpts.options.lax = true;
7408
7412
  stream = yield attempt(getConstraints(retryOpts));
@@ -7508,8 +7512,11 @@ function getStream(constraintOpt_1) {
7508
7512
  if (!stream) {
7509
7513
  const tryOnly = problemWith ? [problemWith] : ["videoId", "audioId"];
7510
7514
  for (const kind of tryOnly) {
7515
+ const withoutKind = getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false }));
7516
+ if (!withoutKind.audio && !withoutKind.video)
7517
+ continue;
7511
7518
  try {
7512
- stream = yield attempt(getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false })));
7519
+ stream = yield attempt(withoutKind);
7513
7520
  }
7514
7521
  catch (e2) {
7515
7522
  logger.warn(`Re-tried without ${kind}, but failed: ${"" + e2}`);
package/dist/index.mjs CHANGED
@@ -7381,8 +7381,12 @@ function getInitialStream(constraintOpt) {
7381
7381
  }
7382
7382
  catch (e) {
7383
7383
  logger.error(e);
7384
+ lastError = e;
7384
7385
  }
7385
7386
  }
7387
+ if ((lastError === null || lastError === void 0 ? void 0 : lastError.name) === "NotAllowedError") {
7388
+ return;
7389
+ }
7386
7390
  try {
7387
7391
  retryOpts.options.lax = true;
7388
7392
  stream = yield attempt(getConstraints(retryOpts));
@@ -7488,8 +7492,11 @@ function getStream(constraintOpt_1) {
7488
7492
  if (!stream) {
7489
7493
  const tryOnly = problemWith ? [problemWith] : ["videoId", "audioId"];
7490
7494
  for (const kind of tryOnly) {
7495
+ const withoutKind = getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false }));
7496
+ if (!withoutKind.audio && !withoutKind.video)
7497
+ continue;
7491
7498
  try {
7492
- stream = yield attempt(getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false })));
7499
+ stream = yield attempt(withoutKind);
7493
7500
  }
7494
7501
  catch (e2) {
7495
7502
  logger.warn(`Re-tried without ${kind}, but failed: ${"" + e2}`);
@@ -7381,8 +7381,12 @@ function getInitialStream(constraintOpt) {
7381
7381
  }
7382
7382
  catch (e) {
7383
7383
  logger.error(e);
7384
+ lastError = e;
7384
7385
  }
7385
7386
  }
7387
+ if ((lastError === null || lastError === void 0 ? void 0 : lastError.name) === "NotAllowedError") {
7388
+ return;
7389
+ }
7386
7390
  try {
7387
7391
  retryOpts.options.lax = true;
7388
7392
  stream = yield attempt(getConstraints(retryOpts));
@@ -7488,8 +7492,11 @@ function getStream(constraintOpt_1) {
7488
7492
  if (!stream) {
7489
7493
  const tryOnly = problemWith ? [problemWith] : ["videoId", "audioId"];
7490
7494
  for (const kind of tryOnly) {
7495
+ const withoutKind = getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false }));
7496
+ if (!withoutKind.audio && !withoutKind.video)
7497
+ continue;
7491
7498
  try {
7492
- stream = yield attempt(getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false })));
7499
+ stream = yield attempt(withoutKind);
7493
7500
  }
7494
7501
  catch (e2) {
7495
7502
  logger.warn(`Re-tried without ${kind}, but failed: ${"" + e2}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whereby.com/media",
3
3
  "description": "Media library for Whereby",
4
- "version": "9.7.2",
4
+ "version": "9.7.4",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {