zdpjs_webrtc
Version:
基于easyrtc二次开发的webrtc框架
3,553 lines (1,017 loc) • 198 kB
HTML
<html>
<head>
<title>EasyRTC Client JsDocs</title>
<link rel="stylesheet" type="text/css" href="jsdoc/styles/jsdoc-client.css" />
</head>
<body>
<div id="main">
<h1 class="page-title">Client API - Class easyrtc</h1>
<section>
<article>
<hr/><hr/>
<h2 class="subsection-title">Members</h2>
<dl>
<dt>
<h3 class="name" id="ackMessage"><span class="type-signature"></span>ackMessage<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Most basic message acknowledgment object
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="BECOMING_CONNECTED"><span class="type-signature"></span>BECOMING_CONNECTED<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Value returned by easyrtc.getConnectStatus if the other user is in the process of getting connected
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="closeLocalStream"><span class="type-signature"></span>closeLocalStream<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Alias for closeLocalMediaStream
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="cookieId"><span class="type-signature"></span>cookieId<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Default cookieId name
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="errCodes"><span class="type-signature"></span>errCodes<span class="type-signature"> :Object</span></h3>
</dt>
<dd>
<div class="description">
Error codes that the EasyRTC will use in the errorCode field of error object passed
to error handler set by easyrtc.setOnError. The error codes are short printable strings.
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="IS_CONNECTED"><span class="type-signature"></span>IS_CONNECTED<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Value returned by easyrtc.getConnectStatus if the other user is connected to us.
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="loggingOut"><span class="type-signature"></span>loggingOut<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Flag to indicate that user is currently logging out
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="maxP2PMessageLength"><span class="type-signature"></span>maxP2PMessageLength<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
This constant determines how long (in bytes) a message can be before being split in chunks of that size.
This is because there is a limitation of the length of the message you can send on the
data channel between browsers.
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="myEasyrtcid"><span class="type-signature"></span>myEasyrtcid<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Your easyrtcid
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="nativeVideoHeight"><span class="type-signature"></span>nativeVideoHeight<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
The height of the local media stream video in pixels. This field is set an indeterminate period
of time after easyrtc.initMediaSource succeeds. Note: in actuality, the dimensions of a video stream
change dynamically in response to external factors, you should check the videoWidth and videoHeight attributes
of your video objects before you use them for pixel specific operations.
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="nativeVideoWidth"><span class="type-signature"></span>nativeVideoWidth<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
The width of the local media stream video in pixels. This field is set an indeterminate period
of time after easyrtc.initMediaSource succeeds. Note: in actuality, the dimensions of a video stream
change dynamically in response to external factors, you should check the videoWidth and videoHeight attributes
of your video objects before you use them for pixel specific operations.
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="NOT_CONNECTED"><span class="type-signature"></span>NOT_CONNECTED<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Value returned by easyrtc.getConnectStatus if the other user isn't connected to us.
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="roomJoin"><span class="type-signature"></span>roomJoin<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
The rooms the user is in. This only applies to room oriented applications and is set at the same
time a token is received.
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="usernameRegExp"><span class="type-signature"></span>usernameRegExp<span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Regular expression pattern for user ids. This will need modification to support non US character sets
</div>
<dl class="details">
</dl>
</dd>
</dl>
<hr/><hr />
<h2 class="subsection-title">Methods</h2>
<dl>
<dt>
<h3 class="name" id="addEventListener"><span class="type-signature"></span>addEventListener<span class="signature">(eventName, eventListener)</span><span class="type-signature"> → {void}</span></h3>
</dt>
<dd>
<div class="description">
Adds an event listener for a particular type of event.
Currently the only eventName supported is "roomOccupant".
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>eventName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">the type of the event</td>
</tr>
<tr>
<td class="name"><code>eventListener</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">the function that expects the event.
The eventListener gets called with the eventName as it's first argument, and the event
data as it's second argument.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">void</span>
</dd>
</dl>
</dd>
<dt>
<h3 class="name" id="addStreamToCall"><span class="type-signature"></span>addStreamToCall<span class="signature">(easyrtcId, streamName, receiptHandler)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Add a named local stream to a call.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>easyrtcId</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The id of client receiving the stream.</td>
</tr>
<tr>
<td class="name"><code>streamName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The name of the stream.</td>
</tr>
<tr>
<td class="name"><code>receiptHandler</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">is a function that gets called when the other side sends a message
that the stream has been received. The receiptHandler gets called with an easyrtcid and a stream name. This
argument is optional.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="buildLocalMediaStream"><span class="type-signature"></span>buildLocalMediaStream<span class="signature">(streamName, audioTracks, videoTracks)</span><span class="type-signature"> → {MediaStream}</span></h3>
</dt>
<dd>
<div class="description">
This function builds a new named local media stream from a set of existing audio and video tracks from other media streams.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>streamName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">is the name of the new media stream.</td>
</tr>
<tr>
<td class="name"><code>audioTracks</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">is an array of MediaStreamTracks</td>
</tr>
<tr>
<td class="name"><code>videoTracks</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">is an array of MediaStreamTracks</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the track created.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">MediaStream</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.buildLocalMediaStream("myComposedStream",
easyrtc.getLocalStream("camera1").getVideoTracks(),
easyrtc.getLocalStream("camera2").getAudioTracks());</code></pre>
</dd>
<dt>
<h3 class="name" id="call"><span class="type-signature"></span>call<span class="signature">(otherUser, callSuccessCB, callFailureCB, wasAcceptedCB, streamNames)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Initiates a call to another user. If it succeeds, the streamAcceptor callback will be called.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>otherUser</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">the easyrtcid of the peer being called.</td>
</tr>
<tr>
<td class="name"><code>callSuccessCB</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">(otherCaller, mediaType) - is called when the datachannel is established or the MediaStream is established. mediaType will have a value of "audiovideo" or "datachannel"</td>
</tr>
<tr>
<td class="name"><code>callFailureCB</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">(errorCode, errMessage) - is called if there was a system error interfering with the call.</td>
</tr>
<tr>
<td class="name"><code>wasAcceptedCB</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">(wasAccepted:boolean,otherUser:string) - is called when a call is accepted or rejected by another party. It can be left null.</td>
</tr>
<tr>
<td class="name"><code>streamNames</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">optional array of streamNames.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.call( otherEasyrtcid,
function(easyrtcid, mediaType){
console.log("Got mediaType " + mediaType + " from " + easyrtc.idToName(easyrtcid));
},
function(errorCode, errMessage){
console.log("call to " + easyrtc.idToName(otherEasyrtcid) + " failed:" + errMessage);
},
function(wasAccepted, easyrtcid){
if( wasAccepted ){
console.log("call accepted by " + easyrtc.idToName(easyrtcid));
}
else{
console.log("call rejected" + easyrtc.idToName(easyrtcid));
}
});</code></pre>
</dd>
<dt>
<h3 class="name" id="cleanId"><span class="type-signature"></span>cleanId<span class="signature">(idString)</span><span class="type-signature"> → {String}</span></h3>
</dt>
<dd>
<div class="description">
A convenience function to ensure that a string doesn't have symbols that will be interpreted by HTML.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>idString</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The cleaned string.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>console.log( easyrtc.cleanId('&hello'));</code></pre>
</dd>
<dt>
<h3 class="name" id="clearMediaStream"><span class="type-signature"></span>clearMediaStream<span class="signature">(element)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Clears the media stream on a video object.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>element</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">the video object.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.clearMediaStream( document.getElementById('selfVideo'));</code></pre>
</dd>
<dt>
<h3 class="name" id="closeLocalMediaStream"><span class="type-signature"></span>closeLocalMediaStream<span class="signature">(streamName)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Close the local media stream. You usually need to close the existing media stream
of a camera before reacquiring it at a different resolution.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>streamName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">an option stream name.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="connect"><span class="type-signature"></span>connect<span class="signature">(applicationName, successCallback, errorCallback)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Connects to the EasyRTC signaling server. You must connect before trying to
call other users.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>applicationName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">is a string that identifies the application so that different applications can have different
lists of users. Note that the server configuration specifies a regular expression that is used to check application names
for validity. The default pattern is that of an identifier, spaces are not allowed.</td>
</tr>
<tr>
<td class="name"><code>successCallback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">(easyrtcId, roomOwner) - is called on successful connect. easyrtcId is the
unique name that the client is known to the server by. A client usually only needs it's own easyrtcId for debugging purposes.
roomOwner is true if the user is the owner of a room. It's value is random if the user is in multiple rooms.</td>
</tr>
<tr>
<td class="name"><code>errorCallback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">(errorCode, errorText) - is called on unsuccessful connect. if null, an alert is called instead.
The errorCode takes it's value from easyrtc.errCodes.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.connect("my_chat_app",
function(easyrtcid, roomOwner){
if( roomOwner){ console.log("I'm the room owner"); }
console.log("my id is " + easyrtcid);
},
function(errorText){
console.log("failed to connect ", erFrText);
});</code></pre>
</dd>
<dt>
<h3 class="name" id="disconnect"><span class="type-signature"></span>disconnect<span class="signature">()</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Disconnect from the EasyRTC server.
</div>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.disconnect();</code></pre>
</dd>
<dt>
<h3 class="name" id="doesDataChannelWork"><span class="type-signature"></span>doesDataChannelWork<span class="signature">(otherUser)</span><span class="type-signature"> → {Boolean}</span></h3>
</dt>
<dd>
<div class="description">
Checks to see if data channels work between two peers.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>otherUser</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">the other peer.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
true if data channels work and are ready to be used
between the two peers.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
</dd>
<dt>
<h3 class="name" id="emitEvent"><span class="type-signature"></span>emitEvent<span class="signature">(eventName, eventData)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Emits an event, or in other words, calls all the eventListeners for a
particular event.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>eventName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>eventData</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="enableAudio"><span class="type-signature"></span>enableAudio<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Sets whether audio is transmitted by the local user in any subsequent calls.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enabled</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">true to include audio, false to exclude audio. The default is true.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.enableAudio(false);</code></pre>
</dd>
<dt>
<h3 class="name" id="enableAudioReceive"><span class="type-signature"></span>enableAudioReceive<span class="signature">(value)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Control whether the client requests audio from a peer during a call.
Must be called before the call to have an effect.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
</td>
<td class="description last">true to receive audio, false otherwise. The default is true.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="enableCamera"><span class="type-signature"></span>enableCamera<span class="signature">(enable, streamName)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
This function is used to enable and disable the local camera. If you disable the
camera, video objects display it will "freeze" until the camera is re-enabled. *
By default, a camera is enabled.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enable</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">true to enable the camera, false to disable it.</td>
</tr>
<tr>
<td class="name"><code>streamName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">the name of the stream, optional.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="enableDataChannels"><span class="type-signature"></span>enableDataChannels<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Sets whether WebRTC data channels are used to send inter-client messages.
This is only the messages that applications explicitly send to other applications, not the WebRTC signaling messages.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enabled</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">true to use data channels, false otherwise. The default is false.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.enableDataChannels(true);</code></pre>
</dd>
<dt>
<h3 class="name" id="enableDebug"><span class="type-signature"></span>enableDebug<span class="signature">(enable)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Enable or disable logging to the console.
Note: if you want to control the printing of debug messages, override the
easyrtc.debugPrinter variable with a function that takes a message string as it's argument.
This is exactly what easyrtc.enableDebug does when it's enable argument is true.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enable</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">true to turn on debugging, false to turn off debugging. Default is false.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.enableDebug(true);</code></pre>
</dd>
<dt>
<h3 class="name" id="enableMicrophone"><span class="type-signature"></span>enableMicrophone<span class="signature">(enable, streamName)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
This function is used to enable and disable the local microphone. If you disable
the microphone, sounds stops being transmitted to your peers. By default, the microphone
is enabled.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enable</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">true to enable the microphone, false to disable it.</td>
</tr>
<tr>
<td class="name"><code>streamName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">an optional streamName</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="enableVideo"><span class="type-signature"></span>enableVideo<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Sets whether video is transmitted by the local user in any subsequent calls.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enabled</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">true to include video, false to exclude video. The default is true.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>easyrtc.enableVideo(false);</code></pre>
</dd>
<dt>
<h3 class="name" id="enableVideoReceive"><span class="type-signature"></span>enableVideoReceive<span class="signature">(value)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Control whether the client requests video from a peer during a call.
Must be called before the call to have an effect.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
</td>
<td class="description last">true to receive video, false otherwise. The default is true.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h3 class="name" id="format"><span class="type-signature"></span>format<span class="signature">(format, arg1, arg2, arg3)</span><span class="type-signature"> → {String}</span></h3>
</dt>
<dd>
<div class="description">
This function performs a printf like formatting. It actually takes an unlimited
number of arguments, the declared arguments arg1, arg2, arg3 are present just for
documentation purposes.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>format</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">A string like "abcd{1}efg{2}hij{1}."</td>
</tr>
<tr>
<td class="name"><code>arg1</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The value that replaces {1}</td>
</tr>
<tr>
<td class="name"><code>arg2</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The value that replaces {2}</td>
</tr>
<tr>
<td class="name"><code>arg3</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The value that replaces {3}</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the formatted string.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
</dd>
<dt>
<h3 class="name" id="getApplicationFields"><span class="type-signature"></span>getApplicationFields<span class="signature">()</span><span class="type-signature"> → {Object}</span></h3>
</dt>
<dd>
<div class="description">
Get server defined fields associated with the current application. Only valid
after a connection has been made.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A dictionary containing entries of the form {key:{'fieldName':key, 'fieldValue':value1}}
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</dd>
<dt>
<h3 class="name" id="getAudioSinkList"><span class="type-signature"></span>getAudioSinkList<span class="signature">(callback)</span><span class="type-signature"></span></h3>
</dt>
<dd>
<div class="description">
Gets a list of the available audio sinks (ie, speakers)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">receives list of {deviceId:String, groupId:String, lab