daily-co / react-native-daily-js

https://docs.daily.co/reference/rn-daily-js
BSD 2-Clause "Simplified" License
36 stars 13 forks source link

If only one of camera or microphone are blocked, both are shown as blocked #37

Closed swemail closed 1 year ago

swemail commented 1 year ago

Hello and thanks again for a great service and library!

Expected behavior

Device allowing either only microphone or only video can use the one allowed

Describe the bug (unexpected behavior)

When device denies access to video only both

daily.participants().local?.tracks.audio.blocked?.byPermissions // true
daily.participants().local?.tracks.video.blocked?.byPermissions // true

are true

Same is true for denying microphone only.

Same on both iOS and Android

gewfy commented 1 year ago

@filipi87 This is probably a react native specific issue right? Or should we report this to daily-js too? Sort of a blocker for us.

filipi87 commented 1 year ago

Hi @swemail ,

Thanks for reporting this.

I have been able to reproduce It here, and we have already merged a fix for It. It will be available on the next release of react-native-daily-js.

We are also working to improve, if you are building an app that just needs audio or video, to just request the permission that is needed, but this change will come in another future release.

filipi87 commented 1 year ago

Hi @gewfy ,

About your question, It was not exactly just a react-native only issue. But for daily-js we already have a way to make It work. We have a flag, enableIndependentDevicePermissionPrompts.

Note that for enableIndependentDevicePermissionPrompts to work as you expect, you should have mic and cam forced off when you start using the call object.

const newCallObject = Daily.createCallObject({
  startVideoOff: true,
  startAudioOff: true,
  dailyConfig: {
    enableIndependentDevicePermissionPrompts: true
  }
});

This way the browser will ask one permission each time, and you will be able to accept or deny each one.

We don't need to use this flag for react-native.

gewfy commented 1 year ago

Makes sense @filipi87! We want the owner to be able to see which participants have denied permissions and to what. That's why we needed this functionality 😃

Thanks for fixing this 🙌

swemail commented 1 year ago

Hi @swemail ,

Thanks for reporting this.

I have been able to reproduce It here, and we have already merged a fix for It. It will be available on the next release of react-native-daily-js.

We are also working to improve, if you are building an app that just needs audio or video, to just request the permission that is needed, but this change will come in another future release.

Awesome news @filipi87! Thanks for fixing this!

swemail commented 1 year ago

I have confirmed that it works now, great work @filipi87! This issue could be closed now. Not sure if you like reporters to do that or you do it yourself?

filipi87 commented 1 year ago

Fixed already available in the version 0.36.0 of react-native-daily-js

Thanks @swemail and @gewfy for reporting this.