@whereby.com/media 9.7.1 → 9.7.3

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
@@ -7508,8 +7508,11 @@ function getStream(constraintOpt_1) {
7508
7508
  if (!stream) {
7509
7509
  const tryOnly = problemWith ? [problemWith] : ["videoId", "audioId"];
7510
7510
  for (const kind of tryOnly) {
7511
+ const withoutKind = getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false }));
7512
+ if (!withoutKind.audio && !withoutKind.video)
7513
+ continue;
7511
7514
  try {
7512
- stream = yield attempt(getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false })));
7515
+ stream = yield attempt(withoutKind);
7513
7516
  }
7514
7517
  catch (e2) {
7515
7518
  logger.warn(`Re-tried without ${kind}, but failed: ${"" + e2}`);
@@ -7524,7 +7527,7 @@ function getStream(constraintOpt_1) {
7524
7527
  yield getSingleStream();
7525
7528
  }
7526
7529
  }
7527
- if (retryConstraintOpt) {
7530
+ if (!stream && retryConstraintOpt) {
7528
7531
  const onlyConstraints = only ? { audio: { videoId: false }, video: { audioId: false } }[only] : {};
7529
7532
  const retryConstraints = getConstraints(Object.assign(Object.assign(Object.assign(Object.assign({}, constraintOpt), retryConstraintOpt), { options: Object.assign(Object.assign({}, constraintOpt.options), { lax: retryConstraintOpt.lax }) }), onlyConstraints));
7530
7533
  try {
package/dist/index.mjs CHANGED
@@ -7488,8 +7488,11 @@ function getStream(constraintOpt_1) {
7488
7488
  if (!stream) {
7489
7489
  const tryOnly = problemWith ? [problemWith] : ["videoId", "audioId"];
7490
7490
  for (const kind of tryOnly) {
7491
+ const withoutKind = getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false }));
7492
+ if (!withoutKind.audio && !withoutKind.video)
7493
+ continue;
7491
7494
  try {
7492
- stream = yield attempt(getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false })));
7495
+ stream = yield attempt(withoutKind);
7493
7496
  }
7494
7497
  catch (e2) {
7495
7498
  logger.warn(`Re-tried without ${kind}, but failed: ${"" + e2}`);
@@ -7504,7 +7507,7 @@ function getStream(constraintOpt_1) {
7504
7507
  yield getSingleStream();
7505
7508
  }
7506
7509
  }
7507
- if (retryConstraintOpt) {
7510
+ if (!stream && retryConstraintOpt) {
7508
7511
  const onlyConstraints = only ? { audio: { videoId: false }, video: { audioId: false } }[only] : {};
7509
7512
  const retryConstraints = getConstraints(Object.assign(Object.assign(Object.assign(Object.assign({}, constraintOpt), retryConstraintOpt), { options: Object.assign(Object.assign({}, constraintOpt.options), { lax: retryConstraintOpt.lax }) }), onlyConstraints));
7510
7513
  try {
@@ -7488,8 +7488,11 @@ function getStream(constraintOpt_1) {
7488
7488
  if (!stream) {
7489
7489
  const tryOnly = problemWith ? [problemWith] : ["videoId", "audioId"];
7490
7490
  for (const kind of tryOnly) {
7491
+ const withoutKind = getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false }));
7492
+ if (!withoutKind.audio && !withoutKind.video)
7493
+ continue;
7491
7494
  try {
7492
- stream = yield attempt(getConstraints(Object.assign(Object.assign({}, constraintOpt), { [kind]: false })));
7495
+ stream = yield attempt(withoutKind);
7493
7496
  }
7494
7497
  catch (e2) {
7495
7498
  logger.warn(`Re-tried without ${kind}, but failed: ${"" + e2}`);
@@ -7504,7 +7507,7 @@ function getStream(constraintOpt_1) {
7504
7507
  yield getSingleStream();
7505
7508
  }
7506
7509
  }
7507
- if (retryConstraintOpt) {
7510
+ if (!stream && retryConstraintOpt) {
7508
7511
  const onlyConstraints = only ? { audio: { videoId: false }, video: { audioId: false } }[only] : {};
7509
7512
  const retryConstraints = getConstraints(Object.assign(Object.assign(Object.assign(Object.assign({}, constraintOpt), retryConstraintOpt), { options: Object.assign(Object.assign({}, constraintOpt.options), { lax: retryConstraintOpt.lax }) }), onlyConstraints));
7510
7513
  try {
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.1",
4
+ "version": "9.7.3",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {