ISBX / apprtc-ios

A native iOS video chat app based on WebRTC
BSD 3-Clause "New" or "Revised" License
1.35k stars 413 forks source link

How to put Audio Call only. #101

Open shravanteegala opened 6 years ago

shravanteegala commented 6 years ago

Video Calling with voice(audio) working fine But When I put the audio call only call the using [self.client muteVideoIn]; //- (void)muteVideoIn;

it is not working. please help me.

avinashvaghasiya commented 6 years ago

when you create local stream then you can attach only audio stream not video stream

    - (RTCMediaStream *)createLocalMediaStream {
       RTCMediaStream* localStream = [_factory mediaStreamWithLabel:@"ARDAMS"];

    //RTCVideoTrack *localVideoTrack = [self createLocalVideoTrack];
    //if (localVideoTrack) {
    //    [localStream addVideoTrack:localVideoTrack];
    //    _delegate=self;
    //    [_delegate appClient:self didReceiveLocalVideoTrack:localVideoTrack];
    //}

      [localStream addAudioTrack:[_factory audioTrackWithID:@"ARDAMSa0"]];
     if (_isSpeakerEnabled) [self enableSpeaker];
     return localStream;
     }