We do not currently have an API that triggers a mute on the remote stream.

However, here is a work around you may wish to consider:

You can use the sendMessage method on the muting peer (Peer A) and listen for the incomingMessage event on the target peer (Peer B). On receipt of a specific message (e.g. "muteAudio"), muteStream can be called on the Peer B stream.

You can implement it as a broadcast (when you want to mute all peers) or as a targeted message if you want to mute a particular peer. This will mute the audio of the target peer for all peers in the room.

Here's a code snippet you may find useful:

// local peer


// remote peer

Skylink.on('incomingMessage', (message, peerId, peerInfo, isSelf) => {

    if(message.content === 'muteAudio') {

        // mute the stream