@whereby.com/media 1.3.5 → 1.3.6

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
@@ -5293,15 +5293,14 @@ class VegaRtcManager {
5293
5293
  _internalSendWebcam() {
5294
5294
  return __awaiter(this, void 0, void 0, function* () {
5295
5295
  logger$1.info("_internalSendWebcam()");
5296
+ if (!this._webcamTrack ||
5297
+ this._webcamTrack.readyState === "ended" ||
5298
+ !this._sendTransport ||
5299
+ this._webcamProducer) {
5300
+ return;
5301
+ }
5296
5302
  this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5297
5303
  try {
5298
- if (!this._webcamTrack ||
5299
- this._webcamTrack.readyState === "ended" ||
5300
- !this._sendTransport ||
5301
- this._webcamProducer) {
5302
- this._webcamProducerPromise = null;
5303
- return;
5304
- }
5305
5304
  const currentPaused = this._webcamPaused;
5306
5305
  const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, this._features)), { appData: {
5307
5306
  streamId: OUTBOUND_CAM_OUTBOUND_STREAM_ID,
@@ -5345,7 +5344,7 @@ class VegaRtcManager {
5345
5344
  logger$1.info("_replaceWebcamTrack()");
5346
5345
  if (!this._webcamTrack)
5347
5346
  return;
5348
- if (!this._webcamProducer && this._webcamTrack.enabled)
5347
+ if (this._sendTransport && !this._webcamProducer && this._webcamTrack.enabled)
5349
5348
  yield this._internalSendWebcam();
5350
5349
  if (!this._webcamTrack || !this._webcamProducer || this._webcamProducer.closed)
5351
5350
  return;
package/dist/index.mjs CHANGED
@@ -5272,15 +5272,14 @@ class VegaRtcManager {
5272
5272
  _internalSendWebcam() {
5273
5273
  return __awaiter(this, void 0, void 0, function* () {
5274
5274
  logger$1.info("_internalSendWebcam()");
5275
+ if (!this._webcamTrack ||
5276
+ this._webcamTrack.readyState === "ended" ||
5277
+ !this._sendTransport ||
5278
+ this._webcamProducer) {
5279
+ return;
5280
+ }
5275
5281
  this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5276
5282
  try {
5277
- if (!this._webcamTrack ||
5278
- this._webcamTrack.readyState === "ended" ||
5279
- !this._sendTransport ||
5280
- this._webcamProducer) {
5281
- this._webcamProducerPromise = null;
5282
- return;
5283
- }
5284
5283
  const currentPaused = this._webcamPaused;
5285
5284
  const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, this._features)), { appData: {
5286
5285
  streamId: OUTBOUND_CAM_OUTBOUND_STREAM_ID,
@@ -5324,7 +5323,7 @@ class VegaRtcManager {
5324
5323
  logger$1.info("_replaceWebcamTrack()");
5325
5324
  if (!this._webcamTrack)
5326
5325
  return;
5327
- if (!this._webcamProducer && this._webcamTrack.enabled)
5326
+ if (this._sendTransport && !this._webcamProducer && this._webcamTrack.enabled)
5328
5327
  yield this._internalSendWebcam();
5329
5328
  if (!this._webcamTrack || !this._webcamProducer || this._webcamProducer.closed)
5330
5329
  return;
@@ -5272,15 +5272,14 @@ class VegaRtcManager {
5272
5272
  _internalSendWebcam() {
5273
5273
  return __awaiter(this, void 0, void 0, function* () {
5274
5274
  logger$1.info("_internalSendWebcam()");
5275
+ if (!this._webcamTrack ||
5276
+ this._webcamTrack.readyState === "ended" ||
5277
+ !this._sendTransport ||
5278
+ this._webcamProducer) {
5279
+ return;
5280
+ }
5275
5281
  this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5276
5282
  try {
5277
- if (!this._webcamTrack ||
5278
- this._webcamTrack.readyState === "ended" ||
5279
- !this._sendTransport ||
5280
- this._webcamProducer) {
5281
- this._webcamProducerPromise = null;
5282
- return;
5283
- }
5284
5283
  const currentPaused = this._webcamPaused;
5285
5284
  const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, this._features)), { appData: {
5286
5285
  streamId: OUTBOUND_CAM_OUTBOUND_STREAM_ID,
@@ -5324,7 +5323,7 @@ class VegaRtcManager {
5324
5323
  logger$1.info("_replaceWebcamTrack()");
5325
5324
  if (!this._webcamTrack)
5326
5325
  return;
5327
- if (!this._webcamProducer && this._webcamTrack.enabled)
5326
+ if (this._sendTransport && !this._webcamProducer && this._webcamTrack.enabled)
5328
5327
  yield this._internalSendWebcam();
5329
5328
  if (!this._webcamTrack || !this._webcamProducer || this._webcamProducer.closed)
5330
5329
  return;
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": "1.3.5",
4
+ "version": "1.3.6",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {