user3487962
user3487962

Reputation: 11

Tokbox toggle audio on/off

I cannot seem to wrap my head around how to create a link to toggle a tokbox publishAudio method. I am able to subscribe and publish a video as well as create an object with the publishAudio as a property. Any help would be appreciated!

Upvotes: 1

Views: 385

Answers (1)

Dave Mun
Dave Mun

Reputation: 156

You can call publisher.publishAudio(true), or publisher.publishAudio(false), to choose to send audio or not. This dynamically updates your publisher even after you've already started publishing to the stream.

You can see the docs for that here: https://tokbox.com/opentok/libraries/client/js/reference/Publisher.html#publishAudio

Upvotes: 2

Related Questions