opentok / opentok-react

React components for OpenTok.js
https://www.npmjs.com/package/opentok-react
MIT License
107 stars 105 forks source link

Mute audio functionality stops working with Sharing Screen functionality. #184

Open meljason opened 3 years ago

meljason commented 3 years ago

I have implemented the screenshare feature with the use of OT.checkScreenSharingCapability then published a stream on like so:

publisher = OT.initPublisher(
    'screen-preview',
    {
    videoSource: 'screen',
    insertMode: 'append',
    fitMode: 'contain',
    width: '100%',
    height: '100%',
    })

But once I click on share screen, the mute audio button stops working.

This is how my mute-audio works:

export function toggleAudio(state) {
    publisher.publishAudio(state);
}

How do I fix this?