Skip to content

Commit

Permalink
[example][JoinChannelAudio] Hide speakerphone relative example (#1416)
Browse files Browse the repository at this point in the history
Hide speakerphone relative example in the `JoinChannelAudio` case
  • Loading branch information
littleGnAl authored Nov 1, 2023
1 parent a700bc3 commit 407494d
Showing 1 changed file with 82 additions and 80 deletions.
162 changes: 82 additions & 80 deletions example/lib/examples/basic/join_channel_audio/join_channel_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,89 +232,91 @@ class _State extends State<JoinChannelAudio> {
onPressed: _switchMicrophone,
child: Text('Microphone ${openMicrophone ? 'on' : 'off'}'),
),
ElevatedButton(
onPressed: isJoined ? _switchSpeakerphone : null,
child:
Text(enableSpeakerphone ? 'Speakerphone' : 'Earpiece'),
),
if (!kIsWeb)
if (!kIsWeb) ...[
ElevatedButton(
onPressed: isJoined ? _switchEffect : null,
child: Text('${playEffect ? 'Stop' : 'Play'} effect'),
onPressed: isJoined ? _switchSpeakerphone : null,
child: Text(
enableSpeakerphone ? 'Speakerphone' : 'Earpiece'),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const Text('RecordingVolume:'),
Slider(
value: _recordingVolume,
min: 0,
max: 400,
divisions: 5,
label: 'RecordingVolume',
onChanged: isJoined
? (double value) async {
setState(() {
_recordingVolume = value;
});
await _engine
.adjustRecordingSignalVolume(value.toInt());
}
: null,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const Text('PlaybackVolume:'),
Slider(
value: _playbackVolume,
min: 0,
max: 400,
divisions: 5,
label: 'PlaybackVolume',
onChanged: isJoined
? (double value) async {
setState(() {
_playbackVolume = value;
});
await _engine
.adjustPlaybackSignalVolume(value.toInt());
}
: null,
)
],
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(mainAxisSize: MainAxisSize.min, children: [
const Text('InEar Monitoring Volume:'),
Switch(
value: _enableInEarMonitoring,
onChanged: isJoined ? _toggleInEarMonitoring : null,
activeTrackColor: Colors.grey[350],
activeColor: Colors.white,
if (!kIsWeb)
ElevatedButton(
onPressed: isJoined ? _switchEffect : null,
child: Text('${playEffect ? 'Stop' : 'Play'} effect'),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const Text('RecordingVolume:'),
Slider(
value: _recordingVolume,
min: 0,
max: 400,
divisions: 5,
label: 'RecordingVolume',
onChanged: isJoined
? (double value) async {
setState(() {
_recordingVolume = value;
});
await _engine.adjustRecordingSignalVolume(
value.toInt());
}
: null,
)
]),
if (_enableInEarMonitoring)
SizedBox(
width: 300,
child: Slider(
value: _inEarMonitoringVolume,
min: 0,
max: 100,
divisions: 5,
label:
'InEar Monitoring Volume $_inEarMonitoringVolume',
onChanged: isJoined
? _onChangeInEarMonitoringVolume
: null,
))
],
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const Text('PlaybackVolume:'),
Slider(
value: _playbackVolume,
min: 0,
max: 400,
divisions: 5,
label: 'PlaybackVolume',
onChanged: isJoined
? (double value) async {
setState(() {
_playbackVolume = value;
});
await _engine.adjustPlaybackSignalVolume(
value.toInt());
}
: null,
)
],
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(mainAxisSize: MainAxisSize.min, children: [
const Text('InEar Monitoring Volume:'),
Switch(
value: _enableInEarMonitoring,
onChanged: isJoined ? _toggleInEarMonitoring : null,
activeTrackColor: Colors.grey[350],
activeColor: Colors.white,
)
]),
if (_enableInEarMonitoring)
SizedBox(
width: 300,
child: Slider(
value: _inEarMonitoringVolume,
min: 0,
max: 100,
divisions: 5,
label:
'InEar Monitoring Volume $_inEarMonitoringVolume',
onChanged: isJoined
? _onChangeInEarMonitoringVolume
: null,
))
],
),
],
],
),
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 0),
Expand Down

0 comments on commit 407494d

Please sign in to comment.