publisher.publishVideo is not a function

I have an application that involved moderators and publishers. Moderators can give and take away certain permissions to interact with the interface from each other. I would like each moderator to be able to publishVideo() and publishAudio() on the other moderators streams depending on their set permissions. It works fine if I publishVideo() and publishAudio() on my own connection/stream but I get the error “publisher.publishVideo is not a function” when i attempt to do the same on one of the other moderator streams.

can a moderator not control other moderators video and audio streams?

First of all, i recommend to you read the openvidu-browser API OpenVidu Browser - v2.15.0

Then, you should send an event (signal) from your moderator to the participant. This participant has to listen this event type and disable the audio or video when the event is received.

You also should read
https://docs.openvidu.io/en/2.15.0/cheatsheet/send-messages/#send-text-messages-between-users
SignalEvent | OpenVidu Browser - v2.15.0

Cheers