Skip to content

Commit e5ea5e6

Browse files
Merge pull request #979 from MyPureCloud/STREAM-1123-updating-tracks
STREAM-1123 - Only update necessary tracks. prevent vb from getting replaced
2 parents 840b991 + e3e15ce commit e5ea5e6

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Changed
1010
* [STREAM-1178](https://inindca.atlassian.net/browse/STREAM-1178) - REVERT STREAM-825, removed ability to send multiple tracks when screensharing.
1111
* [STREAM-1130](https://inindca.atlassian.net/browse/STREAM-1130) - Updated TypeScript to v5.9.3 and Webpack to v5.105.0, removed legacy Spigot testing, added `.nvmrc`, demo app dependency updates, updated Node versions in testing matrices.
12+
* [STREAM-1123](https://inindca.atlassian.net/browse/STREAM-1123) - Only update necessary tracks when changing devices. Prevent virtual background from getting replaced
1213

1314
# [v11.5.1](https://github.com/MyPureCloud/genesys-cloud-webrtc-sdk/compare/v11.5.0...v11.5.1)
1415
### Added

src/client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,11 @@ export class GenesysCloudWebrtcSdk extends (EventEmitter as { new(): StrictEvent
524524
});
525525

526526
if ((updateVideo || updateAudio) && this.sessionManager) {
527+
const updateOptions: any = {};
528+
if (updateVideo) updateOptions.videoDeviceId = options.videoDeviceId;
529+
if (updateAudio) updateOptions.audioDeviceId = options.audioDeviceId;
527530
promises.push(
528-
this.sessionManager.updateOutgoingMediaForAllSessions()
531+
this.sessionManager.updateOutgoingMediaForAllSessions(updateOptions)
529532
);
530533
}
531534

src/sessions/session-manager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ export class SessionManager {
229229
const promises = sessions.map(session => {
230230
return this.updateOutgoingMedia({
231231
session,
232-
videoDeviceId: opts.videoDeviceId,
233-
audioDeviceId: opts.audioDeviceId
232+
...opts
234233
});
235234
});
236235
return Promise.all(promises);

test/unit/client.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ describe('Client', () => {
825825
await sdk.updateDefaultDevices(options);
826826

827827
expect(sdk.headset.updateAudioInputDevice).toHaveBeenCalledWith(options.audioDeviceId);
828-
expect(sdk.sessionManager.updateOutgoingMediaForAllSessions).toHaveBeenCalledWith();
828+
expect(sdk.sessionManager.updateOutgoingMediaForAllSessions).toHaveBeenCalledWith({"audioDeviceId": "new-audio-device-id"});
829829
expect(sessionManagerMock.updateOutputDeviceForAllSessions).not.toHaveBeenCalled();
830830

831831
sessionManagerMock.updateOutgoingMediaForAllSessions.mockReset();

0 commit comments

Comments
 (0)