Skip to content

Commit

Permalink
Merge pull request #193 from Azure-Samples/dmceachernsmft/add-sounds-c2c
Browse files Browse the repository at this point in the history
[Calling sounds] add sounds to completed code for tutorial
  • Loading branch information
dmceachernmsft authored Nov 24, 2023
2 parents e9c6cef + 8afd8fa commit 6338893
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 46 deletions.
62 changes: 22 additions & 40 deletions ui-library-click-to-call/package-lock.json

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

6 changes: 3 additions & 3 deletions ui-library-click-to-call/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@azure/communication-calling": "1.18.2-beta.1",
"@azure/communication-chat": "1.4.0-beta.1",
"@azure/communication-react": "1.9.0-alpha-202310181643",
"@azure/communication-calling": "1.19.1-beta.2",
"@azure/communication-chat": "1.4.0-beta.2",
"@azure/communication-react": "1.10.1-alpha-202311240012",
"@azure/communication-calling-effects": "1.0.1",
"@azure/communication-common": "2.3.0",
"@fluentui/react-icons": "~2.0.203",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion ui-library-click-to-call/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function App() {
<Spinner label={'Getting user credentials from server'} ariaLive="assertive" labelPosition="top" />;
</Stack>
)

}


Expand Down
17 changes: 15 additions & 2 deletions ui-library-click-to-call/src/components/CallingWidgetComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
CallAdapter,
CallComposite,
useAzureCommunicationCallAdapter,
AzureCommunicationCallAdapterArgs
AzureCommunicationCallAdapterArgs,
CommonCallAdapterOptions
} from '@azure/communication-react';
// lets add to our react imports as well
import { useCallback, useMemo } from 'react';
Expand Down Expand Up @@ -69,12 +70,24 @@ export const CallingWidgetComponent = (
}
}, [widgetAdapterArgs.token]);

const adapterOptions: CommonCallAdapterOptions = useMemo(
() => ({
callingSounds: {
callEnded: { url: '/sounds/callEnded.mp3' },
callRinging: { url: '/sounds/callRinging.mp3' },
callBusy: { url: '/sounds/callBusy.mp3' }
}
}),
[]
);

const callAdapterArgs = useMemo(() => {
return {
userId: widgetAdapterArgs.userId,
credential: credential,
locator: { participantIds: [`28:orgid:${widgetAdapterArgs.teamsAppIdentifier.teamsAppId}`] },
displayName: displayName
displayName: displayName,
options: adapterOptions
}
}, [widgetAdapterArgs.userId, widgetAdapterArgs.teamsAppIdentifier.teamsAppId, credential, displayName]);

Expand Down

0 comments on commit 6338893

Please sign in to comment.