Use high level track APIs in example app & docs (#36)

This commit is contained in:
David Zhao
2021-11-26 23:51:37 -08:00
committed by GitHub
parent c50e0269cf
commit 66dbc94c1a
4 changed files with 23 additions and 45 deletions
-29
View File
@@ -53,47 +53,18 @@ class _ControlsWidgetState extends State<ControlsWidget> {
void _disableAudio() async {
await participant.setMicrophoneEnabled(false);
// The following code is an example how to mute a track
// if (participant.hasAudio) {
// final audioPub = participant.audioTracks.first;
// audioPub.muted = true;
// }
}
Future<void> _enableAudio() async {
await participant.setMicrophoneEnabled(true);
// The following code is an example how to unmute / publish a audio track
// if (participant.hasAudio) {
// final audioPub = participant.audioTracks.first;
// audioPub.muted = false;
// } else {
// // publish audio track
// final audioTrack = await LocalAudioTrack.create();
// await participant.publishAudioTrack(audioTrack);
// }
}
void _disableVideo() async {
await participant.setCameraEnabled(false);
// The following code is an example how to mute a video track
// if (participant.hasVideo) {
// final videoPub = participant.videoTracks.first;
// videoPub.muted = true;
// }
}
void _enableVideo() async {
await participant.setCameraEnabled(true);
// The following code is an example how to unmute / publish a video track
// if (participant.hasVideo) {
// print('Un-muting video');
// final videoPub = participant.videoTracks.first;
// videoPub.muted = false;
// } else {
// // publish audio track
// final videoTrack = await LocalVideoTrack.createCameraTrack();
// await participant.publishVideoTrack(videoTrack);
// }
}
void _toggleCamera() async {