-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ui cookbook audio indicator docs
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
50 changes: 50 additions & 0 deletions
50
docusaurus/docs/Flutter/06-ui-cookbook/07-audio-volume-indicator.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Audio Volume Indicator | ||
|
||
The audio indicator provides visual feedback when a user connected to the call is speaking. | ||
|
||
You can observe several things about audio in the `CallParticipantState` class such as: | ||
|
||
* Check if the current user is the dominant speaker: `participantState.isDominantSpeaker` | ||
* Check if the current user is speaking: `participantState.isSpeaking` | ||
* Check the audio level of the user: `participantState.audioLevel` | ||
|
||
## Customising the audio volume indicator | ||
|
||
You can change the color of the audio indicator using the `audioLevelIndicatorColor` parameter of the `StreamCallParticipant` widget: | ||
|
||
```dart | ||
StreamCallContainer( | ||
// ... | ||
callContentBuilder: ( | ||
BuildContext context, | ||
Call call, | ||
CallState callState, | ||
) { | ||
return StreamCallContent( | ||
call: call, | ||
callState: callState, | ||
callParticipantsBuilder: ( | ||
BuildContext context, | ||
Call call, | ||
CallState callState, | ||
) { | ||
return StreamCallParticipants( | ||
call: call, | ||
participants: callState.callParticipants, | ||
callParticipantBuilder: ( | ||
BuildContext context, | ||
Call call, | ||
CallParticipantState participantState, | ||
) { | ||
return StreamCallParticipant( | ||
call: call, | ||
participant: participantState, | ||
audioLevelIndicatorColor: Colors.teal, | ||
); | ||
}, | ||
); | ||
}, | ||
); | ||
}, | ||
), | ||
``` |