mieszko4 / react-native-zoom-us

MIT License
126 stars 118 forks source link

Video and Audio are muted by default when joining a meeting on iOS #93

Closed alfred-soroush closed 3 years ago

alfred-soroush commented 3 years ago

This behaviour is the opposite of the iOS SDK where video and audio are unmuted by default. Video preview also does not show despite not being disabled:

ZoomUs.initialize({
          jwtToken: token,
        })

Tested with react-native-zoom-us 5.8.4 RN v0.64.1

mieszko4 commented 3 years ago

Strange if that happens, because we are setting noAudio = false, noVideo = false on default when joining the meeting:

https://github.com/mieszko4/react-native-zoom-us/blob/ae9ce9aa8fc882dc53ae8c2adc5aaf577c110da5/index.ts#L83

Does passing explicitly false help?

alfred-soroush commented 3 years ago

Strange if that happens, because we are setting noAudio = false, noVideo = false on default when joining the meeting:

https://github.com/mieszko4/react-native-zoom-us/blob/ae9ce9aa8fc882dc53ae8c2adc5aaf577c110da5/index.ts#L83

Does passing explicitly false help?

No. I managed to track the audio being muted to this line:

https://github.com/mieszko4/react-native-zoom-us/blob/781b3a17aa349ac4f74db66f3a480c8f47123b73/ios/RNZoomUs.m#L213

It seems to be a bug from the zoom sdk. Calling [ms muteMyAudio: NO]; toggles the mute state rather than setting it. After removing this line, the audio is not muted after connecting.

As for the video, I still don't have an idea, but the workaround is to force unmute the video which shouldn't be necessary.

- (void)onMeetingStateChange:(MobileRTCMeetingState)state {
  ...
  if (state == MobileRTCMeetingState_InMeeting || state == MobileRTCMeetingState_Idle) {
    // force enable video after joining
    MobileRTCMeetingService *ms = [[MobileRTC sharedRTC] getMeetingService];
    if (ms) {
      if (![ms isSendingMyVideo]) {
        [ms muteMyVideo:NO];
      }
    }
  ...
  }
}
mieszko4 commented 3 years ago

It seems to be a bug from the zoom sdk. - wow, crazy :) Does it happen in 5.11.0 (@zvs001 has recently updated the lib for iOS)

If your workarounds work we should apply them to the code with an appropriate why comment. Could you make a pr?

hakeemsyd commented 3 years ago

I am also facing this issue. Any update on this?

mieszko4 commented 3 years ago

Perhaps the new version of zoom-sdk will fix this (https://github.com/mieszko4/react-native-zoom-us/issues/109)

mieszko4 commented 3 years ago

Please check with 6.1.1 which has newest zoom ios sdk