File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
Assets/WebGLTemplates/AgoraTemplate/AgoraWebSDK/libs Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -587,19 +587,8 @@ class ClientManager {
587587 this . audioSubscribing = enabled ;
588588 }
589589
590- // Disables/Re-enables the local audio function.
591- async enableLocalAudio ( enabled ) {
592- if ( enabled == false ) {
593- if ( localTracks . audioTrack ) {
594- localTracks . audioTrack . setVolume ( 0 ) ;
595- }
596- } else {
597- if ( localTracks . audioTrack ) {
598- localTracks . audioTrack . setVolume ( 100 ) ;
599- }
600- }
601- this . audioEnabled = enabled ;
602- }
590+
591+
603592
604593 // mutes the video stream by calling setMuted in the video track.
605594 // if mute is equal to true, then the videoTrack will be muted
@@ -635,6 +624,20 @@ class ClientManager {
635624 this . videoEnabled = enable ;
636625 }
637626
627+ // Disables/Re-enables the local audio function.
628+ async enableLocalAudio ( enabled ) {
629+ var enable = enabled == 1 ? true : false ;
630+ console . log ( "EnableLocalAudio (clientManager):" + enable ) ;
631+ if ( this . client ) {
632+
633+ if ( localTracks . audioTrack != null ) {
634+ localTracks . audioTrack . setEnabled ( enable ) ;
635+ }
636+
637+ }
638+ this . audioEnabled = enable ;
639+ }
640+
638641
639642 async startPreview ( ) {
640643 console . log ( localTracks . videoTrack ) ;
You can’t perform that action at this time.
0 commit comments