Skip to content

Commit 6d91a9a

Browse files
Skip listing and selecting devices as part joinmethod call (#894)
* Skip listing and selecting devices as part joinmethod call Add `skipDeviceSelection` flag to meetingManager.join API options * Add chromeOption --disable-features=EnableEphemeralFlashPermission to roster integration test
1 parent d3e26e1 commit 6d91a9a

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Added
1313

14+
- Add `skipDeviceSelection` option on the `MeetingManager.join` API. The `MeetingManager.join` by default lists and selects audio input, output and video input devices. Use `skipDeviceSelection` flag to skip this default device selection. This is helpful when builders want to fully control device selection as part of meeting initialization. This also avoids no-audio issues in Safari which happens due to listing and selecting devices multiple times.
15+
1416
### Removed
1517

1618
### Changed

integration/utils/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const config = {
3131
'disable-infobars',
3232
'ignore-gpu-blacklist',
3333
'test-type',
34-
'disable-gpu'
34+
'disable-gpu',
35+
'--disable-features=EnableEphemeralFlashPermission'
3536
],
3637
},
3738
},

src/providers/MeetingProvider/MeetingManager.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export class MeetingManager implements AudioVideoObserver {
148148
eventController,
149149
enableWebAudio,
150150
activeSpeakerPolicy,
151+
skipDeviceSelection
151152
} = this.parseJoinParams(options);
152153
this.meetingSessionConfiguration = meetingSessionConfiguration;
153154
this.meetingId = this.meetingSessionConfiguration.meetingId;
@@ -172,7 +173,11 @@ export class MeetingManager implements AudioVideoObserver {
172173

173174
this.setupAudioVideoObservers();
174175
this.setupDeviceLabelTrigger(deviceLabels);
175-
await this.listAndSelectDevices(deviceLabels);
176+
if (!skipDeviceSelection) {
177+
this.logger.info('[MeetingManager.join] listing and selecting devices');
178+
await this.listAndSelectDevices(deviceLabels);
179+
}
180+
176181
this.publishAudioVideo();
177182
this.setupActiveSpeakerDetection(activeSpeakerPolicy);
178183
this.meetingStatus = MeetingStatus.Loading;
@@ -189,12 +194,14 @@ export class MeetingManager implements AudioVideoObserver {
189194
const enableWebAudio: boolean = options?.enableWebAudio || false;
190195
const activeSpeakerPolicy: ActiveSpeakerPolicy =
191196
options?.activeSpeakerPolicy || new DefaultActiveSpeakerPolicy();
197+
const skipDeviceSelection = options?.skipDeviceSelection || false;
192198

193199
return {
194200
deviceLabels,
195201
eventController,
196202
enableWebAudio,
197203
activeSpeakerPolicy,
204+
skipDeviceSelection
198205
};
199206
}
200207

src/providers/MeetingProvider/docs/MeetingManager.stories.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ options?: {
5959
// The `ActiveSpeakerPolicy` object that you want to be used in the meeting session.
6060
// For more information on `ActiveSpeakerPolicy`, check Amazon Chime SDK for JavaScript ActiveSpeakerPolicy (https://aws.github.io/amazon-chime-sdk-js/interfaces/activespeakerpolicy.html).
6161
activeSpeakerPolicy?: ActiveSpeakerPolicy;
62+
63+
/*
64+
The `meetingManager.join` API by default lists and selects the first available audio input, output and video input device.
65+
The audio and video devices listing and selection is needed for a successful meeting session start using `meetingManager.start` API following the `meetingManager.join` API call and then to start a video.
66+
In cases where you want to control the devices listing and selection on your side before joining a meeting, you can set `skipDeviceSelection` to `true`.
67+
With `skipDeviceSelection` being true`, the `meetingManager.join` API will not do any default devices listing and selection and it will be your responsibility to select the devices.
68+
Default is `false`.
69+
Note: Audio output device selection is only available in browsers that support `setSinkId`.
70+
*/
71+
skipDeviceSelection?: boolean;
6272
}
6373
```
6474

src/providers/MeetingProvider/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface MeetingManagerJoinOptions {
1010
eventController?: EventController;
1111
enableWebAudio?: boolean;
1212
activeSpeakerPolicy?: ActiveSpeakerPolicy;
13+
skipDeviceSelection?: boolean;
1314
}
1415

1516
export interface AttendeeResponse {
@@ -22,6 +23,7 @@ export type ParsedJoinParams = {
2223
eventController: EventController | undefined;
2324
enableWebAudio: boolean;
2425
activeSpeakerPolicy: ActiveSpeakerPolicy;
26+
skipDeviceSelection: boolean;
2527
};
2628

2729
export type FullDeviceInfoType = {

0 commit comments

Comments
 (0)