     AV_BUTTON
       danger: !me.audio
       onClick: (e) ->
-        if me.audio
-          plugin_handle?.muteAudio()
+        if window.microphone == undefined
+          # TODO: warn the user when they don't have an accessible mic but
+          # try to turn on audio. This silently keeps it off.
           me.audio = false
         else
-          plugin_handle?.unmuteAudio()
-          me.audio = true
-        return
+          # TODO: call window.camera.close() to turn off camera entirely. Right
+          # now when you turn off video, your camera light is on, even though we
+          # aren't using that camera feed.
+          me.audio = !!!me.audio
+          window.microphone.setEnabled(me.audio)
 
       MIC_ICON
         on: !!me.audio

    AV_BUTTON
      danger: !me.video
      onClick: (e) ->
        if me.video
          plugin_handle?.muteVideo()
          me.video = false
        else
          plugin_handle?.unmuteVideo()
          me.video = true
        return

      VIDEO_ICON
        on: !!me.video
        width: 16

streams = {}
agora_initialized = false

window.camera = undefined
window.microphone = undefined

###############################################################################
# Client Bus (all state prefixed with tawk/)
