Skip to content

Commit

Permalink
Merge branch 'dev' into WEB-2732-play-pause-seek-state
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-1995 committed Mar 15, 2024
2 parents 38a5f73 + c9957ee commit 25f3c8a
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/sync-alpha-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
types: [closed]
branches:
- main
- dev

jobs:
pull-request:
Expand All @@ -15,8 +15,8 @@ jobs:
if: github.event.pull_request.merged == true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: 'main'
source_branch: 'dev'
destination_branch: 'publish-alpha'
pr_title: 'Update publish-alpha'
pr_body: ':robot: Automated PR from main to publish-alpha'
pr_body: ':robot: Automated PR from dev to publish-alpha'
pr_label: 'auto-pr'
2 changes: 1 addition & 1 deletion examples/prebuilt-react-integration/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/hls-player/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hls-stats/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hms-video-store/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class AudioSinkManager {
this.eventBus.audioTrackRemoved.subscribe(this.handleTrackRemove);
this.eventBus.audioTrackUpdate.subscribe(this.handleTrackUpdate);
this.eventBus.deviceChange.subscribe(this.handleAudioDeviceChange);
this.startPollingForDevices();
}

setListener(listener?: HMSUpdateListener) {
Expand Down Expand Up @@ -266,6 +267,19 @@ export class AudioSinkManager {
}
};

private startPollingForDevices = () => {
// device change supported, no polling needed
if ('ondevicechange' in navigator.mediaDevices) {
return;
}
this.timer = setInterval(() => {
(async () => {
await this.deviceManager.init(true, false);
await this.autoSelectAudioOutput();
})();
}, 5000);
};

/**
* Mweb is not able to play via call channel by default, this is to switch from media channel to call channel
*/
Expand Down Expand Up @@ -294,10 +308,18 @@ export class AudioSinkManager {
const localAudioTrack = this.store.getLocalPeer()?.audioTrack;
if (localAudioTrack && earpiece) {
const externalDeviceID = bluetoothDevice?.deviceId || wired?.deviceId || speakerPhone?.deviceId;
await localAudioTrack.setSettings({ deviceId: earpiece?.deviceId });
await localAudioTrack.setSettings({
deviceId: externalDeviceID,
});
HMSLogger.d(this.TAG, 'externalDeviceID', externalDeviceID);
// already selected appropriate device
if (localAudioTrack.settings.deviceId === externalDeviceID) {
return;
}
await localAudioTrack.setSettings({ deviceId: earpiece?.deviceId }, true);
await localAudioTrack.setSettings(
{
deviceId: externalDeviceID,
},
true,
);
}
}
};
Expand Down
5 changes: 1 addition & 4 deletions packages/hms-video-store/src/device-manager/DeviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,8 @@ export class DeviceManager implements HMSDeviceManager {
await this.enumerateDevices();
this.logDevices('After Device Change');
const localPeer = this.store.getLocalPeer();
const audioTrack = localPeer?.audioTrack;
await this.setOutputDevice(true);
if (audioTrack) {
await this.handleAudioInputDeviceChange(localPeer?.audioTrack);
}
await this.handleAudioInputDeviceChange(localPeer?.audioTrack);
await this.handleVideoInputDeviceChange(localPeer?.videoTrack);
this.eventBus.analytics.publish(
AnalyticsEventFactory.deviceChange({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ export class HMSLocalAudioTrack extends HMSAudioTrack {
const hasPropertyChanged = generateHasPropertyChanged(settings, this.settings);
if (hasPropertyChanged('deviceId')) {
this.manuallySelectedDeviceId = !internal ? settings.deviceId : this.manuallySelectedDeviceId;
HMSLogger.d(
this.TAG,
'device change',
'manual selection:',
this.manuallySelectedDeviceId,
'new device:',
settings.deviceId,
);
await this.replaceTrackWith(settings);
const groupId = this.nativeTrack.getSettings().groupId;
if (!internal && settings.deviceId) {
Expand Down
6 changes: 3 additions & 3 deletions packages/hms-virtual-background/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hms-virtual-background/src/HMSEffectsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class HMSEffectsPlugin implements HMSMediaStreamPlugin {
private blurAmount = 0;
private background: HMSEffectsBackground = HMSVirtualBackgroundTypes.NONE;
private backgroundType = HMSVirtualBackgroundTypes.NONE;
private preset = 'balanced';
private preset = 'lightning';

constructor(effectsSDKKey: string) {
this.effects = new tsvb(effectsSDKKey);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/react-sdk/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions packages/roomkit-react/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const RoleAccordion = ({
<HorizontalDivider />
<Flex css={{ w: '100%', p: '$6', gap: '$4' }} justify="center">
<Button variant="standard" onClick={lowerAllHands} icon css={{ pl: '$2' }}>
<CrossIcon /> Lower All Hands
<CrossIcon /> Lower all hands
</Button>
{canBringToStage && (
<Button onClick={bringAllToStage} icon css={{ pl: '$2' }}>
Expand Down
4 changes: 2 additions & 2 deletions packages/roomkit-web/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 28 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15781,7 +15781,16 @@ string-natural-compare@^3.0.1:
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==

"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -15881,7 +15890,14 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -17178,7 +17194,7 @@ worker-timers@^7.0.40:
worker-timers-broker "^6.0.95"
worker-timers-worker "^7.0.59"

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -17196,6 +17212,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit 25f3c8a

Please sign in to comment.