onVolume()

wrtc.onVolume() is called when wrtc.adv.volumeMeter() has sampled microphone volume.

You can use this event to display current microphone volume, like a volume meter instrument.

Occurs

Each time microphone volume has been sampled.

The number of wrtc.onVolume() events per second is determined by call.adv.stats_ms

Arguments

wrtc.onVolume(arg)

  • arg - numeric value of current volume, 0-255.

Example

By varying the width of a div according to current volume value you get a volume meter bar.

wrtc.onVolume(arg) {
    document.getElementById("volume").style.width = arg;
}
...
<div id="volume" style="display:inline-block;height:8px;background-color:#ffff00;transition: width 0.6s;"></div>

See also

ixnx/wrtc/js/api/wrtc/onvolume.txt · Last modified: by tibor
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0