100ms-flutter icon indicating copy to clipboard operation
100ms-flutter copied to clipboard

Remote Peer Video Unmute

Open jsonmat opened this issue 3 years ago • 4 comments

I am following this section from the documentation to remotely mute and unmute video: https://www.100ms.live/docs/flutter/v2/features/remote-mute-unmute

However, I need help in requesting to unmute a remote peer's video.

This method works for HMSAudioTrack because even if the remote peer is muted, HMSAudioTrack is not null so I can pass it to this method. However, for HMSVideoTrack, if the remote peer's video is turned off, it is null so I can't pass it to the method.

HMSSDK.changeTrackState(
        forRemoteTrack: forRemoteTrack,
        mute: mute,
        hmsActionResultListener: this);

jsonmat avatar Nov 03 '22 05:11 jsonmat

Additional info on this, when the remote peer joins the room with its video and audio INITIALLY MUTED, HMSVideoTrack of the peer is null.

When the remote peer turns on the video then turns it off, HMSVideoTrack is NOT NULL.

jsonmat avatar Nov 03 '22 05:11 jsonmat

hey @jsonmat We are checking this, we'll update you soon.

ygit avatar Nov 03 '22 10:11 ygit

hey @jsonmat There's a workaround to implement this - Before calling changeTrackState, if the forRemoteTrack is null then send a Direct Message to that peer requesting to unmute their video or audio.

You should send this Direct Message to the peer as a custom type to distinguish it from regular chat messages.

For Sending Direct Message you can use -

hmsSDK.sendDirectMessage(
        message: "Can you unmute your video?", // can be anything custom
        peerTo: peerTo,
        type: "UpdateStateRequest", // can be anything custom
        hmsActionResultListener: hmsActionResultListener);

Now, on the peer receiving this unmute request message, you can show a Dialog Box to ask for permission to unmute the video.

ygit avatar Nov 18 '22 15:11 ygit

hey @jsonmat Were you able to resolve this issue?

ygit avatar Dec 06 '22 07:12 ygit

hey @jsonmat Hope you were able to resolve this issue. Closing this now.

ygit avatar Dec 14 '22 14:12 ygit