openvidu/openvidu-node-client/docs/classes/openvidu.html

633 lines
38 KiB
HTML
Raw Normal View History

<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>OpenVidu | OpenVidu Node Client</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a style="position: absolute" href="/docs/reference-docs/openvidu-node-client/" class="title">
<img class="logo-small" style="height: 26px; margin-top: 7px" src="/img/logos/openvidu_vert_grey_bg_transp_cropped.png">
</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">Globals</a>
</li>
<li>
<a href="openvidu.html">OpenVidu</a>
</li>
</ul>
<h1>Class OpenVidu</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">OpenVidu</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="openvidu.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="openvidu.html#activesessions" class="tsd-kind-icon">active<wbr>Sessions</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="openvidu.html#createsession" class="tsd-kind-icon">create<wbr>Session</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="openvidu.html#deleterecording" class="tsd-kind-icon">delete<wbr>Recording</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="openvidu.html#fetch" class="tsd-kind-icon">fetch</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="openvidu.html#getrecording" class="tsd-kind-icon">get<wbr>Recording</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="openvidu.html#listrecordings" class="tsd-kind-icon">list<wbr>Recordings</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="openvidu.html#startrecording" class="tsd-kind-icon">start<wbr>Recording</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="openvidu.html#stoprecording" class="tsd-kind-icon">stop<wbr>Recording</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<h3>constructor</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>Open<wbr>Vidu<span class="tsd-signature-symbol">(</span>urlOpenViduServer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, secret<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="openvidu.html" class="tsd-signature-type">OpenVidu</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L80">OpenVidu.ts:80</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>urlOpenViduServer: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Public accessible IP where your instance of OpenVidu Server is up an running</p>
</div>
</div>
</li>
<li>
<h5>secret: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Secret used on OpenVidu Server initialization</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="openvidu.html" class="tsd-signature-type">OpenVidu</a></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="activesessions" class="tsd-anchor"></a>
<h3>active<wbr>Sessions</h3>
<div class="tsd-signature tsd-kind-icon">active<wbr>Sessions<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> =&nbsp;[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L80">OpenVidu.ts:80</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Array of active sessions. <strong>This value will remain unchanged since the last time method <a href="openvidu.html#fetch">OpenVidu.fetch</a>
was called</strong>. Exceptions to this rule are:</p>
</div>
<ul>
<li>Calling <a href="session.html#fetch">Session.fetch</a> updates that specific Session status</li>
<li>Calling <a href="session.html#close">Session.close</a> automatically removes the Session from the list of active Sessions</li>
<li>Calling <a href="session.html#forcedisconnect">Session.forceDisconnect</a> automatically updates the inner affected connections for that specific Session</li>
<li>Calling <a href="session.html#forceunpublish">Session.forceUnpublish</a> also automatically updates the inner affected connections for that specific Session</li>
<li>Calling <a href="openvidu.html#startrecording">OpenVidu.startRecording</a> and <a href="openvidu.html#stoprecording">OpenVidu.stopRecording</a> automatically updates the recording status of the
Session (<a href="session.html#recording">Session.recording</a>)</li>
</ul>
<p>To get the array of active sessions with their current actual value, you must call <a href="openvidu.html#fetch">OpenVidu.fetch</a> before consulting
property <a href="openvidu.html#activesessions">activeSessions</a></p>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="createsession" class="tsd-anchor"></a>
<h3>create<wbr>Session</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
2018-04-25 17:51:17 +02:00
<li class="tsd-signature tsd-kind-icon">create<wbr>Session<span class="tsd-signature-symbol">(</span>properties<span class="tsd-signature-symbol">?: </span><a href="../interfaces/sessionproperties.html" class="tsd-signature-type">SessionProperties</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L97">OpenVidu.ts:97</a></li>
</ul>
</aside>
2018-04-25 17:51:17 +02:00
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates an OpenVidu session. You can call <a href="session.html#getsessionid">Session.getSessionId</a> inside the resolved promise to retrieve the <code>sessionId</code></p>
2018-04-25 17:51:17 +02:00
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> properties: <a href="../interfaces/sessionproperties.html" class="tsd-signature-type">SessionProperties</a></h5>
</li>
</ul>
2018-04-25 17:51:17 +02:00
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise that is resolved to the <a href="session.html">Session</a> if success and rejected with an Error object if not.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="deleterecording" class="tsd-anchor"></a>
<h3>delete<wbr>Recording</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">delete<wbr>Recording<span class="tsd-signature-symbol">(</span>recordingId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L354">OpenVidu.ts:354</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Deletes a <a href="recording.html">Recording</a>. The recording must have status <code>stopped</code> or <code>available</code></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>recordingId: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise that is resolved if the Recording was successfully deleted and rejected with an Error object if not. This Error object has as <code>message</code> property with the following values:</p>
<ul>
<li><code>404</code>: no recording exists for the passed <code>recordingId</code></li>
<li><code>409</code>: the recording has <code>started</code> status. Stop it before deletion</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="fetch" class="tsd-anchor"></a>
<h3>fetch</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">fetch<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L398">OpenVidu.ts:398</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Updates every property of every active Session with the current status they have in OpenVidu Server.
After calling this method you can access the updated array of active sessions in <a href="openvidu.html#activesessions">activeSessions</a></p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A promise resolved to true if any Session status has changed with respect to the server, or to false if not.
This applies to any property or sub-property of any of the sessions locally stored in OpenVidu Node Client</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getrecording" class="tsd-anchor"></a>
<h3>get<wbr>Recording</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Recording<span class="tsd-signature-symbol">(</span>recordingId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L262">OpenVidu.ts:262</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Gets an existing <a href="recording.html">Recording</a></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>recordingId: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The <code>id</code> property of the <a href="recording.html">Recording</a> you want to retrieve</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise that is resolved to the <a href="recording.html">Recording</a> if it successfully stopped and rejected with an Error object if not. This Error object has as <code>message</code> property with the following values:</p>
<ul>
<li><code>404</code>: no recording exists for the passed <code>recordingId</code></li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="listrecordings" class="tsd-anchor"></a>
<h3>list<wbr>Recordings</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">list<wbr>Recordings<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L304">OpenVidu.ts:304</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Lists all existing recordings</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise that is resolved to an array with all existing recordings</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="startrecording" class="tsd-anchor"></a>
<h3>start<wbr>Recording</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">start<wbr>Recording<span class="tsd-signature-symbol">(</span>sessionId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></li>
<li class="tsd-signature tsd-kind-icon">start<wbr>Recording<span class="tsd-signature-symbol">(</span>sessionId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></li>
<li class="tsd-signature tsd-kind-icon">start<wbr>Recording<span class="tsd-signature-symbol">(</span>sessionId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, properties<span class="tsd-signature-symbol">: </span><a href="../interfaces/recordingproperties.html" class="tsd-signature-type">RecordingProperties</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L111">OpenVidu.ts:111</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Starts the recording of a <a href="session.html">Session</a></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>sessionId: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The <code>sessionId</code> of the <a href="session.html">Session</a> you want to start recording</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></h4>
2018-04-25 11:03:30 +02:00
<p>A Promise that is resolved to the <a href="recording.html">Recording</a> if it successfully started (the recording can be stopped with guarantees) and rejected with an Error object if not. This Error object has as <code>message</code> property with the following values:</p>
<ul>
<li><code>404</code>: no session exists for the passed <code>sessionId</code></li>
<li><code>400</code>: the session has no connected participants</li>
<li><code>409</code>: the session is not configured for using <a href="../enums/mediamode.html#routed">MediaMode.ROUTED</a> or it is already being recorded</li>
<li><code>501</code>: OpenVidu Server recording module is disabled (<code>openvidu.recording</code> property set to <code>false</code>)</li>
</ul>
</li>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L112">OpenVidu.ts:112</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Starts the recording of a <a href="session.html">Session</a></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>sessionId: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The <code>sessionId</code> of the <a href="session.html">Session</a> you want to start recording</p>
</div>
</div>
</li>
<li>
<h5>name: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The name you want to give to the video file. You can access this same value in your clients on recording events (<code>recordingStarted</code>, <code>recordingStopped</code>)
<strong>WARNING: this parameter follows an overwriting policy.</strong> If you name two recordings the same, the newest MP4 file will overwrite the oldest one</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></h4>
2018-04-25 11:03:30 +02:00
<p>A Promise that is resolved to the <a href="recording.html">Recording</a> if it successfully started (the recording can be stopped with guarantees) and rejected with an Error object if not. This Error object has as <code>message</code> property with the following values:</p>
<ul>
<li><code>404</code>: no session exists for the passed <code>sessionId</code></li>
<li><code>400</code>: the session has no connected participants</li>
<li><code>409</code>: the session is not configured for using <a href="../enums/mediamode.html#routed">MediaMode.ROUTED</a> or it is already being recorded</li>
<li><code>501</code>: OpenVidu Server recording module is disabled (<code>openvidu.recording</code> property set to <code>false</code>)</li>
</ul>
</li>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L113">OpenVidu.ts:113</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Starts the recording of a <a href="session.html">Session</a></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>sessionId: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The <code>sessionId</code> of the <a href="session.html">Session</a> you want to start recording</p>
</div>
</div>
</li>
<li>
<h5>properties: <a href="../interfaces/recordingproperties.html" class="tsd-signature-type">RecordingProperties</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></h4>
2018-04-25 11:03:30 +02:00
<p>A Promise that is resolved to the <a href="recording.html">Recording</a> if it successfully started (the recording can be stopped with guarantees) and rejected with an Error object if not. This Error object has as <code>message</code> property with the following values:</p>
<ul>
<li><code>404</code>: no session exists for the passed <code>sessionId</code></li>
<li><code>400</code>: the session has no connected participants</li>
<li><code>409</code>: the session is not configured for using <a href="../enums/mediamode.html#routed">MediaMode.ROUTED</a> or it is already being recorded</li>
<li><code>501</code>: OpenVidu Server recording module is disabled (<code>openvidu.recording</code> property set to <code>false</code>)</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="stoprecording" class="tsd-anchor"></a>
<h3>stop<wbr>Recording</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">stop<wbr>Recording<span class="tsd-signature-symbol">(</span>recordingId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L210">OpenVidu.ts:210</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Stops the recording of a <a href="session.html">Session</a></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>recordingId: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The <code>id</code> property of the <a href="recording.html">Recording</a> you want to stop</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="recording.html" class="tsd-signature-type">Recording</a><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise that is resolved to the <a href="recording.html">Recording</a> if it successfully stopped and rejected with an Error object if not. This Error object has as <code>message</code> property with the following values:</p>
<ul>
<li><code>404</code>: no recording exists for the passed <code>recordingId</code></li>
<li><code>406</code>: recording has <code>starting</code> status. Wait until <code>started</code> status before stopping the recording</li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../index.html"><em>Globals</em></a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-enum">
<a href="../enums/mediamode.html" class="tsd-kind-icon">Media<wbr>Mode</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/openvidurole.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Role</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/recordinglayout.html" class="tsd-kind-icon">Recording<wbr>Layout</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/recordingmode.html" class="tsd-kind-icon">Recording<wbr>Mode</a>
</li>
<li class=" tsd-kind-class">
<a href="connection.html" class="tsd-kind-icon">Connection</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-class">
<a href="openvidu.html" class="tsd-kind-icon">Open<wbr>Vidu</a>
<ul>
<li class=" tsd-kind-constructor tsd-parent-kind-class">
<a href="openvidu.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="openvidu.html#activesessions" class="tsd-kind-icon">active<wbr>Sessions</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="openvidu.html#createsession" class="tsd-kind-icon">create<wbr>Session</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="openvidu.html#deleterecording" class="tsd-kind-icon">delete<wbr>Recording</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="openvidu.html#fetch" class="tsd-kind-icon">fetch</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="openvidu.html#getrecording" class="tsd-kind-icon">get<wbr>Recording</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="openvidu.html#listrecordings" class="tsd-kind-icon">list<wbr>Recordings</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="openvidu.html#startrecording" class="tsd-kind-icon">start<wbr>Recording</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="openvidu.html#stoprecording" class="tsd-kind-icon">stop<wbr>Recording</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-class">
<a href="publisher.html" class="tsd-kind-icon">Publisher</a>
</li>
<li class=" tsd-kind-class">
<a href="recording.html" class="tsd-kind-icon">Recording</a>
</li>
<li class=" tsd-kind-class">
<a href="session.html" class="tsd-kind-icon">Session</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/recordingproperties.html" class="tsd-kind-icon">Recording<wbr>Properties</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/sessionproperties.html" class="tsd-kind-icon">Session<wbr>Properties</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/tokenoptions.html" class="tsd-kind-icon">Token<wbr>Options</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
<li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>