zdpjs_webrtc
Version:
基于easyrtc二次开发的webrtc框架
3,972 lines (979 loc) • 53.1 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>EasyRTC Documentation</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
<link href="../assets/easyrtc-docs-jsdoc-styles-1.css" media="all" rel="stylesheet" />
</head>
<body>
<header class="template">
<div class="wrapper-content">
<a href="../index.html"><img src="../assets/easyrtc-logo.png" alt="EasyRTC Documentation"></a>
<h1 title="EasyRTC Documentation">Documentation</h1>
</div>
</header>
<div class="wrapper-docs">
<nav>
<h2><a href="../index.html">Docs Home</a></h2>
<h3>EasyRTC Guides</h3>
<ul>
<li><a href="../easyrtc_faq.html">FAQ</a></li>
<li><a href="../easyrtc_gettingStarted.html">Getting Started</a></li>
<li><a href="../easyrtc_server_install.html">EasyRTC Server: Installation</a></li>
<li><a href="../easyrtc_client_tutorial.html">EasyRTC Framework Tutorial</a></li>
<li><a href="../easyrtc_rooms.html">Rooms</a></li>
<li><a href="../easyrtc_server_configuration.html">EasyRTC Server: Configuration</a></li>
<li><a href="../easyrtc_server_events.html">EasyRTC Server: Events</a></li>
<li><a href="../easyrtc_server_ice.html">EasyRTC Server: ICE Configuration</a></li>
<li><a href="../easyrtc_with_other_servers.html">Using Alongside Other Servers</a></li>
<li><a href="../easyrtc_server_ssl.html">EasyRTC Server: Using SSL</a></li>
<li><a href="../easyrtc_webrtc_problems.html">WebRTC Problems and Possible Fixes</a></li>
<li><a href="../easyrtc_upcoming_features.html">Upcoming Features</a></li>
<li><a href="../easyrtc_changelog.html">Change Log</a></li>
</ul>
<h3>EasyRTC Client Classes</h3>
<ul>
<li><a href="../client-api/Easyrtc.html">Easyrtc</a></li>
<li><a href="../client-api/Easyrtc_App.html">Easyrtc_App</a></li>
<li><a href="../client-api/Easyrtc_ft.html">Easyrtc_ft</a></li>
<li><a href="../client-api/Easyrtc_IframeCapture.html">Easyrtc_IframeCapture</a></li>
<li><a href="../client-api/Easyrtc_No_IframeCapture.html">Easyrtc_No_IframeCapture</a></li>
<li><a href="../client-api/Easyrtc_Rates.html">Easyrtc_Rates</a></li>
<li><a href="../client-api/Easyrtc_Recorder.html">Easyrtc_Recorder</a></li>
</ul>
<h3>EasyRTC Server Modules</h3>
<ul>
<li><a href="../server-api/module-easyrtc_default_event_listeners.html">easyrtc_default_event_listeners</a></li>
<li><a href="../server-api/module-easyrtc_default_options.html">easyrtc_default_options</a></li>
<li><a href="../server-api/module-easyrtc_private_obj.html">easyrtc_private_obj</a></li>
<li><a href="../server-api/module-easyrtc_public_obj.html">easyrtc_public_obj</a></li>
<li><a href="../server-api/module-easyrtc_util.html">easyrtc_util</a></li>
<li><a href="../server-api/module-general_util.html">general_util</a></li>
</ul>
<h3>EasyRTC Server Classes</h3>
<ul>
<li><a href="../server-api/module-easyrtc_default_event_listeners-eventListener.html">eventListener</a></li>
<li><a href="../server-api/module-easyrtc_public_obj-pub.html">pub</a></li>
<li><a href="../server-api/module-easyrtc_public_obj-pub.events.html">events</a></li>
<li><a href="../server-api/module-easyrtc_public_obj-pub.util.html">util</a></li>
<li><a href="../server-api/module-easyrtc_util-eu.html">eu</a></li>
<li><a href="../server-api/module-general_util-g.html">g</a></li>
<li><a href="../server-api/pub.appObj.html">appObj</a></li>
<li><a href="../server-api/pub.appObj.connectionObj.html">connectionObj</a></li>
<li><a href="../server-api/pub.appObj.connectionObj.connectionRoomObj.html">connectionRoomObj</a></li>
<li><a href="../server-api/pub.appObj.roomObj.html">roomObj</a></li>
<li><a href="../server-api/pub.appObj.sessionObj.html">sessionObj</a></li>
</ul>
</nav>
<div class="easyrtc-docs-content">
<div id="main">
<h1 class="page-title">Class: connectionObj</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="pub.appObj.html">.appObj</a>.</span>connectionObj</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="connectionObj"><span class="type-signature"></span>new connectionObj<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1541">line 1541</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="pub.appObj.connectionObj.connectionRoomObj.html">connectionRoomObj</a></dt>
<dd></dd>
</dl>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id=".connectionObj.events"><span class="type-signature">(static) </span>connectionObj.events<span class="type-signature"></span></h4>
<div class="description">
Expose all event functions
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1555">line 1555</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.util"><span class="type-signature">(static) </span>connectionObj.util<span class="type-signature"></span></h4>
<div class="description">
Expose all utility functions
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1563">line 1563</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".connectionObj.emitRoomDataDelta"><span class="type-signature">(static) </span>connectionObj.emitRoomDataDelta<span class="signature">(isLeavingAllRooms, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Emits the roomData message with a clientListDelta for the current connection to other connections in rooms this connection is in.
Note: To send listDeltas for individual rooms, use connectionRoomObj.emitRoomDataDelta
</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>isLeavingAllRooms</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Indicator if connection is leaving all rooms. Meant to be used upon disconnection / logoff.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback of form (err, roomDataObj) which will contain the roomDataObj including all updated rooms of the connection and is designed to be returnable to the connection.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1874">line 1874</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.generateRoomClientList"><span class="type-signature">(static) </span>connectionObj.generateRoomClientList<span class="signature">(roomStatus<span class="signature-attributes">opt, nullable</span>, roomMap<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Generates a full room clientList object for the given connection
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>roomStatus</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
<nullable><br>
</td>
<td class="default">
"join"
</td>
<td class="description last">Room status which allow for values of "join"|"update"|"leave".</td>
</tr>
<tr>
<td class="name"><code>roomMap</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="default">
</td>
<td class="description last">Map of rooms to generate connection clientList for. If null, then all rooms will be used.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">Callback which includes a formed roomData object .</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1937">line 1937</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.generateRoomDataDelta"><span class="type-signature">(static) </span>connectionObj.generateRoomDataDelta<span class="signature">(isLeavingRoom, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Generates a delta roomData object for the current user including all rooms the user is in. The result can be selectively parsed to deliver delta roomData objects to other clients.
</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>isLeavingRoom</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Indicates if connection is in the process of leaving the room.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback of form (err, roomDataDelta).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line2015">line 2015</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.generateRoomList"><span class="type-signature">(static) </span>connectionObj.generateRoomList<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
Generates the roomList message 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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback with error and roomList object.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line2058">line 2058</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.getApp"><span class="type-signature">(static) </span>connectionObj.getApp<span class="signature">()</span><span class="type-signature"> → {Object}</span></h4>
<div class="description">
Returns the application object to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1585">line 1585</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The application object
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.getAppName"><span class="type-signature">(static) </span>connectionObj.getAppName<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
<div class="description">
Returns the application name for the application to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1596">line 1596</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The application name
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.getEasyrtcid"><span class="type-signature">(static) </span>connectionObj.getEasyrtcid<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
<div class="description">
Returns the easyrtcid for the connection. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1607">line 1607</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the connection's easyrtcid, which is the EasyRTC unique identifier for a socket connection.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.getField"><span class="type-signature">(static) </span>connectionObj.getField<span class="signature">(fieldName, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Returns connection level field object for a given field name to a provided callback.
</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>fieldName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Field name</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback with error and field object (any type)</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1619">line 1619</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.getFields"><span class="type-signature">(static) </span>connectionObj.getFields<span class="signature">(limitToIsShared, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Returns an object containing all field names and values within the connection to a provided callback. Can be limited to fields with isShared option set to 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>limitToIsShared</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">Limits returned fields to those which have the isShared option set to true.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback with error and object containing field names and values.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1666">line 1666</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.getFieldSync"><span class="type-signature">(static) </span>connectionObj.getFieldSync<span class="signature">(fieldName)</span><span class="type-signature"> → {Object}</span></h4>
<div class="description">
Returns connection level field object for a given field name. If the field is not set, it will return a field object will a null field value. This is a synchronous function, thus may not be available in custom cases where state is not kept in memory.
</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>fieldName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Field name</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1636">line 1636</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Field object
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.getFieldValueSync"><span class="type-signature">(static) </span>connectionObj.getFieldValueSync<span class="signature">(fieldName)</span><span class="type-signature"> → (nullable) {*}</span></h4>
<div class="description">
Returns connection level field value for a given field name. If the field is not set, it will return a null field value. This is a synchronous function, thus may not be available in custom cases where state is not kept in memory.
</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>fieldName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Field name</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1651">line 1651</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Field value
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.getRoomNames"><span class="type-signature">(static) </span>connectionObj.getRoomNames<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
Returns an array of all room names which connection has entered.
</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">Callback with error and array of room names.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1686">line 1686</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.getSession"><span class="type-signature">(static) </span>connectionObj.getSession<span class="signature">()</span><span class="type-signature"> → {Object}</span></h4>
<div class="description">
Returns the session object to which the connection belongs (if one exists). Returns a null if connection is not attached to a session (such as when sessions are disabled). Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1701">line 1701</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The session object. May be null if connection has not been joined to a session.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.getUsername"><span class="type-signature">(static) </span>connectionObj.getUsername<span class="signature">()</span><span class="type-signature"> → {String}</span></h4>
<div class="description">
Returns the username associated with the connection. Returns NULL if no username has been set.
Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1731">line 1731</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The username associated with the connection.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.isAuthenticated"><span class="type-signature">(static) </span>connectionObj.isAuthenticated<span class="signature">()</span><span class="type-signature"> → {Boolean}</span></h4>
<div class="description">
Gets connection authentication status for the connection. It is possible for a connection to become disconnected and keep the authenticated flag. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line2078">line 2078</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Authentication status
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.isConnected"><span class="type-signature">(static) </span>connectionObj.isConnected<span class="signature">()</span><span class="type-signature"> → {Boolean}</span></h4>
<div class="description">
Gets connection status for the connection. It is possible for a connection to be considered connected without being authenticated. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line2093">line 2093</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Connection status
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id=".connectionObj.isInRoom"><span class="type-signature">(static) </span>connectionObj.isInRoom<span class="signature">(roomName, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Returns a boolean to the callback indicating if connection is in a given room
</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>roomName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Room name which uniquely identifies a room within an EasyRTC application.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback with error and a boolean indicating if connection is in a room..</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line2127">line 2127</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.joinRoom"><span class="type-signature">(static) </span>connectionObj.joinRoom<span class="signature">(roomName, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Joins an existing room, returning a connectionRoom 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>roomName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Room name which uniquely identifies a room within an EasyRTC application.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback with error and object containing EasyRTC connection room object (same as calling room(roomName))</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line2144">line 2144</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.joinSession"><span class="type-signature">(static) </span>connectionObj.joinSession<span class="signature">(easyrtcsid, next)</span><span class="type-signature"></span></h4>
<div class="description">
Joins the connection to a specified session. A connection can only be assigned to one session.
</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>easyrtcsid</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">EasyRTC session identifier</td>
</tr>
<tr>
<td class="name"><code>next</code></td>
<td class="type">
<span class="param-type">nextCallback</span>
</td>
<td class="description last">A success callback of form next(err).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1743">line 1743</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.removeConnection"><span class="type-signature">(static) </span>connectionObj.removeConnection<span class="signature">(next)</span><span class="type-signature"></span></h4>
<div class="description">
Removes a connection object. Does not (currently) remove connection from rooms or groups.
</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>next</code></td>
<td class="type">
<span class="param-type">nextCallback</span>
</td>
<td class="description last">A success callback of form next(err).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line2438">line 2438</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.room"><span class="type-signature">(static) </span>connectionObj.room<span class="signature">(roomName, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Gets room object for a given room name. Returns null if room not found.
The returned room object includes functions for managing room fields.
</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>roomName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Room name which uniquely identifies a room within an EasyRTC application.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback with error and object containing EasyRTC connection room object.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line2203">line 2203</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.setAuthenticated"><span class="type-signature">(static) </span>connectionObj.setAuthenticated<span class="signature">(isAuthenticated, next)</span><span class="type-signature"></span></h4>
<div class="description">
Sets connection authentication status for the connection.
</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>isAuthenticated</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">True/false as to if the connection should be considered authenticated.</td>
</tr>
<tr>
<td class="name"><code>next</code></td>
<td class="type">
<span class="param-type">nextCallback</span>
</td>
<td class="description last">A success callback of form next(err).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1778">line 1778</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.setCredential"><span class="type-signature">(static) </span>connectionObj.setCredential<span class="signature">(credential<span class="signature-attributes">nullable</span>, next)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the credential for the connection.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>credential</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last">Credential for the connection. Can be any JSON object.</td>
</tr>
<tr>
<td class="name"><code>next</code></td>
<td class="type">
<span class="param-type">nextCallback</span>
</td>
<td class="attributes">
</td>
<td class="description last">A success callback of form next(err).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1795">line 1795</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.setField"><span class="type-signature">(static) </span>connectionObj.setField<span class="signature">(fieldName, fieldValue, fieldOption<span class="signature-attributes">nullable</span>, next<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Sets connection field value for a given field name.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fieldName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">Must be formatted according to "fieldNameRegExp" option.</td>
</tr>
<tr>
<td class="name"><code>fieldValue</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>fieldOption</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last">Field options (such as isShared which defaults to false)</td>
</tr>
<tr>
<td class="name"><code>next</code></td>
<td class="type">
<span class="param-type">nextCallback</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A success callback of form next(err). Possible err will be instanceof (ApplicationWarning).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1810">line 1810</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.setPresence"><span class="type-signature">(static) </span>connectionObj.setPresence<span class="signature">(presenceObj, next)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the presence object for the connection.
</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>presenceObj</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">A presence object.</td>
</tr>
<tr>
<td class="name"><code>next</code></td>
<td class="type">
<span class="param-type">nextCallback</span>
</td>
<td class="description last">A success callback of form next(err).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, <a href="easyrtc_public_obj.js.html#line1839">line 1839</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".connectionObj.setUsername"><span class="type-signature">(static) </span>connectionObj.setUsername<span class="signature">(username<span class="signature-attributes">nullable</span>, next)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the username string for the connection.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</t