@signalwire/js 4.0.0-dev-20260429174756 → 4.0.0-dev-20260503235343
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/browser.mjs +42 -3
- package/dist/browser.mjs.map +1 -1
- package/dist/browser.umd.js +42 -3
- package/dist/browser.umd.js.map +1 -1
- package/dist/index.cjs +42 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +42 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser.mjs
CHANGED
|
@@ -15256,6 +15256,8 @@ var LocalStreamController = class extends Destroyable {
|
|
|
15256
15256
|
logger$18.debug("[LocalStreamController] User media obtained:", stream);
|
|
15257
15257
|
}
|
|
15258
15258
|
this._localStream$.next(stream);
|
|
15259
|
+
this._localAudioTracks$.next(stream.getAudioTracks());
|
|
15260
|
+
this._localVideoTracks$.next(stream.getVideoTracks());
|
|
15259
15261
|
return stream;
|
|
15260
15262
|
}
|
|
15261
15263
|
/**
|
|
@@ -15423,6 +15425,12 @@ var TransceiverController = class extends Destroyable {
|
|
|
15423
15425
|
scaleResolutionDownBy: Number(rid) * 6 || 1
|
|
15424
15426
|
}));
|
|
15425
15427
|
}
|
|
15428
|
+
/**
|
|
15429
|
+
* Resolve the current MediaTrackConstraints for an input kind, normalising
|
|
15430
|
+
* boolean shorthand to an empty object. Public so the surrounding
|
|
15431
|
+
* RTCPeerConnectionController can drive its own pipeline-aware getUserMedia
|
|
15432
|
+
* call with the same effective constraints the transceiver would have used.
|
|
15433
|
+
*/
|
|
15426
15434
|
getConstraintsFor(kind) {
|
|
15427
15435
|
const constraints = kind === "audio" ? this.inputAudioDeviceConstraints : this.inputVideoDeviceConstraints;
|
|
15428
15436
|
return typeof constraints === "boolean" ? {} : constraints;
|
|
@@ -15749,7 +15757,19 @@ var RTCPeerConnectionController = class extends Destroyable {
|
|
|
15749
15757
|
return this._memberId;
|
|
15750
15758
|
}
|
|
15751
15759
|
stopTrackSender(kind, options = { updateTransceiverDirection: false }) {
|
|
15752
|
-
|
|
15760
|
+
const audioCovered = kind === "audio" || kind === "both";
|
|
15761
|
+
if (audioCovered && this._localAudioPipeline) this.stopRawAudioInputForPipeline();
|
|
15762
|
+
if (!audioCovered) this.transceiverController?.stopTrackSender(kind, options);
|
|
15763
|
+
else if (kind === "both") this.transceiverController?.stopTrackSender("video", options);
|
|
15764
|
+
else if (!this._localAudioPipeline) this.transceiverController?.stopTrackSender(kind, options);
|
|
15765
|
+
}
|
|
15766
|
+
stopRawAudioInputForPipeline() {
|
|
15767
|
+
const rawTracks = this.localStreamController.localAudioTracks;
|
|
15768
|
+
for (const track of rawTracks) if (track.readyState === "live") {
|
|
15769
|
+
track.stop();
|
|
15770
|
+
this.localStreamController.removeTrack(track.id);
|
|
15771
|
+
}
|
|
15772
|
+
this._localAudioPipeline?.setInputTrack(null);
|
|
15753
15773
|
}
|
|
15754
15774
|
get isNegotiating$() {
|
|
15755
15775
|
return this._isNegotiating$.asObservable();
|
|
@@ -16254,8 +16274,27 @@ var RTCPeerConnectionController = class extends Destroyable {
|
|
|
16254
16274
|
await this.transceiverController?.setupRemoteTransceivers(this.type);
|
|
16255
16275
|
}
|
|
16256
16276
|
async restoreTrackSender(kind) {
|
|
16257
|
-
|
|
16258
|
-
if (
|
|
16277
|
+
const audioCovered = kind === "audio" || kind === "both";
|
|
16278
|
+
if (audioCovered && this._localAudioPipeline) await this.restoreRawAudioInputForPipeline();
|
|
16279
|
+
if (!audioCovered) await this.transceiverController?.restoreTrackSender(kind);
|
|
16280
|
+
else if (kind === "both") await this.transceiverController?.restoreTrackSender("video");
|
|
16281
|
+
else if (!this._localAudioPipeline) await this.transceiverController?.restoreTrackSender(kind);
|
|
16282
|
+
}
|
|
16283
|
+
async restoreRawAudioInputForPipeline() {
|
|
16284
|
+
if (!this._localAudioPipeline) return;
|
|
16285
|
+
const constraints = this.transceiverController?.getConstraintsFor("audio") ?? {};
|
|
16286
|
+
let stream;
|
|
16287
|
+
try {
|
|
16288
|
+
stream = await this.getUserMedia({ audio: constraints });
|
|
16289
|
+
} catch (error) {
|
|
16290
|
+
logger$16.error("[RTCPeerConnectionController] Failed to re-acquire mic for pipeline restore:", error);
|
|
16291
|
+
this._errors$.next(toError(error));
|
|
16292
|
+
return;
|
|
16293
|
+
}
|
|
16294
|
+
const newTrack = stream.getAudioTracks().at(0);
|
|
16295
|
+
if (!newTrack) return;
|
|
16296
|
+
this.localStreamController.addTrack(newTrack);
|
|
16297
|
+
this._localAudioPipeline.setInputTrack(newTrack);
|
|
16259
16298
|
}
|
|
16260
16299
|
/**
|
|
16261
16300
|
* Return the lazily-created {@link LocalAudioPipeline}, constructing it on
|