This message was deleted.
# helpdesk
s
f
ah , it seems we need a debounce or anti-reentrancy before calling getUserMedia
s
just disable the button after press then enable it when its published
👍 1
w
Can you elaborate a bit
aka what methods can I use to accomplish a bug free experience
It seems im able to screen share before accepting a permission for video so for example
localParticipant.hasVideo
would not solve this
f
I think the code snippet looks like this.
Copy code
bool userMediaRequesting = false;

void _enableVideo() {
    setState(() { userMediaRequesting = true; });
    participant.setCameraEnabled(true).then(() {
       setState(() { userMediaRequesting = false; });
    });
}

IconButton(
              onPressed: userMediaRequesting? null: _enableVideo,
              icon: const Icon(Icons.videocam_off),
              tooltip: 'enable video',
            )
w
so it cant be solved by the client-sdk-flutter?
f
Yes, I think it’s possible
w
yeah it has to be done in lib i think
because the above solution leaves the button disabled if he presses no from the dont allow permisson menu
making it so he cant see the permission menu anymore