openvidu-browser TypeDocs updated

pull/73/head
pabloFuente 2018-06-01 14:39:38 +02:00
parent 9e79fe351e
commit 08dd9eaca6
98 changed files with 5195 additions and 1174 deletions

File diff suppressed because one or more lines are too long

View File

@ -224,6 +224,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -245,6 +254,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -124,7 +124,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L27">OpenViduInternal/Events/Event.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -171,11 +171,11 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a> <a name="target" class="tsd-anchor"></a>
<h3>target</h3> <h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a><span class="tsd-signature-symbol"> | </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></div> <div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L32">OpenViduInternal/Events/Event.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -191,7 +191,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L37">OpenViduInternal/Events/Event.ts:37</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -214,7 +214,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L53">OpenViduInternal/Events/Event.ts:53</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -237,19 +237,28 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L64">OpenViduInternal/Events/Event.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p> <p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
<ul>
<li><code>sessionDisconnected</code>: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes the HTML video element associated to it.</li>
<li><code>streamDestroyed</code>: if dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by <a href="session.html">Session</a>,
(<em>other user</em> has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it.</li>
</ul>
</div> </div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
@ -345,6 +354,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -366,6 +384,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -73,6 +73,9 @@
<li> <li>
<span class="target">Event</span> <span class="target">Event</span>
<ul class="tsd-hierarchy"> <ul class="tsd-hierarchy">
<li>
<a href="streammanagerevent.html" class="tsd-signature-type">StreamManagerEvent</a>
</li>
<li> <li>
<a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a> <a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a>
</li> </li>
@ -94,6 +97,9 @@
<li> <li>
<a href="publisherspeakingevent.html" class="tsd-signature-type">PublisherSpeakingEvent</a> <a href="publisherspeakingevent.html" class="tsd-signature-type">PublisherSpeakingEvent</a>
</li> </li>
<li>
<a href="streampropertychangedevent.html" class="tsd-signature-type">StreamPropertyChangedEvent</a>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -129,7 +135,7 @@
<div class="tsd-signature tsd-kind-icon">cancelable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <div class="tsd-signature tsd-kind-icon">cancelable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L27">OpenViduInternal/Events/Event.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -141,10 +147,10 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="target" class="tsd-anchor"></a> <a name="target" class="tsd-anchor"></a>
<h3>target</h3> <h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a><span class="tsd-signature-symbol"> | </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></div> <div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L32">OpenViduInternal/Events/Event.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -159,7 +165,7 @@
<div class="tsd-signature tsd-kind-icon">type<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <div class="tsd-signature tsd-kind-icon">type<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L37">OpenViduInternal/Events/Event.ts:37</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -181,7 +187,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L76">OpenViduInternal/Events/Event.ts:76</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
@ -198,7 +204,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L53">OpenViduInternal/Events/Event.ts:53</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -220,19 +226,28 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L64">OpenViduInternal/Events/Event.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p> <p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
<ul>
<li><code>sessionDisconnected</code>: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes the HTML video element associated to it.</li>
<li><code>streamDestroyed</code>: if dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by <a href="session.html">Session</a>,
(<em>other user</em> has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it.</li>
</ul>
</div> </div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
@ -325,6 +340,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -346,6 +370,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -138,7 +138,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L225">OpenVidu/LocalRecorder.ts:225</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L226">OpenVidu/LocalRecorder.ts:226</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -160,7 +160,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L244">OpenVidu/LocalRecorder.ts:244</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L245">OpenVidu/LocalRecorder.ts:245</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -182,7 +182,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L265">OpenVidu/LocalRecorder.ts:265</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L266">OpenVidu/LocalRecorder.ts:266</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -204,7 +204,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L157">OpenVidu/LocalRecorder.ts:157</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L158">OpenVidu/LocalRecorder.ts:158</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -227,7 +227,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L193">OpenVidu/LocalRecorder.ts:193</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L194">OpenVidu/LocalRecorder.ts:194</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -255,7 +255,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L59">OpenVidu/LocalRecorder.ts:59</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L60">OpenVidu/LocalRecorder.ts:60</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -278,7 +278,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L175">OpenVidu/LocalRecorder.ts:175</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L176">OpenVidu/LocalRecorder.ts:176</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -301,7 +301,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L135">OpenVidu/LocalRecorder.ts:135</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L136">OpenVidu/LocalRecorder.ts:136</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -324,7 +324,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L284">OpenVidu/LocalRecorder.ts:284</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L285">OpenVidu/LocalRecorder.ts:285</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -361,7 +361,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L324">OpenVidu/LocalRecorder.ts:324</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/LocalRecorder.ts#L325">OpenVidu/LocalRecorder.ts:325</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -490,6 +490,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -511,6 +520,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -122,7 +122,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L59">OpenVidu/OpenVidu.ts:59</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L62">OpenVidu/OpenVidu.ts:62</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-returns-title">Returns <a href="openvidu.html" class="tsd-signature-type">OpenVidu</a></h4> <h4 class="tsd-returns-title">Returns <a href="openvidu.html" class="tsd-signature-type">OpenVidu</a></h4>
@ -142,7 +142,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L201">OpenVidu/OpenVidu.ts:201</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L205">OpenVidu/OpenVidu.ts:205</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -165,7 +165,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L318">OpenVidu/OpenVidu.ts:318</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L322">OpenVidu/OpenVidu.ts:322</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -187,7 +187,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L219">OpenVidu/OpenVidu.ts:219</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L223">OpenVidu/OpenVidu.ts:223</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -209,7 +209,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L288">OpenVidu/OpenVidu.ts:288</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L292">OpenVidu/OpenVidu.ts:292</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -278,7 +278,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L192">OpenVidu/OpenVidu.ts:192</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L196">OpenVidu/OpenVidu.ts:196</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -312,7 +312,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L75">OpenVidu/OpenVidu.ts:75</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L78">OpenVidu/OpenVidu.ts:78</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -323,8 +323,9 @@ OV.getUserMedia({
<p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessDialogOpened</code> event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions <p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessDialogOpened</code> event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions
for your website. An <code>accessDialogClosed</code> event will also be dispatched after user clicks on &quot;Allow&quot; or &quot;Block&quot; in the pop-up.</p> for your website. An <code>accessDialogClosed</code> event will also be dispatched after user clicks on &quot;Allow&quot; or &quot;Block&quot; in the pop-up.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessAllowed</code> or <code>accessDenied</code> event once it has been granted access to the requested input devices or not.</p> <p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessAllowed</code> or <code>accessDenied</code> event once it has been granted access to the requested input devices or not.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (if <em>targetElement</em> not null or undefined)</p> <p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoElementCreated</code> event once a HTML video element has been added to DOM (only if you
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoPlaying</code> event once the local video starts playing (only if <code>videoElementCreated</code> event has been previously dispatched)</p> <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">let OpenVidu take care of the video players</a>). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>streamPlaying</code> event once the local streams starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -332,8 +333,8 @@ OV.getUserMedia({
<h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5> <h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher will be inserted (see <a href="../interfaces/publisherproperties.html#insertmode">PublisherProperties.insertMode</a>). If null or undefined no default video will be created for this Publisher <p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher will be inserted (see <a href="../interfaces/publisherproperties.html#insertmode">PublisherProperties.insertMode</a>). If <em>null</em> or <em>undefined</em> no default video will be created for this Publisher.
(you can always access the native MediaStream object by calling <em>Publisher.stream.getMediaStream()</em> and use it as <em>srcObject</em> of any HTML video element)</p> You can always call method <a href="publisher.html#addvideoelement">Publisher.addVideoElement</a> or <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a> to manage the video elements on your own (see <a href="/docs/how-do-i/manage-videos">Manage video players</a> section)</p>
</div> </div>
</div> </div>
</li> </li>
@ -343,7 +344,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L76">OpenVidu/OpenVidu.ts:76</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L79">OpenVidu/OpenVidu.ts:79</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -354,8 +355,9 @@ OV.getUserMedia({
<p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessDialogOpened</code> event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions <p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessDialogOpened</code> event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions
for your website. An <code>accessDialogClosed</code> event will also be dispatched after user clicks on &quot;Allow&quot; or &quot;Block&quot; in the pop-up.</p> for your website. An <code>accessDialogClosed</code> event will also be dispatched after user clicks on &quot;Allow&quot; or &quot;Block&quot; in the pop-up.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessAllowed</code> or <code>accessDenied</code> event once it has been granted access to the requested input devices or not.</p> <p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessAllowed</code> or <code>accessDenied</code> event once it has been granted access to the requested input devices or not.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (if <em>targetElement</em> not null or undefined)</p> <p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoElementCreated</code> event once a HTML video element has been added to DOM (only if you
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoPlaying</code> event once the local video starts playing (only if <code>videoElementCreated</code> event has been previously dispatched)</p> <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">let OpenVidu take care of the video players</a>). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>streamPlaying</code> event once the local streams starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -363,8 +365,8 @@ OV.getUserMedia({
<h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5> <h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher will be inserted (see <a href="../interfaces/publisherproperties.html#insertmode">PublisherProperties.insertMode</a>). If null or undefined no default video will be created for this Publisher <p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher will be inserted (see <a href="../interfaces/publisherproperties.html#insertmode">PublisherProperties.insertMode</a>). If <em>null</em> or <em>undefined</em> no default video will be created for this Publisher.
(you can always access the native MediaStream object by calling <em>Publisher.stream.getMediaStream()</em> and use it as <em>srcObject</em> of any HTML video element)</p> You can always call method <a href="publisher.html#addvideoelement">Publisher.addVideoElement</a> or <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a> to manage the video elements on your own (see <a href="/docs/how-do-i/manage-videos">Manage video players</a> section)</p>
</div> </div>
</div> </div>
</li> </li>
@ -377,7 +379,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L77">OpenVidu/OpenVidu.ts:77</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L80">OpenVidu/OpenVidu.ts:80</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -388,8 +390,9 @@ OV.getUserMedia({
<p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessDialogOpened</code> event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions <p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessDialogOpened</code> event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions
for your website. An <code>accessDialogClosed</code> event will also be dispatched after user clicks on &quot;Allow&quot; or &quot;Block&quot; in the pop-up.</p> for your website. An <code>accessDialogClosed</code> event will also be dispatched after user clicks on &quot;Allow&quot; or &quot;Block&quot; in the pop-up.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessAllowed</code> or <code>accessDenied</code> event once it has been granted access to the requested input devices or not.</p> <p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessAllowed</code> or <code>accessDenied</code> event once it has been granted access to the requested input devices or not.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (if <em>targetElement</em> not null or undefined)</p> <p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoElementCreated</code> event once a HTML video element has been added to DOM (only if you
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoPlaying</code> event once the local video starts playing (only if <code>videoElementCreated</code> event has been previously dispatched)</p> <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">let OpenVidu take care of the video players</a>). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>streamPlaying</code> event once the local streams starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -397,8 +400,8 @@ OV.getUserMedia({
<h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5> <h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher will be inserted (see <a href="../interfaces/publisherproperties.html#insertmode">PublisherProperties.insertMode</a>). If null or undefined no default video will be created for this Publisher <p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher will be inserted (see <a href="../interfaces/publisherproperties.html#insertmode">PublisherProperties.insertMode</a>). If <em>null</em> or <em>undefined</em> no default video will be created for this Publisher.
(you can always access the native MediaStream object by calling <em>Publisher.stream.getMediaStream()</em> and use it as <em>srcObject</em> of any HTML video element)</p> You can always call method <a href="publisher.html#addvideoelement">Publisher.addVideoElement</a> or <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a> to manage the video elements on your own (see <a href="/docs/how-do-i/manage-videos">Manage video players</a> section)</p>
</div> </div>
</div> </div>
</li> </li>
@ -435,7 +438,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L78">OpenVidu/OpenVidu.ts:78</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L81">OpenVidu/OpenVidu.ts:81</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -446,8 +449,9 @@ OV.getUserMedia({
<p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessDialogOpened</code> event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions <p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessDialogOpened</code> event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions
for your website. An <code>accessDialogClosed</code> event will also be dispatched after user clicks on &quot;Allow&quot; or &quot;Block&quot; in the pop-up.</p> for your website. An <code>accessDialogClosed</code> event will also be dispatched after user clicks on &quot;Allow&quot; or &quot;Block&quot; in the pop-up.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessAllowed</code> or <code>accessDenied</code> event once it has been granted access to the requested input devices or not.</p> <p>The <a href="publisher.html">Publisher</a> object will dispatch an <code>accessAllowed</code> or <code>accessDenied</code> event once it has been granted access to the requested input devices or not.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (if <em>targetElement</em> not null or undefined)</p> <p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoElementCreated</code> event once a HTML video element has been added to DOM (only if you
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>videoPlaying</code> event once the local video starts playing (only if <code>videoElementCreated</code> event has been previously dispatched)</p> <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">let OpenVidu take care of the video players</a>). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>The <a href="publisher.html">Publisher</a> object will dispatch a <code>streamPlaying</code> event once the local streams starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -455,8 +459,8 @@ OV.getUserMedia({
<h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5> <h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher will be inserted (see <a href="../interfaces/publisherproperties.html#insertmode">PublisherProperties.insertMode</a>). If null or undefined no default video will be created for this Publisher <p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher will be inserted (see <a href="../interfaces/publisherproperties.html#insertmode">PublisherProperties.insertMode</a>). If <em>null</em> or <em>undefined</em> no default video will be created for this Publisher.
(you can always access the native MediaStream object by calling <em>Publisher.stream.getMediaStream()</em> and use it as <em>srcObject</em> of any HTML video element)</p> You can always call method <a href="publisher.html#addvideoelement">Publisher.addVideoElement</a> or <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a> to manage the video elements on your own (see <a href="/docs/how-do-i/manage-videos">Manage video players</a> section)</p>
</div> </div>
</div> </div>
</li> </li>
@ -506,7 +510,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L163">OpenVidu/OpenVidu.ts:163</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L167">OpenVidu/OpenVidu.ts:167</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -528,7 +532,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L164">OpenVidu/OpenVidu.ts:164</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L168">OpenVidu/OpenVidu.ts:168</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
@ -554,7 +558,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L69">OpenVidu/OpenVidu.ts:69</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L72">OpenVidu/OpenVidu.ts:72</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -576,7 +580,7 @@ OV.getUserMedia({
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L333">OpenVidu/OpenVidu.ts:333</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L337">OpenVidu/OpenVidu.ts:337</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -698,6 +702,15 @@ OV.getUserMedia({
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -719,6 +732,9 @@ OV.getUserMedia({
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -104,7 +104,7 @@
<div class="tsd-signature tsd-kind-icon">message<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <div class="tsd-signature tsd-kind-icon">message<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L44">OpenViduInternal/Enums/OpenViduError.ts:44</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L106">OpenViduInternal/Enums/OpenViduError.ts:106</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
@ -114,7 +114,7 @@
<div class="tsd-signature tsd-kind-icon">name<span class="tsd-signature-symbol">:</span> <a href="../enums/openviduerrorname.html" class="tsd-signature-type">OpenViduErrorName</a></div> <div class="tsd-signature tsd-kind-icon">name<span class="tsd-signature-symbol">:</span> <a href="../enums/openviduerrorname.html" class="tsd-signature-type">OpenViduErrorName</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L43">OpenViduInternal/Enums/OpenViduError.ts:43</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L105">OpenViduInternal/Enums/OpenViduError.ts:105</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
@ -193,6 +193,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -214,6 +223,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -76,11 +76,16 @@
</section> </section>
<section class="tsd-panel tsd-hierarchy"> <section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3> <h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="streammanager.html" class="tsd-signature-type">StreamManager</a>
<ul class="tsd-hierarchy"> <ul class="tsd-hierarchy">
<li> <li>
<span class="target">Publisher</span> <span class="target">Publisher</span>
</li> </li>
</ul> </ul>
</li>
</ul>
</section> </section>
<section class="tsd-panel"> <section class="tsd-panel">
<h3>Implements</h3> <h3>Implements</h3>
@ -96,18 +101,23 @@
<h3>Properties</h3> <h3>Properties</h3>
<ul class="tsd-index-list"> <ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="publisher.html#accessallowed" class="tsd-kind-icon">access<wbr>Allowed</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="publisher.html#accessallowed" class="tsd-kind-icon">access<wbr>Allowed</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="publisher.html#element" class="tsd-kind-icon">element</a></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="publisher.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="publisher.html#id" class="tsd-kind-icon">id</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="publisher.html#issubscribedtoremote" class="tsd-kind-icon">is<wbr>Subscribed<wbr>ToRemote</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="publisher.html#remote" class="tsd-kind-icon">remote</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="publisher.html#session" class="tsd-kind-icon">session</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="publisher.html#session" class="tsd-kind-icon">session</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="publisher.html#stream" class="tsd-kind-icon">stream</a></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="publisher.html#stream" class="tsd-kind-icon">stream</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="publisher.html#targetelement" class="tsd-kind-icon">target<wbr>Element</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="publisher.html#videos" class="tsd-kind-icon">videos</a></li>
</ul> </ul>
</section> </section>
<section class="tsd-index-section "> <section class="tsd-index-section ">
<h3>Methods</h3> <h3>Methods</h3>
<ul class="tsd-index-list"> <ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#off" class="tsd-kind-icon">off</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="publisher.html#addvideoelement" class="tsd-kind-icon">add<wbr>Video<wbr>Element</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#on" class="tsd-kind-icon">on</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="publisher.html#createvideoelement" class="tsd-kind-icon">create<wbr>Video<wbr>Element</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#once" class="tsd-kind-icon">once</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="publisher.html#off" class="tsd-kind-icon">off</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-overwrite"><a href="publisher.html#on" class="tsd-kind-icon">on</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-overwrite"><a href="publisher.html#once" class="tsd-kind-icon">once</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#publishaudio" class="tsd-kind-icon">publish<wbr>Audio</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#publishaudio" class="tsd-kind-icon">publish<wbr>Audio</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#publishvideo" class="tsd-kind-icon">publish<wbr>Video</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#publishvideo" class="tsd-kind-icon">publish<wbr>Video</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#subscribetoremote" class="tsd-kind-icon">subscribe<wbr>ToRemote</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="publisher.html#subscribetoremote" class="tsd-kind-icon">subscribe<wbr>ToRemote</a></li>
@ -133,10 +143,30 @@
</div> </div>
</div> </div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="id" class="tsd-anchor"></a>
<h3>id</h3>
<div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#id">id</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L69">OpenVidu/StreamManager.ts:69</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><code>id</code> attribute of the DOM video element displaying the Publisher/Subscriber&#39;s stream. This property is only defined if:</p>
<ul>
<li><a href="publisher.html">Publisher</a> has been initialized by calling method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> with a valid <code>targetElement</code> parameter</li>
<li><a href="subscriber.html">Subscriber</a> has been initialized by calling method <a href="session.html#subscribe">Session.subscribe</a> with a valid <code>targetElement</code> parameter</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="element" class="tsd-anchor"></a> <a name="issubscribedtoremote" class="tsd-anchor"></a>
<h3>element</h3> <h3>is<wbr>Subscribed<wbr>ToRemote</h3>
<div class="tsd-signature tsd-kind-icon">element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLElement</span></div> <div class="tsd-signature tsd-kind-icon">is<wbr>Subscribed<wbr>ToRemote<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> =&nbsp;false</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L46">OpenVidu/Publisher.ts:46</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L46">OpenVidu/Publisher.ts:46</a></li>
@ -144,22 +174,27 @@
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element in which the Publisher&#39;s video has been inserted</p> <p>Whether you have called <a href="publisher.html#subscribetoremote">Publisher.subscribeToRemote</a> with value <code>true</code> or <code>false</code> (<em>false</em> by default)</p>
</div> </div>
</div> </div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="id" class="tsd-anchor"></a> <a name="remote" class="tsd-anchor"></a>
<h3>id</h3> <h3>remote</h3>
<div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <div class="tsd-signature tsd-kind-icon">remote<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#remote">remote</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L51">OpenVidu/Publisher.ts:51</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L55">OpenVidu/StreamManager.ts:55</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>DOM id of the Publisher&#39;s video element</p> <p>Whether the Stream represented in the DOM is local or remote</p>
<ul>
<li><code>false</code> for <a href="publisher.html">Publisher</a></li>
<li><code>true</code> for <a href="subscriber.html">Subscriber</a></li>
</ul>
</div> </div>
</div> </div>
</section> </section>
@ -169,7 +204,7 @@
<div class="tsd-signature tsd-kind-icon">session<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a></div> <div class="tsd-signature tsd-kind-icon">session<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L56">OpenVidu/Publisher.ts:56</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L51">OpenVidu/Publisher.ts:51</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -178,35 +213,148 @@
</div> </div>
</div> </div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="stream" class="tsd-anchor"></a> <a name="stream" class="tsd-anchor"></a>
<h3>stream</h3> <h3>stream</h3>
<div class="tsd-signature tsd-kind-icon">stream<span class="tsd-signature-symbol">:</span> <a href="stream.html" class="tsd-signature-type">Stream</a></div> <div class="tsd-signature tsd-kind-icon">stream<span class="tsd-signature-symbol">:</span> <a href="stream.html" class="tsd-signature-type">Stream</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#stream">stream</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L61">OpenVidu/Publisher.ts:61</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L43">OpenVidu/StreamManager.ts:43</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>The <a href="stream.html">Stream</a> that you are publishing</p> <p>The Stream represented in the DOM by the Publisher/Subscriber</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="targetelement" class="tsd-anchor"></a>
<h3>target<wbr>Element</h3>
<div class="tsd-signature tsd-kind-icon">target<wbr>Element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLElement</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#targetelement">targetElement</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L62">OpenVidu/StreamManager.ts:62</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The DOM HTMLElement assigned as target element when creating the video for the Publisher/Subscriber. This property is only defined if:</p>
<ul>
<li><a href="publisher.html">Publisher</a> has been initialized by calling method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> with a valid <code>targetElement</code> parameter</li>
<li><a href="subscriber.html">Subscriber</a> has been initialized by calling method <a href="session.html#subscribe">Session.subscribe</a> with a valid <code>targetElement</code> parameter</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="videos" class="tsd-anchor"></a>
<h3>videos</h3>
<div class="tsd-signature tsd-kind-icon">videos<span class="tsd-signature-symbol">:</span> <a href="../interfaces/streammanagervideo.html" class="tsd-signature-type">StreamManagerVideo</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> =&nbsp;[]</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#videos">videos</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L48">OpenVidu/StreamManager.ts:48</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>All the videos displaying the Stream of this Publisher/Subscriber</p>
</div> </div>
</div> </div>
</section> </section>
</section> </section>
<section class="tsd-panel-group tsd-member-group "> <section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2> <h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="off" class="tsd-anchor"></a> <a name="addvideoelement" class="tsd-anchor"></a>
<h3>off</h3> <h3>add<wbr>Video<wbr>Element</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></li> <li class="tsd-signature tsd-kind-icon">add<wbr>Video<wbr>Element<span class="tsd-signature-symbol">(</span>video<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLVideoElement</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#addvideoelement">addVideoElement</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L278">OpenVidu/Publisher.ts:278</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L220">OpenVidu/StreamManager.ts:220</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Makes <code>video</code> element parameter display this <a href="publisher.html#stream">stream</a>. This is useful when you are
<a href="/docs/how-do-i/manage-videos/#you-take-care-of-the-video-players">managing the video elements on your own</a></p>
</div>
<p>Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be
disassociated from that previous Publisher/Subscriber and to be associated to this one.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>video: <span class="tsd-signature-type">HTMLVideoElement</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
<p>1 if the video wasn&#39;t associated to any other Publisher/Subscriber and has been successfully added to this one.
0 if the video was already added to this Publisher/Subscriber. -1 if the video was previously associated to any other
Publisher/Subscriber and has been successfully disassociated from that one and properly added to this one.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="createvideoelement" class="tsd-anchor"></a>
<h3>create<wbr>Video<wbr>Element</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">create<wbr>Video<wbr>Element<span class="tsd-signature-symbol">(</span>targetElement<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span>, insertMode<span class="tsd-signature-symbol">?: </span><a href="../enums/videoinsertmode.html" class="tsd-signature-type">VideoInsertMode</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLVideoElement</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#createvideoelement">createVideoElement</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L266">OpenVidu/StreamManager.ts:266</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates a new video element displaying this <a href="publisher.html#stream">stream</a>. This allows you to have multiple video elements displaying the same media stream.</p>
</div>
<h4 id="events-dispatched">Events dispatched</h4>
<p>The Publisher/Subscriber object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM. See <a href="videoelementevent.html">VideoElementEvent</a></p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher/Subscriber will be inserted</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> insertMode: <a href="../enums/videoinsertmode.html" class="tsd-signature-type">VideoInsertMode</a></h5>
<div class="tsd-comment tsd-typography">
<p>How the video element will be inserted accordingly to <code>targetElemet</code></p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">HTMLVideoElement</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="off" class="tsd-anchor"></a>
<h3>off</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#off">off</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L200">OpenVidu/StreamManager.ts:200</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -224,14 +372,14 @@
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li class="tsd-parameter-siganture"> <li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported"> <ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="streamevent.html" class="tsd-signature-type">StreamEvent</a><span class="tsd-signature-symbol"> | </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li> <li>
<h5>event: <a href="streamevent.html" class="tsd-signature-type">StreamEvent</a><span class="tsd-signature-symbol"> | </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a></h5> <h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@ -241,21 +389,22 @@
</ul> </ul>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <a href="publisher.html" class="tsd-signature-type">Publisher</a></h4> <h4 class="tsd-returns-title">Returns <a href="streammanager.html" class="tsd-signature-type">StreamManager</a></h4>
</li> </li>
</ul> </ul>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<a name="on" class="tsd-anchor"></a> <a name="on" class="tsd-anchor"></a>
<h3>on</h3> <h3>on</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/eventdispatcher.html" class="tsd-signature-type">EventDispatcher</a></li> <li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/eventdispatcher.html" class="tsd-signature-type">EventDispatcher</a></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Overrides <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#on">on</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L128">OpenVidu/Publisher.ts:128</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L105">OpenVidu/Publisher.ts:105</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -273,14 +422,14 @@
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li class="tsd-parameter-siganture"> <li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported"> <ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="streamevent.html" class="tsd-signature-type">StreamEvent</a><span class="tsd-signature-symbol"> | </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li> <li>
<h5>event: <a href="streamevent.html" class="tsd-signature-type">StreamEvent</a><span class="tsd-signature-symbol"> | </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a></h5> <h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@ -294,17 +443,18 @@
</li> </li>
</ul> </ul>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<a name="once" class="tsd-anchor"></a> <a name="once" class="tsd-anchor"></a>
<h3>once</h3> <h3>once</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></li> <li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Overrides <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#once">once</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L203">OpenVidu/Publisher.ts:203</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L142">OpenVidu/Publisher.ts:142</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -322,14 +472,14 @@
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li class="tsd-parameter-siganture"> <li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported"> <ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="streamevent.html" class="tsd-signature-type">StreamEvent</a><span class="tsd-signature-symbol"> | </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li> <li>
<h5>event: <a href="streamevent.html" class="tsd-signature-type">StreamEvent</a><span class="tsd-signature-symbol"> | </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a></h5> <h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@ -353,7 +503,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L103">OpenVidu/Publisher.ts:103</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L76">OpenVidu/Publisher.ts:76</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -384,7 +534,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L112">OpenVidu/Publisher.ts:112</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L86">OpenVidu/Publisher.ts:86</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -409,20 +559,26 @@
<a name="subscribetoremote" class="tsd-anchor"></a> <a name="subscribetoremote" class="tsd-anchor"></a>
<h3>subscribe<wbr>ToRemote</h3> <h3>subscribe<wbr>ToRemote</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">subscribe<wbr>ToRemote<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon">subscribe<wbr>ToRemote<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L120">OpenVidu/Publisher.ts:120</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L95">OpenVidu/Publisher.ts:95</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Call this method before <a href="session.html#publish">Session.publish</a> to subscribe to your Publisher&#39;s stream as any other user would do. The local video will be automatically replaced by the remote video</p> <p>Call this method before <a href="session.html#publish">Session.publish</a> to subscribe to your Publisher&#39;s remote stream instead of using the local stream, as any other user would do.</p>
</div> </div>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> value: <span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
</ul> </ul>
@ -474,25 +630,40 @@
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class">
<a href="publisher.html#accessallowed" class="tsd-kind-icon">access<wbr>Allowed</a> <a href="publisher.html#accessallowed" class="tsd-kind-icon">access<wbr>Allowed</a>
</li> </li>
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="publisher.html#element" class="tsd-kind-icon">element</a> <a href="publisher.html#id" class="tsd-kind-icon">id</a>
</li> </li>
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class">
<a href="publisher.html#id" class="tsd-kind-icon">id</a> <a href="publisher.html#issubscribedtoremote" class="tsd-kind-icon">is<wbr>Subscribed<wbr>ToRemote</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="publisher.html#remote" class="tsd-kind-icon">remote</a>
</li> </li>
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class">
<a href="publisher.html#session" class="tsd-kind-icon">session</a> <a href="publisher.html#session" class="tsd-kind-icon">session</a>
</li> </li>
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="publisher.html#stream" class="tsd-kind-icon">stream</a> <a href="publisher.html#stream" class="tsd-kind-icon">stream</a>
</li> </li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="publisher.html#targetelement" class="tsd-kind-icon">target<wbr>Element</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="publisher.html#videos" class="tsd-kind-icon">videos</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="publisher.html#addvideoelement" class="tsd-kind-icon">add<wbr>Video<wbr>Element</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="publisher.html#createvideoelement" class="tsd-kind-icon">create<wbr>Video<wbr>Element</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="publisher.html#off" class="tsd-kind-icon">off</a> <a href="publisher.html#off" class="tsd-kind-icon">off</a>
</li> </li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<a href="publisher.html#on" class="tsd-kind-icon">on</a> <a href="publisher.html#on" class="tsd-kind-icon">on</a>
</li> </li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<a href="publisher.html#once" class="tsd-kind-icon">once</a> <a href="publisher.html#once" class="tsd-kind-icon">once</a>
</li> </li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-method tsd-parent-kind-class">
@ -529,6 +700,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -550,6 +730,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -131,7 +131,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L27">OpenViduInternal/Events/Event.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -173,11 +173,11 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a> <a name="target" class="tsd-anchor"></a>
<h3>target</h3> <h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a><span class="tsd-signature-symbol"> | </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></div> <div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L32">OpenViduInternal/Events/Event.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -193,7 +193,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L37">OpenViduInternal/Events/Event.ts:37</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -216,7 +216,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L53">OpenViduInternal/Events/Event.ts:53</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -239,19 +239,28 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L64">OpenViduInternal/Events/Event.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p> <p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
<ul>
<li><code>sessionDisconnected</code>: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes the HTML video element associated to it.</li>
<li><code>streamDestroyed</code>: if dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by <a href="session.html">Session</a>,
(<em>other user</em> has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it.</li>
</ul>
</div> </div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
@ -347,6 +356,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -368,6 +386,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -124,7 +124,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L27">OpenViduInternal/Events/Event.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -172,11 +172,11 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a> <a name="target" class="tsd-anchor"></a>
<h3>target</h3> <h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a><span class="tsd-signature-symbol"> | </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></div> <div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L32">OpenViduInternal/Events/Event.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -192,7 +192,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L37">OpenViduInternal/Events/Event.ts:37</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -215,7 +215,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L53">OpenViduInternal/Events/Event.ts:53</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -238,19 +238,28 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L64">OpenViduInternal/Events/Event.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p> <p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
<ul>
<li><code>sessionDisconnected</code>: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes the HTML video element associated to it.</li>
<li><code>streamDestroyed</code>: if dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by <a href="session.html">Session</a>,
(<em>other user</em> has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it.</li>
</ul>
</div> </div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
@ -346,6 +355,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -367,6 +385,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -71,7 +71,7 @@
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Represents a video call. It can also be seen as a videoconference room where multiple users can connect. <p>Represents a video call. It can also be seen as a videoconference room where multiple users can connect.
Participants who publish their videos to a session will be seen by the rest of users connected to that specific session. Participants who publish their videos to a session can be seen by the rest of users connected to that specific session.
Initialized with <a href="openvidu.html#initsession">OpenVidu.initSession</a> method</p> Initialized with <a href="openvidu.html#initsession">OpenVidu.initSession</a> method</p>
</div> </div>
</div> </div>
@ -99,6 +99,7 @@
<ul class="tsd-index-list"> <ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="session.html#connection" class="tsd-kind-icon">connection</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="session.html#connection" class="tsd-kind-icon">connection</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="session.html#sessionid" class="tsd-kind-icon">session<wbr>Id</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="session.html#sessionid" class="tsd-kind-icon">session<wbr>Id</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="session.html#streammanagers" class="tsd-kind-icon">stream<wbr>Managers</a></li>
</ul> </ul>
</section> </section>
<section class="tsd-index-section "> <section class="tsd-index-section ">
@ -128,7 +129,7 @@
<div class="tsd-signature tsd-kind-icon">connection<span class="tsd-signature-symbol">:</span> <a href="connection.html" class="tsd-signature-type">Connection</a></div> <div class="tsd-signature tsd-kind-icon">connection<span class="tsd-signature-symbol">:</span> <a href="connection.html" class="tsd-signature-type">Connection</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L52">OpenVidu/Session.ts:52</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L53">OpenVidu/Session.ts:53</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -143,12 +144,27 @@
<div class="tsd-signature tsd-kind-icon">session<wbr>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <div class="tsd-signature tsd-kind-icon">session<wbr>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L57">OpenVidu/Session.ts:57</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L58">OpenVidu/Session.ts:58</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Unique identifier of the Session. This is the same value you pass when calling <a href="openvidu.html#initsession">OpenVidu.initSession</a></p> <p>Unique identifier of the Session</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="streammanagers" class="tsd-anchor"></a>
<h3>stream<wbr>Managers</h3>
<div class="tsd-signature tsd-kind-icon">stream<wbr>Managers<span class="tsd-signature-symbol">:</span> <a href="streammanager.html" class="tsd-signature-type">StreamManager</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-browser/src/OpenVidu/Session.ts#L63">OpenVidu/Session.ts:63</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Collection of all StreamManagers of this Session (<a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a>)</p>
</div> </div>
</div> </div>
</section> </section>
@ -166,7 +182,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L91">OpenVidu/Session.ts:91</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L97">OpenVidu/Session.ts:97</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -185,8 +201,8 @@
<li>Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have <li>Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have
successfully connected will also dispatch a <code>connectionCreated</code> event when they do so.</li> successfully connected will also dispatch a <code>connectionCreated</code> event when they do so.</li>
</ul> </ul>
<p>The <a href="session.html">Session</a> object of the local participant will also dispatch a <code>streamCreated</code> event for each remote active <a href="publisher.html">Publisher</a> after dispatching all remote <p>The <a href="session.html">Session</a> object of the local participant will also dispatch a <code>streamCreated</code> event for each remote active <a href="publisher.html">Publisher</a> that was already streaming
<code>connectionCreated</code> events.</p> when connecting, just after dispatching all remote <code>connectionCreated</code> events.</p>
<p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>connectionCreated</code> event.</p> <p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>connectionCreated</code> event.</p>
<p>See <a href="connectionevent.html">ConnectionEvent</a> and <a href="streamevent.html">StreamEvent</a> to learn more.</p> <p>See <a href="connectionevent.html">ConnectionEvent</a> and <a href="streamevent.html">StreamEvent</a> to learn more.</p>
</div> </div>
@ -197,12 +213,12 @@
</li> </li>
</ul> </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">any</span><span class="tsd-signature-symbol">&gt;</span></h4> <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">any</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise to which you must subscribe that is resolved if the recording successfully started and rejected with an Error object if not</p> <p>A Promise to which you must subscribe that is resolved if the the connection to the Session was successful and rejected with an Error object if not</p>
</li> </li>
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L92">OpenVidu/Session.ts:92</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L98">OpenVidu/Session.ts:98</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -221,8 +237,8 @@
<li>Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have <li>Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have
successfully connected will also dispatch a <code>connectionCreated</code> event when they do so.</li> successfully connected will also dispatch a <code>connectionCreated</code> event when they do so.</li>
</ul> </ul>
<p>The <a href="session.html">Session</a> object of the local participant will also dispatch a <code>streamCreated</code> event for each remote active <a href="publisher.html">Publisher</a> after dispatching all remote <p>The <a href="session.html">Session</a> object of the local participant will also dispatch a <code>streamCreated</code> event for each remote active <a href="publisher.html">Publisher</a> that was already streaming
<code>connectionCreated</code> events.</p> when connecting, just after dispatching all remote <code>connectionCreated</code> events.</p>
<p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>connectionCreated</code> event.</p> <p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>connectionCreated</code> event.</p>
<p>See <a href="connectionevent.html">ConnectionEvent</a> and <a href="streamevent.html">StreamEvent</a> to learn more.</p> <p>See <a href="connectionevent.html">ConnectionEvent</a> and <a href="streamevent.html">StreamEvent</a> to learn more.</p>
</div> </div>
@ -236,7 +252,7 @@
</li> </li>
</ul> </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">any</span><span class="tsd-signature-symbol">&gt;</span></h4> <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">any</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise to which you must subscribe that is resolved if the recording successfully started and rejected with an Error object if not</p> <p>A Promise to which you must subscribe that is resolved if the the connection to the Session was successful and rejected with an Error object if not</p>
</li> </li>
</ul> </ul>
</section> </section>
@ -250,7 +266,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L166">OpenVidu/Session.ts:166</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L177">OpenVidu/Session.ts:177</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -260,16 +276,21 @@
<h4 id="events-dispatched">Events dispatched</h4> <h4 id="events-dispatched">Events dispatched</h4>
<p>The <a href="session.html">Session</a> object of the local participant will dispatch a <code>sessionDisconnected</code> event. <p>The <a href="session.html">Session</a> object of the local participant will dispatch a <code>sessionDisconnected</code> event.
This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also delete the HTML video element associated to it. and also deletes any HTML video element associated to each Subscriber (only those <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">created by OpenVidu Browser</a>).
Call <code>event.preventDefault()</code> to avoid this beahviour and take care of disposing and cleaning all the Subscriber objects yourself. See <a href="sessiondisconnectedevent.html">SessionDisconnectedEvent</a> to learn more.</p> For every video removed, each Subscriber object will dispatch a <code>videoElementDestroyed</code> event.
Call <code>event.preventDefault()</code> uppon event <code>sessionDisconnected</code> to avoid this behaviour and take care of disposing and cleaning all the Subscriber objects yourself.
See <a href="sessiondisconnectedevent.html">SessionDisconnectedEvent</a> and <a href="videoelementevent.html">VideoElementEvent</a> to learn more to learn more.</p>
<p>The <a href="publisher.html">Publisher</a> object of the local participant will dispatch a <code>streamDestroyed</code> event if there is a <a href="publisher.html">Publisher</a> object publishing to the session. <p>The <a href="publisher.html">Publisher</a> object of the local participant will dispatch a <code>streamDestroyed</code> event if there is a <a href="publisher.html">Publisher</a> object publishing to the session.
This event will automatically stop all media tracks and delete the HTML video element associated to it. This event will automatically stop all media tracks and delete any HTML video element associated to it (only those <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">created by OpenVidu Browser</a>).
Call <code>event.preventDefault()</code> if you want clean the Publisher object yourself or re-publish it in a different Session (to do so it is a mandatory For every video removed, the Publisher object will dispatch a <code>videoElementDestroyed</code> event.
requirement to call <code>Session.unpublish()</code> or/and <code>Session.disconnect()</code> in the previous session). See <a href="streamevent.html">StreamEvent</a> to learn more.</p> Call <code>event.preventDefault()</code> uppon event <code>streamDestroyed</code> if you want to clean the Publisher object on your own or re-publish it in a different Session (to do so it is a mandatory requirement to call <code>Session.unpublish()</code>
or/and <code>Session.disconnect()</code> in the previous session). See <a href="streamevent.html">StreamEvent</a> and <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>streamDestroyed</code> event if the disconnected participant was publishing. <p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>streamDestroyed</code> event if the disconnected participant was publishing.
This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and delete the HTML video element associated to it. and also deletes any HTML video element associated to that Subscriber (only those <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">created by OpenVidu Browser</a>).
Call <code>event.preventDefault()</code> to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. See <a href="streamevent.html">StreamEvent</a> to learn more.</p> For every video removed, the Subscriber object will dispatch a <code>videoElementDestroyed</code> event.
Call <code>event.preventDefault()</code> uppon event <code>streamDestroyed</code> to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself.
See <a href="streamevent.html">StreamEvent</a> and <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>connectionDestroyed</code> event in any case. See <a href="connectionevent.html">ConnectionEvent</a> to learn more.</p> <p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>connectionDestroyed</code> event in any case. See <a href="connectionevent.html">ConnectionEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@ -286,7 +307,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L494">OpenVidu/Session.ts:494</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L514">OpenVidu/Session.ts:514</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -335,7 +356,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L436">OpenVidu/Session.ts:436</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L456">OpenVidu/Session.ts:456</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -384,7 +405,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L465">OpenVidu/Session.ts:465</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L485">OpenVidu/Session.ts:485</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -433,17 +454,16 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L305">OpenVidu/Session.ts:305</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L320">OpenVidu/Session.ts:320</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Publishes the participant&#39;s audio-video stream contained in <code>publisher</code> object to the session</p> <p>Publishes to the Session the Publisher object</p>
</div> </div>
<h4 id="events-dispatched">Events dispatched</h4> <h4 id="events-dispatched">Events dispatched</h4>
<p>The local <a href="publisher.html">Publisher</a> object will dispatch a <code>streamCreated</code> event upon successful termination of this method. See <a href="streamevent.html">StreamEvent</a> to learn more.</p> <p>The local <a href="publisher.html">Publisher</a> object will dispatch a <code>streamCreated</code> event upon successful termination of this method. See <a href="streamevent.html">StreamEvent</a> to learn more.</p>
<p>The local <a href="publisher.html">Publisher</a> object will dispatch a <code>remoteVideoPlaying</code> event only if <a href="publisher.html#subscribetoremote">Publisher.subscribeToRemote</a> was called before this method, once the remote video starts playing. <p>The local <a href="publisher.html">Publisher</a> object will dispatch a <code>streamPlaying</code> once the media stream starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>streamCreated</code> event so they can subscribe to it. See <a href="streamevent.html">StreamEvent</a> to learn more.</p> <p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>streamCreated</code> event so they can subscribe to it. See <a href="streamevent.html">StreamEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
@ -453,7 +473,7 @@
</li> </li>
</ul> </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">any</span><span class="tsd-signature-symbol">&gt;</span></h4> <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">any</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise (to which you can optionally subscribe to) that is resolved if the publisher was successfully published and rejected with an Error object if not</p> <p>A Promise (to which you can optionally subscribe to) that is resolved only after the publisher was successfully published and rejected with an Error object if not</p>
</li> </li>
</ul> </ul>
</section> </section>
@ -467,7 +487,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L400">OpenVidu/Session.ts:400</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L420">OpenVidu/Session.ts:420</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -504,7 +524,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L170">OpenVidu/Session.ts:170</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L181">OpenVidu/Session.ts:181</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -512,9 +532,9 @@
<p>Subscribes to a <code>stream</code>, adding a new HTML video element to DOM with <code>subscriberProperties</code> settings. This method is usually called in the callback of <code>streamCreated</code> event.</p> <p>Subscribes to a <code>stream</code>, adding a new HTML video element to DOM with <code>subscriberProperties</code> settings. This method is usually called in the callback of <code>streamCreated</code> event.</p>
</div> </div>
<h4 id="events-dispatched">Events dispatched</h4> <h4 id="events-dispatched">Events dispatched</h4>
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (if <em>targetElement</em> not null or undefined)</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (only if you
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoPlaying</code> event once the remote video starts playing (only if <code>videoElementCreated</code> event has been previously dispatched)</p> <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">let OpenVidu take care of the video players</a>). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>streamPlaying</code> event once the remote stream starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -530,8 +550,8 @@
<h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5> <h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Subscriber will be inserted (see <a href="../interfaces/subscriberproperties.html#insertmode">SubscriberProperties.insertMode</a>). If null or undefined no default video will be created for this Subscriber <p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Subscriber will be inserted (see <a href="../interfaces/subscriberproperties.html#insertmode">SubscriberProperties.insertMode</a>). If <em>null</em> or <em>undefined</em> no default video will be created for this Subscriber.
(you can always access the native MediaStream object by calling <em>Subscriber.stream.getMediaStream()</em> and use it as <em>srcObject</em> of any HTML video element)</p> You can always call method <a href="subscriber.html#addvideoelement">Subscriber.addVideoElement</a> or <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a> to manage the video elements on your own (see <a href="/docs/how-do-i/manage-videos">Manage video players</a> section)</p>
</div> </div>
</div> </div>
</li> </li>
@ -541,7 +561,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L171">OpenVidu/Session.ts:171</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L182">OpenVidu/Session.ts:182</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -549,9 +569,9 @@
<p>Subscribes to a <code>stream</code>, adding a new HTML video element to DOM with <code>subscriberProperties</code> settings. This method is usually called in the callback of <code>streamCreated</code> event.</p> <p>Subscribes to a <code>stream</code>, adding a new HTML video element to DOM with <code>subscriberProperties</code> settings. This method is usually called in the callback of <code>streamCreated</code> event.</p>
</div> </div>
<h4 id="events-dispatched">Events dispatched</h4> <h4 id="events-dispatched">Events dispatched</h4>
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (if <em>targetElement</em> not null or undefined)</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (only if you
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoPlaying</code> event once the remote video starts playing (only if <code>videoElementCreated</code> event has been previously dispatched)</p> <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">let OpenVidu take care of the video players</a>). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>streamPlaying</code> event once the remote stream starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -567,8 +587,8 @@
<h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5> <h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Subscriber will be inserted (see <a href="../interfaces/subscriberproperties.html#insertmode">SubscriberProperties.insertMode</a>). If null or undefined no default video will be created for this Subscriber <p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Subscriber will be inserted (see <a href="../interfaces/subscriberproperties.html#insertmode">SubscriberProperties.insertMode</a>). If <em>null</em> or <em>undefined</em> no default video will be created for this Subscriber.
(you can always access the native MediaStream object by calling <em>Subscriber.stream.getMediaStream()</em> and use it as <em>srcObject</em> of any HTML video element)</p> You can always call method <a href="subscriber.html#addvideoelement">Subscriber.addVideoElement</a> or <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a> to manage the video elements on your own (see <a href="/docs/how-do-i/manage-videos">Manage video players</a> section)</p>
</div> </div>
</div> </div>
</li> </li>
@ -581,7 +601,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L172">OpenVidu/Session.ts:172</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L183">OpenVidu/Session.ts:183</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -589,9 +609,9 @@
<p>Subscribes to a <code>stream</code>, adding a new HTML video element to DOM with <code>subscriberProperties</code> settings. This method is usually called in the callback of <code>streamCreated</code> event.</p> <p>Subscribes to a <code>stream</code>, adding a new HTML video element to DOM with <code>subscriberProperties</code> settings. This method is usually called in the callback of <code>streamCreated</code> event.</p>
</div> </div>
<h4 id="events-dispatched">Events dispatched</h4> <h4 id="events-dispatched">Events dispatched</h4>
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (if <em>targetElement</em> not null or undefined)</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (only if you
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoPlaying</code> event once the remote video starts playing (only if <code>videoElementCreated</code> event has been previously dispatched)</p> <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">let OpenVidu take care of the video players</a>). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>streamPlaying</code> event once the remote stream starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -607,8 +627,8 @@
<h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5> <h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Subscriber will be inserted (see <a href="../interfaces/subscriberproperties.html#insertmode">SubscriberProperties.insertMode</a>). If null or undefined no default video will be created for this Subscriber <p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Subscriber will be inserted (see <a href="../interfaces/subscriberproperties.html#insertmode">SubscriberProperties.insertMode</a>). If <em>null</em> or <em>undefined</em> no default video will be created for this Subscriber.
(you can always access the native MediaStream object by calling <em>Subscriber.stream.getMediaStream()</em> and use it as <em>srcObject</em> of any HTML video element)</p> You can always call method <a href="subscriber.html#addvideoelement">Subscriber.addVideoElement</a> or <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a> to manage the video elements on your own (see <a href="/docs/how-do-i/manage-videos">Manage video players</a> section)</p>
</div> </div>
</div> </div>
</li> </li>
@ -644,7 +664,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L173">OpenVidu/Session.ts:173</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L184">OpenVidu/Session.ts:184</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -652,9 +672,9 @@
<p>Subscribes to a <code>stream</code>, adding a new HTML video element to DOM with <code>subscriberProperties</code> settings. This method is usually called in the callback of <code>streamCreated</code> event.</p> <p>Subscribes to a <code>stream</code>, adding a new HTML video element to DOM with <code>subscriberProperties</code> settings. This method is usually called in the callback of <code>streamCreated</code> event.</p>
</div> </div>
<h4 id="events-dispatched">Events dispatched</h4> <h4 id="events-dispatched">Events dispatched</h4>
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (if <em>targetElement</em> not null or undefined)</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM (only if you
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoPlaying</code> event once the remote video starts playing (only if <code>videoElementCreated</code> event has been previously dispatched)</p> <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">let OpenVidu take care of the video players</a>). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
<p>See <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>streamPlaying</code> event once the remote stream starts playing. See <a href="streammanagerevent.html">StreamManagerEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -670,8 +690,8 @@
<h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5> <h5>targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Subscriber will be inserted (see <a href="../interfaces/subscriberproperties.html#insertmode">SubscriberProperties.insertMode</a>). If null or undefined no default video will be created for this Subscriber <p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Subscriber will be inserted (see <a href="../interfaces/subscriberproperties.html#insertmode">SubscriberProperties.insertMode</a>). If <em>null</em> or <em>undefined</em> no default video will be created for this Subscriber.
(you can always access the native MediaStream object by calling <em>Subscriber.stream.getMediaStream()</em> and use it as <em>srcObject</em> of any HTML video element)</p> You can always call method <a href="subscriber.html#addvideoelement">Subscriber.addVideoElement</a> or <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a> to manage the video elements on your own (see <a href="/docs/how-do-i/manage-videos">Manage video players</a> section)</p>
</div> </div>
</div> </div>
</li> </li>
@ -720,7 +740,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L237">OpenVidu/Session.ts:237</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L249">OpenVidu/Session.ts:249</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -742,7 +762,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L238">OpenVidu/Session.ts:238</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L250">OpenVidu/Session.ts:250</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
@ -771,21 +791,25 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L355">OpenVidu/Session.ts:355</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L375">OpenVidu/Session.ts:375</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Unpublishes the participant&#39;s audio-video stream contained in <code>publisher</code> object.</p> <p>Unpublishes from the Session the Publisher object.</p>
</div> </div>
<h4 id="events-dispatched">Events dispatched</h4> <h4 id="events-dispatched">Events dispatched</h4>
<p>The <a href="publisher.html">Publisher</a> object of the local participant will dispatch a <code>streamDestroyed</code> event. <p>The <a href="publisher.html">Publisher</a> object of the local participant will dispatch a <code>streamDestroyed</code> event.
This event will automatically stop all media tracks and delete the HTML video element associated to it. This event will automatically stop all media tracks and delete any HTML video element associated to this Publisher
Call <code>event.preventDefault()</code> if you want clean the Publisher object yourself or re-publish it in a different Session.</p> (only those videos <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">created by OpenVidu Browser</a>).
For every video removed, the Publisher object will dispatch a <code>videoElementDestroyed</code> event.
Call <code>event.preventDefault()</code> uppon event <code>streamDestroyed</code> if you want to clean the Publisher object on your own or re-publish it in a different Session.</p>
<p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>streamDestroyed</code> event. <p>The <a href="session.html">Session</a> object of every other participant connected to the session will dispatch a <code>streamDestroyed</code> event.
This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and delete the HTML video element associated to it. This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and
Call <code>event.preventDefault()</code> to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself.</p> delete any HTML video element associated to it (only those <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">created by OpenVidu Browser</a>).
<p>See <a href="streamevent.html">StreamEvent</a> to learn more.</p> For every video removed, the Subscriber object will dispatch a <code>videoElementDestroyed</code> event.
Call <code>event.preventDefault()</code> uppon event <code>streamDestroyed</code> to avoid this default behaviour and take care of disposing and cleaning the Subscriber object on your own.</p>
<p>See <a href="streamevent.html">StreamEvent</a> and <a href="videoelementevent.html">VideoElementEvent</a> to learn more.</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -807,15 +831,17 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L270">OpenVidu/Session.ts:270</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L285">OpenVidu/Session.ts:285</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Unsubscribes from <code>subscriber</code>, automatically removing its HTML video element.</p> <p>Unsubscribes from <code>subscriber</code>, automatically removing its associated HTML video elements.</p>
</div> </div>
<h4 id="events-dispatched">Events dispatched</h4> <h4 id="events-dispatched">Events dispatched</h4>
<p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementDestroyed</code> event (only if it previously dispatched a <code>videoElementCreated</code> event). See <a href="videoelementevent.html">VideoElementEvent</a> to learn more</p> <p>The <a href="subscriber.html">Subscriber</a> object will dispatch a <code>videoElementDestroyed</code> event for each video associated to it that was removed from DOM.
Only videos <a href="/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players">created by OpenVidu Browser</a>) will be automatically removed</p>
<p>See <a href="videoelementevent.html">VideoElementEvent</a> to learn more</p>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
@ -886,6 +912,9 @@
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class">
<a href="session.html#sessionid" class="tsd-kind-icon">session<wbr>Id</a> <a href="session.html#sessionid" class="tsd-kind-icon">session<wbr>Id</a>
</li> </li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="session.html#streammanagers" class="tsd-kind-icon">stream<wbr>Managers</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-method tsd-parent-kind-class">
<a href="session.html#connect" class="tsd-kind-icon">connect</a> <a href="session.html#connect" class="tsd-kind-icon">connect</a>
</li> </li>
@ -935,6 +964,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -956,6 +994,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -119,7 +119,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L27">OpenViduInternal/Events/Event.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -149,11 +149,11 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a> <a name="target" class="tsd-anchor"></a>
<h3>target</h3> <h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a><span class="tsd-signature-symbol"> | </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></div> <div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L32">OpenViduInternal/Events/Event.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -169,7 +169,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L37">OpenViduInternal/Events/Event.ts:37</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -192,7 +192,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L53">OpenViduInternal/Events/Event.ts:53</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -215,19 +215,28 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L64">OpenViduInternal/Events/Event.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p> <p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
<ul>
<li><code>sessionDisconnected</code>: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes the HTML video element associated to it.</li>
<li><code>streamDestroyed</code>: if dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by <a href="session.html">Session</a>,
(<em>other user</em> has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it.</li>
</ul>
</div> </div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
@ -320,6 +329,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -341,6 +359,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -124,7 +124,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L27">OpenViduInternal/Events/Event.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -166,11 +166,11 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a> <a name="target" class="tsd-anchor"></a>
<h3>target</h3> <h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a><span class="tsd-signature-symbol"> | </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></div> <div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L32">OpenViduInternal/Events/Event.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -211,7 +211,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L53">OpenViduInternal/Events/Event.ts:53</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -234,19 +234,28 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L64">OpenViduInternal/Events/Event.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p> <p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
<ul>
<li><code>sessionDisconnected</code>: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes the HTML video element associated to it.</li>
<li><code>streamDestroyed</code>: if dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by <a href="session.html">Session</a>,
(<em>other user</em> has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it.</li>
</ul>
</div> </div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
@ -342,6 +351,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -363,6 +381,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -70,8 +70,9 @@
<section class="tsd-panel tsd-comment"> <section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Represents each one of the videos send and receive by a user in a session. <p>Represents each one of the media streams available in OpenVidu Server for certain session.
Therefore each <a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a> has an attribute of type Stream</p> Each <a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a> has an attribute of type Stream, as they give access
to one of them (sending and receiving it, respectively)</p>
</div> </div>
</div> </div>
</section> </section>
@ -95,6 +96,7 @@
<li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#hasaudio" class="tsd-kind-icon">has<wbr>Audio</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#hasaudio" class="tsd-kind-icon">has<wbr>Audio</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#hasvideo" class="tsd-kind-icon">has<wbr>Video</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#hasvideo" class="tsd-kind-icon">has<wbr>Video</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#streamid" class="tsd-kind-icon">stream<wbr>Id</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#streamid" class="tsd-kind-icon">stream<wbr>Id</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#streammanager" class="tsd-kind-icon">stream<wbr>Manager</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#typeofvideo" class="tsd-kind-icon">type<wbr>OfVideo</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="stream.html#typeofvideo" class="tsd-kind-icon">type<wbr>OfVideo</a></li>
</ul> </ul>
</section> </section>
@ -109,7 +111,7 @@
<div class="tsd-signature tsd-kind-icon">connection<span class="tsd-signature-symbol">:</span> <a href="connection.html" class="tsd-signature-type">Connection</a></div> <div class="tsd-signature tsd-kind-icon">connection<span class="tsd-signature-symbol">:</span> <a href="connection.html" class="tsd-signature-type">Connection</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L39">OpenVidu/Stream.ts:39</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L42">OpenVidu/Stream.ts:42</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -124,12 +126,13 @@
<div class="tsd-signature tsd-kind-icon">frame<wbr>Rate<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div> <div class="tsd-signature tsd-kind-icon">frame<wbr>Rate<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L44">OpenVidu/Stream.ts:44</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L48">OpenVidu/Stream.ts:48</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Frame rate of the video in frames per second. This property is only defined if the <a href="publisher.html">Publisher</a> of the stream was initialized passing a <em>frameRate</em> property on <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> method</p> <p>Frame rate of the video in frames per second. This property is only defined if the <a href="publisher.html">Publisher</a> of
the stream was initialized passing a <em>frameRate</em> property on <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> method</p>
</div> </div>
</div> </div>
</section> </section>
@ -139,7 +142,7 @@
<div class="tsd-signature tsd-kind-icon">has<wbr>Audio<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <div class="tsd-signature tsd-kind-icon">has<wbr>Audio<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L54">OpenVidu/Stream.ts:54</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L58">OpenVidu/Stream.ts:58</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -154,7 +157,7 @@
<div class="tsd-signature tsd-kind-icon">has<wbr>Video<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <div class="tsd-signature tsd-kind-icon">has<wbr>Video<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L49">OpenVidu/Stream.ts:49</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L53">OpenVidu/Stream.ts:53</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -169,7 +172,7 @@
<div class="tsd-signature tsd-kind-icon">stream<wbr>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <div class="tsd-signature tsd-kind-icon">stream<wbr>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L59">OpenVidu/Stream.ts:59</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L63">OpenVidu/Stream.ts:63</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -178,18 +181,33 @@
</div> </div>
</div> </div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="streammanager" class="tsd-anchor"></a>
<h3>stream<wbr>Manager</h3>
<div class="tsd-signature tsd-kind-icon">stream<wbr>Manager<span class="tsd-signature-symbol">:</span> <a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L73">OpenVidu/Stream.ts:73</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>StreamManager object (<a href="publisher.html">Publisher</a> or <a href="subscriber.html">Subscriber</a>) in charge of displaying this stream in the DOM</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="typeofvideo" class="tsd-anchor"></a> <a name="typeofvideo" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> type<wbr>OfVideo</h3> <h3><span class="tsd-flag ts-flagOptional">Optional</span> type<wbr>OfVideo</h3>
<div class="tsd-signature tsd-kind-icon">type<wbr>OfVideo<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <div class="tsd-signature tsd-kind-icon">type<wbr>OfVideo<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L64">OpenVidu/Stream.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L68">OpenVidu/Stream.ts:68</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p><code>&quot;CAMERA&quot;</code> or <code>&quot;SCREEN&quot;</code>. undefined if stream is audio-only</p> <p><code>&quot;CAMERA&quot;</code> or <code>&quot;SCREEN&quot;</code>. <em>undefined</em> if stream is audio-only</p>
</div> </div>
</div> </div>
</section> </section>
@ -270,6 +288,9 @@
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class">
<a href="stream.html#streamid" class="tsd-kind-icon">stream<wbr>Id</a> <a href="stream.html#streamid" class="tsd-kind-icon">stream<wbr>Id</a>
</li> </li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="stream.html#streammanager" class="tsd-kind-icon">stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class">
<a href="stream.html#typeofvideo" class="tsd-kind-icon">type<wbr>OfVideo</a> <a href="stream.html#typeofvideo" class="tsd-kind-icon">type<wbr>OfVideo</a>
</li> </li>
@ -280,6 +301,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -301,6 +331,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -124,7 +124,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L27">OpenViduInternal/Events/Event.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -172,11 +172,11 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a> <a name="target" class="tsd-anchor"></a>
<h3>target</h3> <h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a><span class="tsd-signature-symbol"> | </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></div> <div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L32">OpenViduInternal/Events/Event.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -192,7 +192,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L37">OpenViduInternal/Events/Event.ts:37</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -215,7 +215,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L53">OpenViduInternal/Events/Event.ts:53</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -238,19 +238,28 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L64">OpenViduInternal/Events/Event.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p> <p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
<ul>
<li><code>sessionDisconnected</code>: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes the HTML video element associated to it.</li>
<li><code>streamDestroyed</code>: if dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by <a href="session.html">Session</a>,
(<em>other user</em> has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it.</li>
</ul>
</div> </div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
@ -346,6 +355,15 @@
</li> </li>
</ul> </ul>
<ul class="after-current"> <ul class="after-current">
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -367,6 +385,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -0,0 +1,650 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>StreamManager | OpenVidu Browser</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-browser/" 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="streammanager.html">StreamManager</a>
</li>
</ul>
<h1>Class StreamManager</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Interface in charge of displaying the media streams in the HTML DOM. This wraps any <a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a> object.
You can insert as many video players fo the same Stream as you want by calling <a href="streammanager.html#addvideoelement">StreamManager.addVideoElement</a> or
<a href="streammanager.html#createvideoelement">StreamManager.createVideoElement</a>.</p>
</div>
<p>The use of StreamManager wrapper is particularly useful when you don&#39;t need to differentiate between Publisher or Subscriber streams or just
want to directly manage your own video elements (even more than one video element per Stream). This scenario is pretty common in
declarative, MVC frontend frameworks such as Angular, React or Vue.js</p>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">StreamManager</span>
<ul class="tsd-hierarchy">
<li>
<a href="publisher.html" class="tsd-signature-type">Publisher</a>
</li>
<li>
<a href="subscriber.html" class="tsd-signature-type">Subscriber</a>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel">
<h3>Implements</h3>
<ul class="tsd-hierarchy">
<li><a href="../interfaces/eventdispatcher.html" class="tsd-signature-type">EventDispatcher</a></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>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streammanager.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streammanager.html#remote" class="tsd-kind-icon">remote</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streammanager.html#stream" class="tsd-kind-icon">stream</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streammanager.html#targetelement" class="tsd-kind-icon">target<wbr>Element</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streammanager.html#videos" class="tsd-kind-icon">videos</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="streammanager.html#addvideoelement" class="tsd-kind-icon">add<wbr>Video<wbr>Element</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="streammanager.html#createvideoelement" class="tsd-kind-icon">create<wbr>Video<wbr>Element</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="streammanager.html#off" class="tsd-kind-icon">off</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="streammanager.html#on" class="tsd-kind-icon">on</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="streammanager.html#once" class="tsd-kind-icon">once</a></li>
</ul>
</section>
</div>
</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="id" class="tsd-anchor"></a>
<h3>id</h3>
<div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L69">OpenVidu/StreamManager.ts:69</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><code>id</code> attribute of the DOM video element displaying the Publisher/Subscriber&#39;s stream. This property is only defined if:</p>
<ul>
<li><a href="publisher.html">Publisher</a> has been initialized by calling method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> with a valid <code>targetElement</code> parameter</li>
<li><a href="subscriber.html">Subscriber</a> has been initialized by calling method <a href="session.html#subscribe">Session.subscribe</a> with a valid <code>targetElement</code> parameter</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="remote" class="tsd-anchor"></a>
<h3>remote</h3>
<div class="tsd-signature tsd-kind-icon">remote<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L55">OpenVidu/StreamManager.ts:55</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Whether the Stream represented in the DOM is local or remote</p>
<ul>
<li><code>false</code> for <a href="publisher.html">Publisher</a></li>
<li><code>true</code> for <a href="subscriber.html">Subscriber</a></li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="stream" class="tsd-anchor"></a>
<h3>stream</h3>
<div class="tsd-signature tsd-kind-icon">stream<span class="tsd-signature-symbol">:</span> <a href="stream.html" class="tsd-signature-type">Stream</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L43">OpenVidu/StreamManager.ts:43</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Stream represented in the DOM by the Publisher/Subscriber</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="targetelement" class="tsd-anchor"></a>
<h3>target<wbr>Element</h3>
<div class="tsd-signature tsd-kind-icon">target<wbr>Element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLElement</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L62">OpenVidu/StreamManager.ts:62</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The DOM HTMLElement assigned as target element when creating the video for the Publisher/Subscriber. This property is only defined if:</p>
<ul>
<li><a href="publisher.html">Publisher</a> has been initialized by calling method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> with a valid <code>targetElement</code> parameter</li>
<li><a href="subscriber.html">Subscriber</a> has been initialized by calling method <a href="session.html#subscribe">Session.subscribe</a> with a valid <code>targetElement</code> parameter</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="videos" class="tsd-anchor"></a>
<h3>videos</h3>
<div class="tsd-signature tsd-kind-icon">videos<span class="tsd-signature-symbol">:</span> <a href="../interfaces/streammanagervideo.html" class="tsd-signature-type">StreamManagerVideo</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-browser/src/OpenVidu/StreamManager.ts#L48">OpenVidu/StreamManager.ts:48</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>All the videos displaying the Stream of this Publisher/Subscriber</p>
</div>
</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="addvideoelement" class="tsd-anchor"></a>
<h3>add<wbr>Video<wbr>Element</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">add<wbr>Video<wbr>Element<span class="tsd-signature-symbol">(</span>video<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLVideoElement</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</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-browser/src/OpenVidu/StreamManager.ts#L220">OpenVidu/StreamManager.ts:220</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Makes <code>video</code> element parameter display this <a href="streammanager.html#stream">stream</a>. This is useful when you are
<a href="/docs/how-do-i/manage-videos/#you-take-care-of-the-video-players">managing the video elements on your own</a></p>
</div>
<p>Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be
disassociated from that previous Publisher/Subscriber and to be associated to this one.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>video: <span class="tsd-signature-type">HTMLVideoElement</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
<p>1 if the video wasn&#39;t associated to any other Publisher/Subscriber and has been successfully added to this one.
0 if the video was already added to this Publisher/Subscriber. -1 if the video was previously associated to any other
Publisher/Subscriber and has been successfully disassociated from that one and properly added to this one.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="createvideoelement" class="tsd-anchor"></a>
<h3>create<wbr>Video<wbr>Element</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">create<wbr>Video<wbr>Element<span class="tsd-signature-symbol">(</span>targetElement<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span>, insertMode<span class="tsd-signature-symbol">?: </span><a href="../enums/videoinsertmode.html" class="tsd-signature-type">VideoInsertMode</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLVideoElement</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-browser/src/OpenVidu/StreamManager.ts#L266">OpenVidu/StreamManager.ts:266</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates a new video element displaying this <a href="streammanager.html#stream">stream</a>. This allows you to have multiple video elements displaying the same media stream.</p>
</div>
<h4 id="events-dispatched">Events dispatched</h4>
<p>The Publisher/Subscriber object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM. See <a href="videoelementevent.html">VideoElementEvent</a></p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher/Subscriber will be inserted</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> insertMode: <a href="../enums/videoinsertmode.html" class="tsd-signature-type">VideoInsertMode</a></h5>
<div class="tsd-comment tsd-typography">
<p>How the video element will be inserted accordingly to <code>targetElemet</code></p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">HTMLVideoElement</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="off" class="tsd-anchor"></a>
<h3>off</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</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-browser/src/OpenVidu/StreamManager.ts#L200">OpenVidu/StreamManager.ts:200</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>See <a href="../interfaces/eventdispatcher.html#off">EventDispatcher.off</a></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>type: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="streammanager.html" class="tsd-signature-type">StreamManager</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="on" class="tsd-anchor"></a>
<h3>on</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/eventdispatcher.html" class="tsd-signature-type">EventDispatcher</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-browser/src/OpenVidu/StreamManager.ts#L139">OpenVidu/StreamManager.ts:139</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>See <a href="../interfaces/eventdispatcher.html#on">EventDispatcher.on</a></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>type: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/eventdispatcher.html" class="tsd-signature-type">EventDispatcher</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="once" class="tsd-anchor"></a>
<h3>once</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</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-browser/src/OpenVidu/StreamManager.ts#L170">OpenVidu/StreamManager.ts:170</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>See <a href="../interfaces/eventdispatcher.html#once">EventDispatcher.once</a></p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>type: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="streammanager.html" class="tsd-signature-type">StreamManager</a></h4>
</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/localrecorderstate.html" class="tsd-kind-icon">Local<wbr>Recorder<wbr>State</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/openviduerrorname.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Error<wbr>Name</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/videoinsertmode.html" class="tsd-kind-icon">Video<wbr>Insert<wbr>Mode</a>
</li>
<li class=" tsd-kind-class">
<a href="connection.html" class="tsd-kind-icon">Connection</a>
</li>
<li class=" tsd-kind-class">
<a href="connectionevent.html" class="tsd-kind-icon">Connection<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="event.html" class="tsd-kind-icon">Event</a>
</li>
<li class=" tsd-kind-class">
<a href="localrecorder.html" class="tsd-kind-icon">Local<wbr>Recorder</a>
</li>
<li class=" tsd-kind-class">
<a href="openvidu.html" class="tsd-kind-icon">Open<wbr>Vidu</a>
</li>
<li class=" tsd-kind-class">
<a href="openviduerror.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Error</a>
</li>
<li class=" tsd-kind-class">
<a href="publisher.html" class="tsd-kind-icon">Publisher</a>
</li>
<li class=" tsd-kind-class">
<a href="publisherspeakingevent.html" class="tsd-kind-icon">Publisher<wbr>Speaking<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="recordingevent.html" class="tsd-kind-icon">Recording<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="session.html" class="tsd-kind-icon">Session</a>
</li>
<li class=" tsd-kind-class">
<a href="sessiondisconnectedevent.html" class="tsd-kind-icon">Session<wbr>Disconnected<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="signalevent.html" class="tsd-kind-icon">Signal<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="stream.html" class="tsd-kind-icon">Stream</a>
</li>
<li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streammanager.html#id" class="tsd-kind-icon">id</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streammanager.html#remote" class="tsd-kind-icon">remote</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streammanager.html#stream" class="tsd-kind-icon">stream</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streammanager.html#targetelement" class="tsd-kind-icon">target<wbr>Element</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streammanager.html#videos" class="tsd-kind-icon">videos</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="streammanager.html#addvideoelement" class="tsd-kind-icon">add<wbr>Video<wbr>Element</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="streammanager.html#createvideoelement" class="tsd-kind-icon">create<wbr>Video<wbr>Element</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="streammanager.html#off" class="tsd-kind-icon">off</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="streammanager.html#on" class="tsd-kind-icon">on</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="streammanager.html#once" class="tsd-kind-icon">once</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li>
<li class=" tsd-kind-class">
<a href="videoelementevent.html" class="tsd-kind-icon">Video<wbr>Element<wbr>Event</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/device.html" class="tsd-kind-icon">Device</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/eventdispatcher.html" class="tsd-kind-icon">Event<wbr>Dispatcher</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/openviduadvancedconfiguration.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Advanced<wbr>Configuration</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/publisherproperties.html" class="tsd-kind-icon">Publisher<wbr>Properties</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</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>

View File

@ -0,0 +1,421 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>StreamManagerEvent | OpenVidu Browser</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-browser/" 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="streammanagerevent.html">StreamManagerEvent</a>
</li>
</ul>
<h1>Class StreamManagerEvent</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Defines the following events:</p>
<ul>
<li><code>streamPlaying</code>: dispatched by <a href="streammanager.html">StreamManager</a> (<a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a>)</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="event.html" class="tsd-signature-type">Event</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">StreamManagerEvent</span>
</li>
</ul>
</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 tsd-is-inherited">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="streammanagerevent.html#cancelable" class="tsd-kind-icon">cancelable</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="streammanagerevent.html#target" class="tsd-kind-icon">target</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="streammanagerevent.html#type" class="tsd-kind-icon">type</a></li>
</ul>
</section>
<section class="tsd-index-section tsd-is-inherited">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="streammanagerevent.html#isdefaultprevented" class="tsd-kind-icon">is<wbr>Default<wbr>Prevented</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="streammanagerevent.html#preventdefault" class="tsd-kind-icon">prevent<wbr>Default</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-inherited">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="cancelable" class="tsd-anchor"></a>
<h3>cancelable</h3>
<div class="tsd-signature tsd-kind-icon">cancelable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Whether the event has a default behaviour that may be prevented by calling <a href="event.html#preventdefault">Event.preventDefault</a></p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a>
<h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The object that dispatched the event</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="type" class="tsd-anchor"></a>
<h3>type</h3>
<div class="tsd-signature tsd-kind-icon">type<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The type of event. This is the same string you pass as first parameter when calling method <code>on()</code> of any object implementing <a href="../interfaces/eventdispatcher.html">EventDispatcher</a> interface</p>
</div>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-inherited">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="isdefaultprevented" class="tsd-anchor"></a>
<h3>is<wbr>Default<wbr>Prevented</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">is<wbr>Default<wbr>Prevented<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Whether the default beahivour of the event has been prevented or not. Call <a href="event.html#preventdefault">Event.preventDefault</a> to prevent it</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="preventdefault" class="tsd-anchor"></a>
<h3>prevent<wbr>Default</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">prevent<wbr>Default<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
</div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</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/localrecorderstate.html" class="tsd-kind-icon">Local<wbr>Recorder<wbr>State</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/openviduerrorname.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Error<wbr>Name</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/videoinsertmode.html" class="tsd-kind-icon">Video<wbr>Insert<wbr>Mode</a>
</li>
<li class=" tsd-kind-class">
<a href="connection.html" class="tsd-kind-icon">Connection</a>
</li>
<li class=" tsd-kind-class">
<a href="connectionevent.html" class="tsd-kind-icon">Connection<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="event.html" class="tsd-kind-icon">Event</a>
</li>
<li class=" tsd-kind-class">
<a href="localrecorder.html" class="tsd-kind-icon">Local<wbr>Recorder</a>
</li>
<li class=" tsd-kind-class">
<a href="openvidu.html" class="tsd-kind-icon">Open<wbr>Vidu</a>
</li>
<li class=" tsd-kind-class">
<a href="openviduerror.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Error</a>
</li>
<li class=" tsd-kind-class">
<a href="publisher.html" class="tsd-kind-icon">Publisher</a>
</li>
<li class=" tsd-kind-class">
<a href="publisherspeakingevent.html" class="tsd-kind-icon">Publisher<wbr>Speaking<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="recordingevent.html" class="tsd-kind-icon">Recording<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="session.html" class="tsd-kind-icon">Session</a>
</li>
<li class=" tsd-kind-class">
<a href="sessiondisconnectedevent.html" class="tsd-kind-icon">Session<wbr>Disconnected<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="signalevent.html" class="tsd-kind-icon">Signal<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="stream.html" class="tsd-kind-icon">Stream</a>
</li>
<li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="streammanagerevent.html#cancelable" class="tsd-kind-icon">cancelable</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="streammanagerevent.html#target" class="tsd-kind-icon">target</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="streammanagerevent.html#type" class="tsd-kind-icon">type</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="streammanagerevent.html#isdefaultprevented" class="tsd-kind-icon">is<wbr>Default<wbr>Prevented</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="streammanagerevent.html#preventdefault" class="tsd-kind-icon">prevent<wbr>Default</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li>
<li class=" tsd-kind-class">
<a href="videoelementevent.html" class="tsd-kind-icon">Video<wbr>Element<wbr>Event</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/device.html" class="tsd-kind-icon">Device</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/eventdispatcher.html" class="tsd-kind-icon">Event<wbr>Dispatcher</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/openviduadvancedconfiguration.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Advanced<wbr>Configuration</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/publisherproperties.html" class="tsd-kind-icon">Publisher<wbr>Properties</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</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>

View File

@ -0,0 +1,494 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>StreamPropertyChangedEvent | OpenVidu Browser</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-browser/" 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="streampropertychangedevent.html">StreamPropertyChangedEvent</a>
</li>
</ul>
<h1>Class StreamPropertyChangedEvent</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Defines event <code>streamPropertyChangedEvent</code> dispatched by <a href="session.html">Session</a></p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="event.html" class="tsd-signature-type">Event</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">StreamPropertyChangedEvent</span>
</li>
</ul>
</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>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="streampropertychangedevent.html#cancelable" class="tsd-kind-icon">cancelable</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streampropertychangedevent.html#changedproperty" class="tsd-kind-icon">changed<wbr>Property</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streampropertychangedevent.html#newvalue" class="tsd-kind-icon">new<wbr>Value</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streampropertychangedevent.html#oldvalue" class="tsd-kind-icon">old<wbr>Value</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="streampropertychangedevent.html#stream" class="tsd-kind-icon">stream</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="streampropertychangedevent.html#target" class="tsd-kind-icon">target</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="streampropertychangedevent.html#type" class="tsd-kind-icon">type</a></li>
</ul>
</section>
<section class="tsd-index-section tsd-is-inherited">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="streampropertychangedevent.html#isdefaultprevented" class="tsd-kind-icon">is<wbr>Default<wbr>Prevented</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="streampropertychangedevent.html#preventdefault" class="tsd-kind-icon">prevent<wbr>Default</a></li>
</ul>
</section>
</div>
</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 tsd-is-inherited">
<a name="cancelable" class="tsd-anchor"></a>
<h3>cancelable</h3>
<div class="tsd-signature tsd-kind-icon">cancelable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Whether the event has a default behaviour that may be prevented by calling <a href="event.html#preventdefault">Event.preventDefault</a></p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="changedproperty" class="tsd-anchor"></a>
<h3>changed<wbr>Property</h3>
<div class="tsd-signature tsd-kind-icon">changed<wbr>Property<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/StreamPropertyChangedEvent.ts#L35">OpenViduInternal/Events/StreamPropertyChangedEvent.ts:35</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The property of the stream that changed. This value is either <code>&quot;hasAudio&quot;</code>, <code>&quot;hasVideo&quot;</code> or <code>&quot;videoDimensions&quot;</code></p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="newvalue" class="tsd-anchor"></a>
<h3>new<wbr>Value</h3>
<div class="tsd-signature tsd-kind-icon">new<wbr>Value<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/StreamPropertyChangedEvent.ts#L40">OpenViduInternal/Events/StreamPropertyChangedEvent.ts:40</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>New value of the property (before change)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="oldvalue" class="tsd-anchor"></a>
<h3>old<wbr>Value</h3>
<div class="tsd-signature tsd-kind-icon">old<wbr>Value<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/StreamPropertyChangedEvent.ts#L45">OpenViduInternal/Events/StreamPropertyChangedEvent.ts:45</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Previous value of the property (after change)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="stream" class="tsd-anchor"></a>
<h3>stream</h3>
<div class="tsd-signature tsd-kind-icon">stream<span class="tsd-signature-symbol">:</span> <a href="stream.html" class="tsd-signature-type">Stream</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/StreamPropertyChangedEvent.ts#L30">OpenViduInternal/Events/StreamPropertyChangedEvent.ts:30</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Stream whose property has changed</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a>
<h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The object that dispatched the event</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="type" class="tsd-anchor"></a>
<h3>type</h3>
<div class="tsd-signature tsd-kind-icon">type<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The type of event. This is the same string you pass as first parameter when calling method <code>on()</code> of any object implementing <a href="../interfaces/eventdispatcher.html">EventDispatcher</a> interface</p>
</div>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-inherited">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="isdefaultprevented" class="tsd-anchor"></a>
<h3>is<wbr>Default<wbr>Prevented</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">is<wbr>Default<wbr>Prevented<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Whether the default beahivour of the event has been prevented or not. Call <a href="event.html#preventdefault">Event.preventDefault</a> to prevent it</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="preventdefault" class="tsd-anchor"></a>
<h3>prevent<wbr>Default</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">prevent<wbr>Default<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
</div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</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/localrecorderstate.html" class="tsd-kind-icon">Local<wbr>Recorder<wbr>State</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/openviduerrorname.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Error<wbr>Name</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/videoinsertmode.html" class="tsd-kind-icon">Video<wbr>Insert<wbr>Mode</a>
</li>
<li class=" tsd-kind-class">
<a href="connection.html" class="tsd-kind-icon">Connection</a>
</li>
<li class=" tsd-kind-class">
<a href="connectionevent.html" class="tsd-kind-icon">Connection<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="event.html" class="tsd-kind-icon">Event</a>
</li>
<li class=" tsd-kind-class">
<a href="localrecorder.html" class="tsd-kind-icon">Local<wbr>Recorder</a>
</li>
<li class=" tsd-kind-class">
<a href="openvidu.html" class="tsd-kind-icon">Open<wbr>Vidu</a>
</li>
<li class=" tsd-kind-class">
<a href="openviduerror.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Error</a>
</li>
<li class=" tsd-kind-class">
<a href="publisher.html" class="tsd-kind-icon">Publisher</a>
</li>
<li class=" tsd-kind-class">
<a href="publisherspeakingevent.html" class="tsd-kind-icon">Publisher<wbr>Speaking<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="recordingevent.html" class="tsd-kind-icon">Recording<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="session.html" class="tsd-kind-icon">Session</a>
</li>
<li class=" tsd-kind-class">
<a href="sessiondisconnectedevent.html" class="tsd-kind-icon">Session<wbr>Disconnected<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="signalevent.html" class="tsd-kind-icon">Signal<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="stream.html" class="tsd-kind-icon">Stream</a>
</li>
<li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="streampropertychangedevent.html#cancelable" class="tsd-kind-icon">cancelable</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streampropertychangedevent.html#changedproperty" class="tsd-kind-icon">changed<wbr>Property</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streampropertychangedevent.html#newvalue" class="tsd-kind-icon">new<wbr>Value</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streampropertychangedevent.html#oldvalue" class="tsd-kind-icon">old<wbr>Value</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="streampropertychangedevent.html#stream" class="tsd-kind-icon">stream</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="streampropertychangedevent.html#target" class="tsd-kind-icon">target</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="streampropertychangedevent.html#type" class="tsd-kind-icon">type</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="streampropertychangedevent.html#isdefaultprevented" class="tsd-kind-icon">is<wbr>Default<wbr>Prevented</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="streampropertychangedevent.html#preventdefault" class="tsd-kind-icon">prevent<wbr>Default</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li>
<li class=" tsd-kind-class">
<a href="videoelementevent.html" class="tsd-kind-icon">Video<wbr>Element<wbr>Event</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/device.html" class="tsd-kind-icon">Device</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/eventdispatcher.html" class="tsd-kind-icon">Event<wbr>Dispatcher</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/openviduadvancedconfiguration.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Advanced<wbr>Configuration</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/publisherproperties.html" class="tsd-kind-icon">Publisher<wbr>Properties</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</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>

View File

@ -76,11 +76,16 @@
</section> </section>
<section class="tsd-panel tsd-hierarchy"> <section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3> <h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="streammanager.html" class="tsd-signature-type">StreamManager</a>
<ul class="tsd-hierarchy"> <ul class="tsd-hierarchy">
<li> <li>
<span class="target">Subscriber</span> <span class="target">Subscriber</span>
</li> </li>
</ul> </ul>
</li>
</ul>
</section> </section>
<section class="tsd-panel"> <section class="tsd-panel">
<h3>Implements</h3> <h3>Implements</h3>
@ -92,20 +97,24 @@
<h2>Index</h2> <h2>Index</h2>
<section class="tsd-panel tsd-index-panel"> <section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content"> <div class="tsd-index-content">
<section class="tsd-index-section "> <section class="tsd-index-section tsd-is-inherited">
<h3>Properties</h3> <h3>Properties</h3>
<ul class="tsd-index-list"> <ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="subscriber.html#element" class="tsd-kind-icon">element</a></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="subscriber.html#id" class="tsd-kind-icon">id</a></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#remote" class="tsd-kind-icon">remote</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="subscriber.html#stream" class="tsd-kind-icon">stream</a></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#stream" class="tsd-kind-icon">stream</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#targetelement" class="tsd-kind-icon">target<wbr>Element</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#videos" class="tsd-kind-icon">videos</a></li>
</ul> </ul>
</section> </section>
<section class="tsd-index-section "> <section class="tsd-index-section ">
<h3>Methods</h3> <h3>Methods</h3>
<ul class="tsd-index-list"> <ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="subscriber.html#off" class="tsd-kind-icon">off</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#addvideoelement" class="tsd-kind-icon">add<wbr>Video<wbr>Element</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="subscriber.html#on" class="tsd-kind-icon">on</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#createvideoelement" class="tsd-kind-icon">create<wbr>Video<wbr>Element</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="subscriber.html#once" class="tsd-kind-icon">once</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#off" class="tsd-kind-icon">off</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#on" class="tsd-kind-icon">on</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="subscriber.html#once" class="tsd-kind-icon">once</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="subscriber.html#subscribetoaudio" class="tsd-kind-icon">subscribe<wbr>ToAudio</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="subscriber.html#subscribetoaudio" class="tsd-kind-icon">subscribe<wbr>ToAudio</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="subscriber.html#subscribetovideo" class="tsd-kind-icon">subscribe<wbr>ToVideo</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="subscriber.html#subscribetovideo" class="tsd-kind-icon">subscribe<wbr>ToVideo</a></li>
</ul> </ul>
@ -113,67 +122,190 @@
</div> </div>
</section> </section>
</section> </section>
<section class="tsd-panel-group tsd-member-group "> <section class="tsd-panel-group tsd-member-group tsd-is-inherited">
<h2>Properties</h2> <h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="element" class="tsd-anchor"></a>
<h3>element</h3>
<div class="tsd-signature tsd-kind-icon">element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLElement</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L33">OpenVidu/Subscriber.ts:33</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>HTML DOM element in which the Subscriber&#39;s video has been inserted</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="id" class="tsd-anchor"></a> <a name="id" class="tsd-anchor"></a>
<h3>id</h3> <h3>id</h3>
<div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#id">id</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L38">OpenVidu/Subscriber.ts:38</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L69">OpenVidu/StreamManager.ts:69</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>DOM id of the Subscriber&#39;s video element</p> <p><code>id</code> attribute of the DOM video element displaying the Publisher/Subscriber&#39;s stream. This property is only defined if:</p>
<ul>
<li><a href="publisher.html">Publisher</a> has been initialized by calling method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> with a valid <code>targetElement</code> parameter</li>
<li><a href="subscriber.html">Subscriber</a> has been initialized by calling method <a href="session.html#subscribe">Session.subscribe</a> with a valid <code>targetElement</code> parameter</li>
</ul>
</div> </div>
</div> </div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="remote" class="tsd-anchor"></a>
<h3>remote</h3>
<div class="tsd-signature tsd-kind-icon">remote<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#remote">remote</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L55">OpenVidu/StreamManager.ts:55</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Whether the Stream represented in the DOM is local or remote</p>
<ul>
<li><code>false</code> for <a href="publisher.html">Publisher</a></li>
<li><code>true</code> for <a href="subscriber.html">Subscriber</a></li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="stream" class="tsd-anchor"></a> <a name="stream" class="tsd-anchor"></a>
<h3>stream</h3> <h3>stream</h3>
<div class="tsd-signature tsd-kind-icon">stream<span class="tsd-signature-symbol">:</span> <a href="stream.html" class="tsd-signature-type">Stream</a></div> <div class="tsd-signature tsd-kind-icon">stream<span class="tsd-signature-symbol">:</span> <a href="stream.html" class="tsd-signature-type">Stream</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#stream">stream</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L43">OpenVidu/Subscriber.ts:43</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L43">OpenVidu/StreamManager.ts:43</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>The <a href="stream.html">Stream</a> to which you are subscribing</p> <p>The Stream represented in the DOM by the Publisher/Subscriber</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="targetelement" class="tsd-anchor"></a>
<h3>target<wbr>Element</h3>
<div class="tsd-signature tsd-kind-icon">target<wbr>Element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLElement</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#targetelement">targetElement</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L62">OpenVidu/StreamManager.ts:62</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The DOM HTMLElement assigned as target element when creating the video for the Publisher/Subscriber. This property is only defined if:</p>
<ul>
<li><a href="publisher.html">Publisher</a> has been initialized by calling method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> with a valid <code>targetElement</code> parameter</li>
<li><a href="subscriber.html">Subscriber</a> has been initialized by calling method <a href="session.html#subscribe">Session.subscribe</a> with a valid <code>targetElement</code> parameter</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="videos" class="tsd-anchor"></a>
<h3>videos</h3>
<div class="tsd-signature tsd-kind-icon">videos<span class="tsd-signature-symbol">:</span> <a href="../interfaces/streammanagervideo.html" class="tsd-signature-type">StreamManagerVideo</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> =&nbsp;[]</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#videos">videos</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L48">OpenVidu/StreamManager.ts:48</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>All the videos displaying the Stream of this Publisher/Subscriber</p>
</div> </div>
</div> </div>
</section> </section>
</section> </section>
<section class="tsd-panel-group tsd-member-group "> <section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2> <h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="off" class="tsd-anchor"></a> <a name="addvideoelement" class="tsd-anchor"></a>
<h3>off</h3> <h3>add<wbr>Video<wbr>Element</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a></li> <li class="tsd-signature tsd-kind-icon">add<wbr>Video<wbr>Element<span class="tsd-signature-symbol">(</span>video<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLVideoElement</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#addvideoelement">addVideoElement</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L178">OpenVidu/Subscriber.ts:178</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L220">OpenVidu/StreamManager.ts:220</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Makes <code>video</code> element parameter display this <a href="subscriber.html#stream">stream</a>. This is useful when you are
<a href="/docs/how-do-i/manage-videos/#you-take-care-of-the-video-players">managing the video elements on your own</a></p>
</div>
<p>Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be
disassociated from that previous Publisher/Subscriber and to be associated to this one.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>video: <span class="tsd-signature-type">HTMLVideoElement</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
<p>1 if the video wasn&#39;t associated to any other Publisher/Subscriber and has been successfully added to this one.
0 if the video was already added to this Publisher/Subscriber. -1 if the video was previously associated to any other
Publisher/Subscriber and has been successfully disassociated from that one and properly added to this one.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="createvideoelement" class="tsd-anchor"></a>
<h3>create<wbr>Video<wbr>Element</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">create<wbr>Video<wbr>Element<span class="tsd-signature-symbol">(</span>targetElement<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span>, insertMode<span class="tsd-signature-symbol">?: </span><a href="../enums/videoinsertmode.html" class="tsd-signature-type">VideoInsertMode</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLVideoElement</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#createvideoelement">createVideoElement</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L266">OpenVidu/StreamManager.ts:266</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates a new video element displaying this <a href="subscriber.html#stream">stream</a>. This allows you to have multiple video elements displaying the same media stream.</p>
</div>
<h4 id="events-dispatched">Events dispatched</h4>
<p>The Publisher/Subscriber object will dispatch a <code>videoElementCreated</code> event once the HTML video element has been added to DOM. See <a href="videoelementevent.html">VideoElementEvent</a></p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> targetElement: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span></h5>
<div class="tsd-comment tsd-typography">
<p>HTML DOM element (or its <code>id</code> attribute) in which the video element of the Publisher/Subscriber will be inserted</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> insertMode: <a href="../enums/videoinsertmode.html" class="tsd-signature-type">VideoInsertMode</a></h5>
<div class="tsd-comment tsd-typography">
<p>How the video element will be inserted accordingly to <code>targetElemet</code></p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">HTMLVideoElement</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="off" class="tsd-anchor"></a>
<h3>off</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#off">off</a></p>
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L200">OpenVidu/StreamManager.ts:200</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -191,14 +323,14 @@
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li class="tsd-parameter-siganture"> <li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported"> <ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li> <li>
<h5>event: <a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a></h5> <h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@ -208,21 +340,22 @@
</ul> </ul>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <a href="subscriber.html" class="tsd-signature-type">Subscriber</a></h4> <h4 class="tsd-returns-title">Returns <a href="streammanager.html" class="tsd-signature-type">StreamManager</a></h4>
</li> </li>
</ul> </ul>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="on" class="tsd-anchor"></a> <a name="on" class="tsd-anchor"></a>
<h3>on</h3> <h3>on</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/eventdispatcher.html" class="tsd-signature-type">EventDispatcher</a></li> <li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/eventdispatcher.html" class="tsd-signature-type">EventDispatcher</a></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#on">on</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L94">OpenVidu/Subscriber.ts:94</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L139">OpenVidu/StreamManager.ts:139</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -240,14 +373,14 @@
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li class="tsd-parameter-siganture"> <li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported"> <ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li> <li>
<h5>event: <a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a></h5> <h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@ -261,17 +394,18 @@
</li> </li>
</ul> </ul>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="once" class="tsd-anchor"></a> <a name="once" class="tsd-anchor"></a>
<h3>once</h3> <h3>once</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a></li> <li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#once">once</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L136">OpenVidu/Subscriber.ts:136</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/StreamManager.ts#L170">OpenVidu/StreamManager.ts:170</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -289,14 +423,14 @@
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li class="tsd-parameter-siganture"> <li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported"> <ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li> <li>
<h5>event: <a href="videoelementevent.html" class="tsd-signature-type">VideoElementEvent</a></h5> <h5>event: <a href="event.html" class="tsd-signature-type">Event</a></h5>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@ -306,7 +440,7 @@
</ul> </ul>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <a href="subscriber.html" class="tsd-signature-type">Subscriber</a></h4> <h4 class="tsd-returns-title">Returns <a href="streammanager.html" class="tsd-signature-type">StreamManager</a></h4>
</li> </li>
</ul> </ul>
</section> </section>
@ -320,7 +454,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L74">OpenVidu/Subscriber.ts:74</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L44">OpenVidu/Subscriber.ts:44</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -351,7 +485,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L84">OpenVidu/Subscriber.ts:84</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Subscriber.ts#L56">OpenVidu/Subscriber.ts:56</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -435,27 +569,48 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
</ul> </ul>
<ul class="current"> <ul class="current">
<li class="current tsd-kind-class"> <li class="current tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
<ul> <ul>
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#element" class="tsd-kind-icon">element</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="subscriber.html#id" class="tsd-kind-icon">id</a> <a href="subscriber.html#id" class="tsd-kind-icon">id</a>
</li> </li>
<li class=" tsd-kind-property tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#remote" class="tsd-kind-icon">remote</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#stream" class="tsd-kind-icon">stream</a> <a href="subscriber.html#stream" class="tsd-kind-icon">stream</a>
</li> </li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#targetelement" class="tsd-kind-icon">target<wbr>Element</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#videos" class="tsd-kind-icon">videos</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#addvideoelement" class="tsd-kind-icon">add<wbr>Video<wbr>Element</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#createvideoelement" class="tsd-kind-icon">create<wbr>Video<wbr>Element</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#off" class="tsd-kind-icon">off</a> <a href="subscriber.html#off" class="tsd-kind-icon">off</a>
</li> </li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#on" class="tsd-kind-icon">on</a> <a href="subscriber.html#on" class="tsd-kind-icon">on</a>
</li> </li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="subscriber.html#once" class="tsd-kind-icon">once</a> <a href="subscriber.html#once" class="tsd-kind-icon">once</a>
</li> </li>
<li class=" tsd-kind-method tsd-parent-kind-class"> <li class=" tsd-kind-method tsd-parent-kind-class">
@ -486,6 +641,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -72,10 +72,9 @@
<div class="lead"> <div class="lead">
<p>Defines the following events:</p> <p>Defines the following events:</p>
<ul> <ul>
<li><code>videoElementCreated</code>: dispatched by <a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a></li> <li><code>videoElementCreated</code>: dispatched by <a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a> whenever a new HTML video element has been inserted into DOM by OpenVidu Browser library. See
<li><code>videoElementDestroyed</code>: dispatched by <a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a></li> <a href="/docs/how-do-i/manage-videos">Manage video players</a> section.</li>
<li><code>videoPlaying</code>: dispatched by <a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a></li> <li><code>videoElementDestroyed</code>: dispatched by <a href="publisher.html">Publisher</a> and <a href="subscriber.html">Subscriber</a> whenever an HTML video element has been removed from DOM by OpenVidu Browser library.</li>
<li><code>remoteVideoPlaying</code>: dispatched by <a href="publisher.html">Publisher</a> if <code>Publisher.subscribeToRemote()</code> was called before <code>Session.publish(Publisher)</code></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -125,7 +124,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#cancelable">cancelable</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L27">OpenViduInternal/Events/Event.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L26">OpenViduInternal/Events/Event.ts:26</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -140,23 +139,23 @@
<div class="tsd-signature tsd-kind-icon">element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLVideoElement</span></div> <div class="tsd-signature tsd-kind-icon">element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLVideoElement</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/VideoElementEvent.ts#L35">OpenViduInternal/Events/VideoElementEvent.ts:35</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/VideoElementEvent.ts#L33">OpenViduInternal/Events/VideoElementEvent.ts:33</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Video element that was created, destroyed or started playing</p> <p>Video element that was created or destroyed</p>
</div> </div>
</div> </div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="target" class="tsd-anchor"></a> <a name="target" class="tsd-anchor"></a>
<h3>target</h3> <h3>target</h3>
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="subscriber.html" class="tsd-signature-type">Subscriber</a><span class="tsd-signature-symbol"> | </span><a href="publisher.html" class="tsd-signature-type">Publisher</a></div> <div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol"> | </span><a href="streammanager.html" class="tsd-signature-type">StreamManager</a></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#target">target</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L32">OpenViduInternal/Events/Event.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L31">OpenViduInternal/Events/Event.ts:31</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -172,7 +171,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#type">type</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L37">OpenViduInternal/Events/Event.ts:37</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L36">OpenViduInternal/Events/Event.ts:36</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -195,7 +194,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#isdefaultprevented">isDefaultPrevented</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L53">OpenViduInternal/Events/Event.ts:53</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L52">OpenViduInternal/Events/Event.ts:52</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -218,19 +217,28 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p> <p>Inherited from <a href="event.html">Event</a>.<a href="event.html#preventdefault">preventDefault</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L64">OpenViduInternal/Events/Event.ts:64</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Events/Event.ts#L70">OpenViduInternal/Events/Event.ts:70</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Prevents the default behaviour of the event. The following events have a default behaviour:</p> <p>Prevents the default behaviour of the event. The following events have a default behaviour:</p>
<ul>
<li><code>sessionDisconnected</code>: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes the HTML video element associated to it.</li>
<li><code>streamDestroyed</code>: if dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by <a href="session.html">Session</a>,
(<em>other user</em> has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it.</li>
</ul>
</div> </div>
<ul>
<li><p><code>sessionDisconnected</code>: dispatched by <a href="session.html">Session</a> object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, each Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</p>
</li>
<li><p><code>streamDestroyed</code>:</p>
<ul>
<li>If dispatched by a <a href="publisher.html">Publisher</a> (<em>you</em> have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code>
in method <a href="openvidu.html#initpublisher">OpenVidu.initPublisher</a> or by calling <a href="publisher.html#createvideoelement">Publisher.createVideoElement</a>). For every video removed, the Publisher object will also dispatch a <code>videoElementDestroyed</code> event.</li>
<li>If dispatched by <a href="session.html">Session</a> (<em>other user</em> has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as <code>targetElement</code> in method <a href="session.html#subscribe">Session.subscribe</a> or
by calling <a href="subscriber.html#createvideoelement">Subscriber.createVideoElement</a>). For every video removed, the Subscriber object will also dispatch a <code>videoElementDestroyed</code> event.</li>
</ul>
</li>
</ul>
</div> </div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li> </li>
@ -299,6 +307,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -344,6 +361,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -206,6 +206,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -227,6 +236,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -82,11 +82,10 @@
<h3>Enumeration members</h3> <h3>Enumeration members</h3>
<ul class="tsd-index-list"> <ul class="tsd-index-list">
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#browser_not_supported" class="tsd-kind-icon">BROWSER_<wbr>NOT_<wbr>SUPPORTED</a></li> <li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#browser_not_supported" class="tsd-kind-icon">BROWSER_<wbr>NOT_<wbr>SUPPORTED</a></li>
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#camera_access_denied" class="tsd-kind-icon">CAMERA_<wbr>ACCESS_<wbr>DENIED</a></li> <li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#device_access_denied" class="tsd-kind-icon">DEVICE_<wbr>ACCESS_<wbr>DENIED</a></li>
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#generic_error" class="tsd-kind-icon">GENERIC_<wbr>ERROR</a></li> <li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#generic_error" class="tsd-kind-icon">GENERIC_<wbr>ERROR</a></li>
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#input_audio_device_not_found" class="tsd-kind-icon">INPUT_<wbr>AUDIO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND</a></li> <li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#input_audio_device_not_found" class="tsd-kind-icon">INPUT_<wbr>AUDIO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND</a></li>
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#input_video_device_not_found" class="tsd-kind-icon">INPUT_<wbr>VIDEO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND</a></li> <li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#input_video_device_not_found" class="tsd-kind-icon">INPUT_<wbr>VIDEO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND</a></li>
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#microphone_access_denied" class="tsd-kind-icon">MICROPHONE_<wbr>ACCESS_<wbr>DENIED</a></li>
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#no_input_source_set" class="tsd-kind-icon">NO_<wbr>INPUT_<wbr>SOURCE_<wbr>SET</a></li> <li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#no_input_source_set" class="tsd-kind-icon">NO_<wbr>INPUT_<wbr>SOURCE_<wbr>SET</a></li>
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#openvidu_not_connected" class="tsd-kind-icon">OPENVIDU_<wbr>NOT_<wbr>CONNECTED</a></li> <li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#openvidu_not_connected" class="tsd-kind-icon">OPENVIDU_<wbr>NOT_<wbr>CONNECTED</a></li>
<li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#openvidu_permission_denied" class="tsd-kind-icon">OPENVIDU_<wbr>PERMISSION_<wbr>DENIED</a></li> <li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="openviduerrorname.html#openvidu_permission_denied" class="tsd-kind-icon">OPENVIDU_<wbr>PERMISSION_<wbr>DENIED</a></li>
@ -108,19 +107,31 @@
<div class="tsd-signature tsd-kind-icon">BROWSER_<wbr>NOT_<wbr>SUPPORTED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;BROWSER_NOT_SUPPORTED&quot;</span></div> <div class="tsd-signature tsd-kind-icon">BROWSER_<wbr>NOT_<wbr>SUPPORTED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;BROWSER_NOT_SUPPORTED&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L22">OpenViduInternal/Enums/OpenViduError.ts:22</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L27">OpenViduInternal/Enums/OpenViduError.ts:27</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Browser is not supported by OpenVidu.
Returned uppon unsuccessful <a href="../classes/session.html#connect">Session.connect</a></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="camera_access_denied" class="tsd-anchor"></a> <a name="device_access_denied" class="tsd-anchor"></a>
<h3>CAMERA_<wbr>ACCESS_<wbr>DENIED</h3> <h3>DEVICE_<wbr>ACCESS_<wbr>DENIED</h3>
<div class="tsd-signature tsd-kind-icon">CAMERA_<wbr>ACCESS_<wbr>DENIED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;CAMERA_ACCESS_DENIED&quot;</span></div> <div class="tsd-signature tsd-kind-icon">DEVICE_<wbr>ACCESS_<wbr>DENIED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;DEVICE_ACCESS_DENIED&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L23">OpenViduInternal/Enums/OpenViduError.ts:23</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L33">OpenViduInternal/Enums/OpenViduError.ts:33</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The user hasn&#39;t granted permissions to the required input device when the browser asked for them.
Returned uppon unsuccessful <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a> or <a href="../classes/openvidu.html#getusermedia">OpenVidu.getUserMedia</a></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="generic_error" class="tsd-anchor"></a> <a name="generic_error" class="tsd-anchor"></a>
@ -128,9 +139,14 @@
<div class="tsd-signature tsd-kind-icon">GENERIC_<wbr>ERROR<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;GENERIC_ERROR&quot;</span></div> <div class="tsd-signature tsd-kind-icon">GENERIC_<wbr>ERROR<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;GENERIC_ERROR&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L35">OpenViduInternal/Enums/OpenViduError.ts:35</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L97">OpenViduInternal/Enums/OpenViduError.ts:97</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><em>Not in use yet</em></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="input_audio_device_not_found" class="tsd-anchor"></a> <a name="input_audio_device_not_found" class="tsd-anchor"></a>
@ -138,9 +154,15 @@
<div class="tsd-signature tsd-kind-icon">INPUT_<wbr>AUDIO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;INPUT_AUDIO_DEVICE_NOT_FOUND&quot;</span></div> <div class="tsd-signature tsd-kind-icon">INPUT_<wbr>AUDIO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;INPUT_AUDIO_DEVICE_NOT_FOUND&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L30">OpenViduInternal/Enums/OpenViduError.ts:30</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L69">OpenViduInternal/Enums/OpenViduError.ts:69</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>No audio input device found with the provided deviceId (property <a href="../interfaces/publisherproperties.html#audiosource">PublisherProperties.audioSource</a>)
Returned uppon unsuccessful <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="input_video_device_not_found" class="tsd-anchor"></a> <a name="input_video_device_not_found" class="tsd-anchor"></a>
@ -148,19 +170,15 @@
<div class="tsd-signature tsd-kind-icon">INPUT_<wbr>VIDEO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;INPUT_VIDEO_DEVICE_NOT_FOUND&quot;</span></div> <div class="tsd-signature tsd-kind-icon">INPUT_<wbr>VIDEO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;INPUT_VIDEO_DEVICE_NOT_FOUND&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L29">OpenViduInternal/Enums/OpenViduError.ts:29</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L63">OpenViduInternal/Enums/OpenViduError.ts:63</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="microphone_access_denied" class="tsd-anchor"></a>
<h3>MICROPHONE_<wbr>ACCESS_<wbr>DENIED</h3>
<div class="tsd-signature tsd-kind-icon">MICROPHONE_<wbr>ACCESS_<wbr>DENIED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;MICROPHONE_ACCESS_DENIED&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L24">OpenViduInternal/Enums/OpenViduError.ts:24</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>No video input device found with the provided deviceId (property <a href="../interfaces/publisherproperties.html#videosource">PublisherProperties.videoSource</a>)
Returned uppon unsuccessful <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="no_input_source_set" class="tsd-anchor"></a> <a name="no_input_source_set" class="tsd-anchor"></a>
@ -168,9 +186,15 @@
<div class="tsd-signature tsd-kind-icon">NO_<wbr>INPUT_<wbr>SOURCE_<wbr>SET<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;NO_INPUT_SOURCE_SET&quot;</span></div> <div class="tsd-signature tsd-kind-icon">NO_<wbr>INPUT_<wbr>SOURCE_<wbr>SET<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;NO_INPUT_SOURCE_SET&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L31">OpenViduInternal/Enums/OpenViduError.ts:31</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L75">OpenViduInternal/Enums/OpenViduError.ts:75</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Method <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a> has been called with properties <code>videoSource</code> and <code>audioSource</code> of
<a href="../interfaces/publisherproperties.html">PublisherProperties</a> parameter both set to <em>false</em> or <em>null</em></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="openvidu_not_connected" class="tsd-anchor"></a> <a name="openvidu_not_connected" class="tsd-anchor"></a>
@ -178,9 +202,14 @@
<div class="tsd-signature tsd-kind-icon">OPENVIDU_<wbr>NOT_<wbr>CONNECTED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;OPENVIDU_NOT_CONNECTED&quot;</span></div> <div class="tsd-signature tsd-kind-icon">OPENVIDU_<wbr>NOT_<wbr>CONNECTED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;OPENVIDU_NOT_CONNECTED&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L34">OpenViduInternal/Enums/OpenViduError.ts:34</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L92">OpenViduInternal/Enums/OpenViduError.ts:92</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><em>Not in use yet</em></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="openvidu_permission_denied" class="tsd-anchor"></a> <a name="openvidu_permission_denied" class="tsd-anchor"></a>
@ -188,9 +217,14 @@
<div class="tsd-signature tsd-kind-icon">OPENVIDU_<wbr>PERMISSION_<wbr>DENIED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;OPENVIDU_PERMISSION_DENIED&quot;</span></div> <div class="tsd-signature tsd-kind-icon">OPENVIDU_<wbr>PERMISSION_<wbr>DENIED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;OPENVIDU_PERMISSION_DENIED&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L33">OpenViduInternal/Enums/OpenViduError.ts:33</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L87">OpenViduInternal/Enums/OpenViduError.ts:87</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><em>Not in use yet</em></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="publisher_properties_error" class="tsd-anchor"></a> <a name="publisher_properties_error" class="tsd-anchor"></a>
@ -198,9 +232,16 @@
<div class="tsd-signature tsd-kind-icon">PUBLISHER_<wbr>PROPERTIES_<wbr>ERROR<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;PUBLISHER_PROPERTIES_ERROR&quot;</span></div> <div class="tsd-signature tsd-kind-icon">PUBLISHER_<wbr>PROPERTIES_<wbr>ERROR<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;PUBLISHER_PROPERTIES_ERROR&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L32">OpenViduInternal/Enums/OpenViduError.ts:32</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L82">OpenViduInternal/Enums/OpenViduError.ts:82</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Some media property of <a href="../interfaces/publisherproperties.html">PublisherProperties</a> such as <code>frameRate</code> or <code>resolution</code> is not supported
by the input devices (whenever it is possible they are automatically adjusted to the most similar value).
Returned uppon unsuccessful <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="screen_capture_denied" class="tsd-anchor"></a> <a name="screen_capture_denied" class="tsd-anchor"></a>
@ -208,9 +249,15 @@
<div class="tsd-signature tsd-kind-icon">SCREEN_<wbr>CAPTURE_<wbr>DENIED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;SCREEN_CAPTURE_DENIED&quot;</span></div> <div class="tsd-signature tsd-kind-icon">SCREEN_<wbr>CAPTURE_<wbr>DENIED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;SCREEN_CAPTURE_DENIED&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L25">OpenViduInternal/Enums/OpenViduError.ts:25</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L39">OpenViduInternal/Enums/OpenViduError.ts:39</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The user hasn&#39;t granted permissions to capture some desktop screen when the browser asked for them.
Returned uppon unsuccessful <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a> or <a href="../classes/openvidu.html#getusermedia">OpenVidu.getUserMedia</a></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="screen_extension_disabled" class="tsd-anchor"></a> <a name="screen_extension_disabled" class="tsd-anchor"></a>
@ -218,9 +265,15 @@
<div class="tsd-signature tsd-kind-icon">SCREEN_<wbr>EXTENSION_<wbr>DISABLED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;SCREEN_EXTENSION_DISABLED&quot;</span></div> <div class="tsd-signature tsd-kind-icon">SCREEN_<wbr>EXTENSION_<wbr>DISABLED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;SCREEN_EXTENSION_DISABLED&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L28">OpenViduInternal/Enums/OpenViduError.ts:28</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L57">OpenViduInternal/Enums/OpenViduError.ts:57</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Only for Chrome, the screen sharing extension is installed but is disabled
Returned uppon unsuccessful <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="screen_extension_not_installed" class="tsd-anchor"></a> <a name="screen_extension_not_installed" class="tsd-anchor"></a>
@ -228,9 +281,15 @@
<div class="tsd-signature tsd-kind-icon">SCREEN_<wbr>EXTENSION_<wbr>NOT_<wbr>INSTALLED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;SCREEN_EXTENSION_NOT_INSTALLED&quot;</span></div> <div class="tsd-signature tsd-kind-icon">SCREEN_<wbr>EXTENSION_<wbr>NOT_<wbr>INSTALLED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;SCREEN_EXTENSION_NOT_INSTALLED&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L27">OpenViduInternal/Enums/OpenViduError.ts:27</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L51">OpenViduInternal/Enums/OpenViduError.ts:51</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Only for Chrome, there&#39;s no screen sharing extension installed
Returned uppon unsuccessful <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a></p>
</div>
</div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"> <section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum">
<a name="screen_sharing_not_supported" class="tsd-anchor"></a> <a name="screen_sharing_not_supported" class="tsd-anchor"></a>
@ -238,9 +297,15 @@
<div class="tsd-signature tsd-kind-icon">SCREEN_<wbr>SHARING_<wbr>NOT_<wbr>SUPPORTED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;SCREEN_SHARING_NOT_SUPPORTED&quot;</span></div> <div class="tsd-signature tsd-kind-icon">SCREEN_<wbr>SHARING_<wbr>NOT_<wbr>SUPPORTED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> =&nbsp;&quot;SCREEN_SHARING_NOT_SUPPORTED&quot;</span></div>
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L26">OpenViduInternal/Enums/OpenViduError.ts:26</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Enums/OpenViduError.ts#L45">OpenViduInternal/Enums/OpenViduError.ts:45</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Browser does not support screen sharing.
Returned uppon unsuccessful <a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a></p>
</div>
</div>
</section> </section>
</section> </section>
</div> </div>
@ -266,7 +331,7 @@
<a href="openviduerrorname.html#browser_not_supported" class="tsd-kind-icon">BROWSER_<wbr>NOT_<wbr>SUPPORTED</a> <a href="openviduerrorname.html#browser_not_supported" class="tsd-kind-icon">BROWSER_<wbr>NOT_<wbr>SUPPORTED</a>
</li> </li>
<li class=" tsd-kind-enum-member tsd-parent-kind-enum"> <li class=" tsd-kind-enum-member tsd-parent-kind-enum">
<a href="openviduerrorname.html#camera_access_denied" class="tsd-kind-icon">CAMERA_<wbr>ACCESS_<wbr>DENIED</a> <a href="openviduerrorname.html#device_access_denied" class="tsd-kind-icon">DEVICE_<wbr>ACCESS_<wbr>DENIED</a>
</li> </li>
<li class=" tsd-kind-enum-member tsd-parent-kind-enum"> <li class=" tsd-kind-enum-member tsd-parent-kind-enum">
<a href="openviduerrorname.html#generic_error" class="tsd-kind-icon">GENERIC_<wbr>ERROR</a> <a href="openviduerrorname.html#generic_error" class="tsd-kind-icon">GENERIC_<wbr>ERROR</a>
@ -277,9 +342,6 @@
<li class=" tsd-kind-enum-member tsd-parent-kind-enum"> <li class=" tsd-kind-enum-member tsd-parent-kind-enum">
<a href="openviduerrorname.html#input_video_device_not_found" class="tsd-kind-icon">INPUT_<wbr>VIDEO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND</a> <a href="openviduerrorname.html#input_video_device_not_found" class="tsd-kind-icon">INPUT_<wbr>VIDEO_<wbr>DEVICE_<wbr>NOT_<wbr>FOUND</a>
</li> </li>
<li class=" tsd-kind-enum-member tsd-parent-kind-enum">
<a href="openviduerrorname.html#microphone_access_denied" class="tsd-kind-icon">MICROPHONE_<wbr>ACCESS_<wbr>DENIED</a>
</li>
<li class=" tsd-kind-enum-member tsd-parent-kind-enum"> <li class=" tsd-kind-enum-member tsd-parent-kind-enum">
<a href="openviduerrorname.html#no_input_source_set" class="tsd-kind-icon">NO_<wbr>INPUT_<wbr>SOURCE_<wbr>SET</a> <a href="openviduerrorname.html#no_input_source_set" class="tsd-kind-icon">NO_<wbr>INPUT_<wbr>SOURCE_<wbr>SET</a>
</li> </li>
@ -353,6 +415,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -374,6 +445,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -252,6 +252,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -273,6 +282,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="../interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="../interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="../interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -93,6 +93,9 @@
<li class="tsd-kind-class"><a href="classes/signalevent.html" class="tsd-kind-icon">Signal<wbr>Event</a></li> <li class="tsd-kind-class"><a href="classes/signalevent.html" class="tsd-kind-icon">Signal<wbr>Event</a></li>
<li class="tsd-kind-class"><a href="classes/stream.html" class="tsd-kind-icon">Stream</a></li> <li class="tsd-kind-class"><a href="classes/stream.html" class="tsd-kind-icon">Stream</a></li>
<li class="tsd-kind-class"><a href="classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a></li> <li class="tsd-kind-class"><a href="classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a></li>
<li class="tsd-kind-class"><a href="classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a></li>
<li class="tsd-kind-class"><a href="classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a></li>
<li class="tsd-kind-class"><a href="classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a></li>
<li class="tsd-kind-class"><a href="classes/subscriber.html" class="tsd-kind-icon">Subscriber</a></li> <li class="tsd-kind-class"><a href="classes/subscriber.html" class="tsd-kind-icon">Subscriber</a></li>
<li class="tsd-kind-class"><a href="classes/videoelementevent.html" class="tsd-kind-icon">Video<wbr>Element<wbr>Event</a></li> <li class="tsd-kind-class"><a href="classes/videoelementevent.html" class="tsd-kind-icon">Video<wbr>Element<wbr>Event</a></li>
</ul> </ul>
@ -105,6 +108,7 @@
<li class="tsd-kind-interface"><a href="interfaces/openviduadvancedconfiguration.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Advanced<wbr>Configuration</a></li> <li class="tsd-kind-interface"><a href="interfaces/openviduadvancedconfiguration.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Advanced<wbr>Configuration</a></li>
<li class="tsd-kind-interface"><a href="interfaces/publisherproperties.html" class="tsd-kind-icon">Publisher<wbr>Properties</a></li> <li class="tsd-kind-interface"><a href="interfaces/publisherproperties.html" class="tsd-kind-icon">Publisher<wbr>Properties</a></li>
<li class="tsd-kind-interface"><a href="interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a></li> <li class="tsd-kind-interface"><a href="interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a></li>
<li class="tsd-kind-interface"><a href="interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a></li>
<li class="tsd-kind-interface"><a href="interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a></li> <li class="tsd-kind-interface"><a href="interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a></li>
</ul> </ul>
</section> </section>
@ -173,6 +177,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -194,6 +207,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="interfaces/signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="interfaces/streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="interfaces/subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -207,6 +207,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -243,6 +252,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -80,6 +80,7 @@
<ul class="tsd-hierarchy"> <ul class="tsd-hierarchy">
<li><a href="../classes/publisher.html" class="tsd-signature-type">Publisher</a></li> <li><a href="../classes/publisher.html" class="tsd-signature-type">Publisher</a></li>
<li><a href="../classes/session.html" class="tsd-signature-type">Session</a></li> <li><a href="../classes/session.html" class="tsd-signature-type">Session</a></li>
<li><a href="../classes/streammanager.html" class="tsd-signature-type">StreamManager</a></li>
<li><a href="../classes/subscriber.html" class="tsd-signature-type">Subscriber</a></li> <li><a href="../classes/subscriber.html" class="tsd-signature-type">Subscriber</a></li>
</ul> </ul>
</section> </section>
@ -104,13 +105,13 @@
<a name="off" class="tsd-anchor"></a> <a name="off" class="tsd-anchor"></a>
<h3>off</h3> <h3>off</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
<li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li> <li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Object</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/EventDispatcher.ts#L35">OpenViduInternal/Interfaces/Public/EventDispatcher.ts:35</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/EventDispatcher.ts#L41">OpenViduInternal/Interfaces/Public/EventDispatcher.ts:41</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -145,7 +146,8 @@
</ul> </ul>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Object</span></h4>
<p>The object that dispatched the event</p>
</li> </li>
</ul> </ul>
</section> </section>
@ -159,7 +161,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/EventDispatcher.ts#L25">OpenViduInternal/Interfaces/Public/EventDispatcher.ts:25</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/EventDispatcher.ts#L27">OpenViduInternal/Interfaces/Public/EventDispatcher.ts:27</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -195,6 +197,7 @@
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <a href="eventdispatcher.html" class="tsd-signature-type">EventDispatcher</a></h4> <h4 class="tsd-returns-title">Returns <a href="eventdispatcher.html" class="tsd-signature-type">EventDispatcher</a></h4>
<p>The EventDispatcher object</p>
</li> </li>
</ul> </ul>
</section> </section>
@ -202,13 +205,13 @@
<a name="once" class="tsd-anchor"></a> <a name="once" class="tsd-anchor"></a>
<h3>once</h3> <h3>once</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
<li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li> <li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Object</span></li>
</ul> </ul>
<ul class="tsd-descriptions"> <ul class="tsd-descriptions">
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/EventDispatcher.ts#L30">OpenViduInternal/Interfaces/Public/EventDispatcher.ts:30</a></li> <li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/EventDispatcher.ts#L34">OpenViduInternal/Interfaces/Public/EventDispatcher.ts:34</a></li>
</ul> </ul>
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
@ -243,7 +246,8 @@
</ul> </ul>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Object</span></h4>
<p>The object that dispatched the event</p>
</li> </li>
</ul> </ul>
</section> </section>
@ -310,6 +314,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -346,6 +359,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -205,6 +205,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -241,6 +250,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -195,7 +195,7 @@
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Whether to initially publish to the session with the audio unmuted or muted. Only makes sense if property <code>audioSource</code> is NOT set to false. You can change the audio state later during the session with <a href="../classes/publisher.html#publishaudio">Publisher.publishAudio</a></p> <p>Whether to initially publish to the session with the audio unmuted or muted. Only makes sense if property <code>audioSource</code> is NOT set to <em>false</em> or <em>null</em>. You can change the audio state later during the session with <a href="../classes/publisher.html#publishaudio">Publisher.publishAudio</a></p>
</div> </div>
<dl class="tsd-comment-tags"> <dl class="tsd-comment-tags">
<dt>default</dt> <dt>default</dt>
@ -215,7 +215,7 @@
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Whether to initially publish to the session with the video enabled or disabled. Only makes sense if property <code>videoSource</code> is NOT set to false. You can change the video state later during the session with <a href="../classes/publisher.html#publishvideo">Publisher.publishVideo</a></p> <p>Whether to initially publish to the session with the video enabled or disabled. Only makes sense if property <code>videoSource</code> is NOT set to <em>false</em> or <em>null</em>. You can change the video state later during the session with <a href="../classes/publisher.html#publishvideo">Publisher.publishVideo</a></p>
</div> </div>
<dl class="tsd-comment-tags"> <dl class="tsd-comment-tags">
<dt>default</dt> <dt>default</dt>
@ -335,6 +335,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -386,6 +395,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -209,6 +209,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -245,6 +254,9 @@
</li> </li>
</ul> </ul>
<ul class="after-current"> <ul class="after-current">
<li class=" tsd-kind-interface">
<a href="streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a> <a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</a>
</li> </li>

View File

@ -0,0 +1,363 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>StreamManagerVideo | OpenVidu Browser</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-browser/" 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="streammanagervideo.html">StreamManagerVideo</a>
</li>
</ul>
<h1>Interface StreamManagerVideo</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">StreamManagerVideo</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>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="streammanagervideo.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="streammanagervideo.html#insertmode" class="tsd-kind-icon">insert<wbr>Mode</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="streammanagervideo.html#targetelement" class="tsd-kind-icon">target<wbr>Element</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="streammanagervideo.html#video" class="tsd-kind-icon">video</a></li>
</ul>
</section>
</div>
</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-interface">
<a name="id" class="tsd-anchor"></a>
<h3>id</h3>
<div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts#L33">OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts:33</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><code>id</code> attribute of the DOM video element displaying the StreamManager&#39;s stream</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="insertmode" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> insert<wbr>Mode</h3>
<div class="tsd-signature tsd-kind-icon">insert<wbr>Mode<span class="tsd-signature-symbol">:</span> <a href="../enums/videoinsertmode.html" class="tsd-signature-type">VideoInsertMode</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts#L55">OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts:55</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>How the DOM video element should be inserted with respect to <code>targetElement</code>. This property is defined when:</p>
<ul>
<li><a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a> or <a href="../classes/session.html#subscribe">Session.subscribe</a> methods have been called passing a valid <code>targetElement</code> parameter.</li>
<li>[[SessionManager.createVideoElement]] has been called.</li>
</ul>
</div>
<p>This property is undefined when:</p>
<ul>
<li><a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a> or <a href="../classes/session.html#subscribe">Session.subscribe</a> methods have been called passing <em>null</em> or <em>undefined</em> as <code>targetElement</code> parameter.</li>
<li>[[SessionManager.addVideoElement]] has been called.</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="targetelement" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> target<wbr>Element</h3>
<div class="tsd-signature tsd-kind-icon">target<wbr>Element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLElement</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts#L44">OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts:44</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The DOM HTMLElement assigned as target element when creating a video for the StreamManager. This property is defined when:</p>
<ul>
<li><a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a> or <a href="../classes/session.html#subscribe">Session.subscribe</a> methods have been called passing a valid <code>targetElement</code> parameter.</li>
<li>[[SessionManager.createVideoElement]] has been called.</li>
</ul>
</div>
<p>This property is undefined when:</p>
<ul>
<li><a href="../classes/openvidu.html#initpublisher">OpenVidu.initPublisher</a> or <a href="../classes/session.html#subscribe">Session.subscribe</a> methods have been called passing <em>null</em> or <em>undefined</em> as <code>targetElement</code> parameter.</li>
<li>[[SessionManager.addVideoElement]] has been called.</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="video" class="tsd-anchor"></a>
<h3>video</h3>
<div class="tsd-signature tsd-kind-icon">video<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">HTMLVideoElement</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts#L28">OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts:28</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>DOM video element displaying the StreamManager&#39;s stream</p>
</div>
</div>
</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/localrecorderstate.html" class="tsd-kind-icon">Local<wbr>Recorder<wbr>State</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/openviduerrorname.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Error<wbr>Name</a>
</li>
<li class=" tsd-kind-enum">
<a href="../enums/videoinsertmode.html" class="tsd-kind-icon">Video<wbr>Insert<wbr>Mode</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/connection.html" class="tsd-kind-icon">Connection</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/connectionevent.html" class="tsd-kind-icon">Connection<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/event.html" class="tsd-kind-icon">Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/localrecorder.html" class="tsd-kind-icon">Local<wbr>Recorder</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/openvidu.html" class="tsd-kind-icon">Open<wbr>Vidu</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/openviduerror.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Error</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/publisher.html" class="tsd-kind-icon">Publisher</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/publisherspeakingevent.html" class="tsd-kind-icon">Publisher<wbr>Speaking<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/recordingevent.html" class="tsd-kind-icon">Recording<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/session.html" class="tsd-kind-icon">Session</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/sessiondisconnectedevent.html" class="tsd-kind-icon">Session<wbr>Disconnected<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/signalevent.html" class="tsd-kind-icon">Signal<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/stream.html" class="tsd-kind-icon">Stream</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/videoelementevent.html" class="tsd-kind-icon">Video<wbr>Element<wbr>Event</a>
</li>
<li class=" tsd-kind-interface">
<a href="device.html" class="tsd-kind-icon">Device</a>
</li>
<li class=" tsd-kind-interface">
<a href="eventdispatcher.html" class="tsd-kind-icon">Event<wbr>Dispatcher</a>
</li>
<li class=" tsd-kind-interface">
<a href="openviduadvancedconfiguration.html" class="tsd-kind-icon">Open<wbr>Vidu<wbr>Advanced<wbr>Configuration</a>
</li>
<li class=" tsd-kind-interface">
<a href="publisherproperties.html" class="tsd-kind-icon">Publisher<wbr>Properties</a>
</li>
<li class=" tsd-kind-interface">
<a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="streammanagervideo.html#id" class="tsd-kind-icon">id</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="streammanagervideo.html#insertmode" class="tsd-kind-icon">insert<wbr>Mode</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="streammanagervideo.html#targetelement" class="tsd-kind-icon">target<wbr>Element</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="streammanagervideo.html#video" class="tsd-kind-icon">video</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="subscriberproperties.html" class="tsd-kind-icon">Subscriber<wbr>Properties</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>

View File

@ -222,6 +222,15 @@
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a> <a href="../classes/streamevent.html" class="tsd-kind-icon">Stream<wbr>Event</a>
</li> </li>
<li class=" tsd-kind-class">
<a href="../classes/streammanager.html" class="tsd-kind-icon">Stream<wbr>Manager</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streammanagerevent.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Event</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/streampropertychangedevent.html" class="tsd-kind-icon">Stream<wbr>Property<wbr>Changed<wbr>Event</a>
</li>
<li class=" tsd-kind-class"> <li class=" tsd-kind-class">
<a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a> <a href="../classes/subscriber.html" class="tsd-kind-icon">Subscriber</a>
</li> </li>
@ -243,6 +252,9 @@
<li class=" tsd-kind-interface"> <li class=" tsd-kind-interface">
<a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a> <a href="signaloptions.html" class="tsd-kind-icon">Signal<wbr>Options</a>
</li> </li>
<li class=" tsd-kind-interface">
<a href="streammanagervideo.html" class="tsd-kind-icon">Stream<wbr>Manager<wbr>Video</a>
</li>
</ul> </ul>
<ul class="current"> <ul class="current">
<li class="current tsd-kind-interface"> <li class="current tsd-kind-interface">

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var MediaElement = (function () {
function MediaElement() {
}
MediaElement.prototype.on = function (type, handler) {
throw new Error("Method not implemented.");
};
MediaElement.prototype.once = function (type, handler) {
throw new Error("Method not implemented.");
};
MediaElement.prototype.off = function (type, handler) {
throw new Error("Method not implemented.");
};
return MediaElement;
}());
exports.MediaElement = MediaElement;
//# sourceMappingURL=MediaElement.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MediaElement.js","sourceRoot":"","sources":["../../src/OpenVidu/MediaElement.ts"],"names":[],"mappings":";;AAuBA;IAAA;IAaA,CAAC;IAXG,yBAAE,GAAF,UAAG,IAAY,EAAE,OAA+B;QAC5C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,2BAAI,GAAJ,UAAK,IAAY,EAAE,OAA+B;QAC9C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,0BAAG,GAAH,UAAI,IAAY,EAAE,OAA8C;QAC5D,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IACL,mBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,oCAAY"}

View File

@ -0,0 +1,81 @@
import { Stream } from './Stream';
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
import { Event } from '../OpenViduInternal/Events/Event';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import EventEmitter = require('wolfy87-eventemitter');
/**
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any Publisher and Subscriber object, as well as
* any extra representation in the DOM you assign to some Stream by calling [[Stream.addVideoElement]].
*
* The use of this interface is useful when you don't need to differentiate between streams and just want to directly manage videos
*/
export declare class MediaManager implements EventDispatcher {
/**
* The Stream represented in the DOM by the MediaManager
*/
stream: Stream;
/**
* Whether the MediaManager is representing in the DOM a local Stream ([[Publisher]]) or a remote Stream ([[Subscriber]])
*/
remote: boolean;
/**
* The DOM HTMLElement assigned as target element when initializing the MediaManager. This property is defined when [[OpenVidu.initPublisher]]
* or [[Session.subscribe]] methods have been called passing a valid `targetElement` parameter. It is undefined when [[OpenVidu.initPublisher]]
* or [[Session.subscribe]] methods have been called passing *null* or *undefined* as `targetElement` parameter or when the MediaManager hass been
* created by calling [[Stream.addVideoElement]]
*/
targetElement?: HTMLElement;
/**
* The DOM HTMLVideoElement displaying the MediaManager's stream
*/
video: HTMLVideoElement;
/**
* `id` attribute of the DOM HTMLVideoElement displaying the MediaManager's stream
*/
id: string;
/**
* @hidden
*/
isVideoElementCreated: boolean;
/**
* @hidden
*/
protected ee: EventEmitter;
/**
* @hidden
*/
protected customEe: EventEmitter;
/**
* @hidden
*/
constructor(stream: Stream, targetElement?: HTMLElement | string);
/**
* See [[EventDispatcher.on]]
*/
on(type: string, handler: (event: Event) => void): EventDispatcher;
/**
* See [[EventDispatcher.once]]
*/
once(type: string, handler: (event: Event) => void): MediaManager;
/**
* See [[EventDispatcher.off]]
*/
off(type: string, handler?: (event: Event) => void): MediaManager;
/**
* @hidden
*/
insertVideo(targetElement?: HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement;
/**
* @hidden
*/
insertVideoWithMode(insertMode: VideoInsertMode): void;
/**
* @hidden
*/
removeVideo(): void;
/**
* @hidden
*/
addOnCanPlayEvent(): void;
private mirrorVideo();
}

View File

@ -0,0 +1,242 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var VideoElementEvent_1 = require("../OpenViduInternal/Events/VideoElementEvent");
var VideoInsertMode_1 = require("../OpenViduInternal/Enums/VideoInsertMode");
var EventEmitter = require("wolfy87-eventemitter");
var StreamManager = (function () {
function StreamManager(stream, targetElement) {
var _this = this;
this.videos = [];
this.isVideoElementCreated = false;
this.ee = new EventEmitter();
this.customEe = new EventEmitter();
this.stream = stream;
this.stream.streamManager = this;
if (typeof targetElement === 'string') {
var e = document.getElementById(targetElement);
if (!!e) {
this.targetElement = e;
}
}
else if (targetElement instanceof HTMLElement) {
this.targetElement = targetElement;
}
else if (!!this.targetElement) {
console.warn("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
}
this.customEe.on('video-removed', function (element) {
_this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent_1.VideoElementEvent(element, _this, 'videoElementDestroyed')]);
});
}
StreamManager.prototype.on = function (type, handler) {
var _this = this;
this.ee.on(type, function (event) {
if (event) {
console.info("Event '" + type + "' triggered", event);
}
else {
console.info("Event '" + type + "' triggered");
}
handler(event);
});
if (type === 'videoElementCreated') {
if (!!this.stream && this.isVideoElementCreatedAsync) {
this.isVideoElementCreated = false;
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.videos[0], this, 'videoElementCreated')]);
}
else {
this.customEe.on('video-element-created', function (element) {
_this.id = element.id;
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
});
}
}
if (type === 'videoPlaying') {
if (!this.stream.displayMyRemote() && !!this.video &&
this.video.currentTime > 0 &&
this.video.paused === false &&
this.video.ended === false &&
this.video.readyState === 4) {
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0], this, 'videoPlaying')]);
}
else {
this.customEe.on('video-is-playing', function (element) {
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
});
}
}
return this;
};
StreamManager.prototype.once = function (type, handler) {
var _this = this;
this.ee.once(type, function (event) {
if (event) {
console.info("Event '" + type + "' triggered once", event);
}
else {
console.info("Event '" + type + "' triggered once");
}
handler(event);
});
if (type === 'videoElementCreated') {
if (!!this.stream && this.isVideoElementCreated) {
this.isVideoElementCreated = false;
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.videos[0], this, 'videoElementCreated')]);
}
else {
this.customEe.once('video-element-created', function (element) {
_this.id = element.id;
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
});
}
}
if (type === 'videoPlaying') {
if (!this.stream.displayMyRemote() && this.video &&
this.video.currentTime > 0 &&
this.video.paused === false &&
this.video.ended === false &&
this.video.readyState === 4) {
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoPlaying')]);
}
else {
this.customEe.once('video-is-playing', function (element) {
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
});
}
}
return this;
};
StreamManager.prototype.off = function (type, handler) {
if (!handler) {
this.ee.removeAllListeners(type);
}
else {
this.ee.off(type, handler);
}
return this;
};
StreamManager.prototype.addVideoElement = function (video) {
this.initializeVideoProperties(video);
video.srcObject = this.stream.getMediaStream();
video.autoplay = true;
video.muted = this.stream.isLocal() ? true : false;
this.remote = !this.stream.isLocal();
streamManager.id = video.id;
};
StreamManager.prototype.createVideoElement = function (targetElement, insertMode) {
var tar;
if (typeof targetElement === 'string') {
var e = document.getElementById(targetElement);
if (!!e) {
tar = e;
}
else {
console.error("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
return;
}
}
else if (targetElement instanceof HTMLElement) {
tar = targetElement;
}
else if (!!this.targetElement) {
console.error("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
return;
}
this.insertVideo(tar, insertMode);
};
StreamManager.prototype.insertVideo = function (targetElement, insertMode) {
if (!!targetElement) {
var video = document.createElement('video');
this.initializeVideoProperties(video);
this.targetElement = targetElement;
var insMode = !!insertMode ? insertMode : VideoInsertMode_1.VideoInsertMode.APPEND;
this.insertVideoElementWithMode(video, insMode);
this.videos.push(video);
this.stream.session.videos[this.stream.connection.connectionId].push(video);
this.customEe.emitEvent('video-element-created', [{
element: video
}]);
this.isVideoElementCreated = true;
}
if (this.stream.isLocal()) {
this.stream.isLocalStreamReadyToPublish = true;
this.stream.ee.emitEvent('stream-ready-to-publish', []);
}
};
StreamManager.prototype.initializeVideoProperties = function (video) {
video.srcObject = this.stream.getMediaStream();
video.autoplay = true;
video.controls = false;
if (!video.id) {
video.id = (this.stream.isLocal() ? 'local-' : 'remote-') + 'video-' + this.stream.streamId;
}
if (this.stream.isLocal() && !this.stream.displayMyRemote()) {
video.muted = true;
if (this.stream.outboundStreamOpts.publisherProperties.mirror) {
this.mirrorVideo(video);
}
this.addOnCanPlayLocalVideoEvent(video);
}
};
StreamManager.prototype.insertVideoElementWithMode = function (video, insertMode) {
if (!!this.targetElement) {
switch (insertMode) {
case VideoInsertMode_1.VideoInsertMode.AFTER:
this.targetElement.parentNode.insertBefore(video, this.targetElement.nextSibling);
break;
case VideoInsertMode_1.VideoInsertMode.APPEND:
this.targetElement.appendChild(video);
break;
case VideoInsertMode_1.VideoInsertMode.BEFORE:
this.targetElement.parentNode.insertBefore(video, this.targetElement);
break;
case VideoInsertMode_1.VideoInsertMode.PREPEND:
this.targetElement.insertBefore(video, this.targetElement.childNodes[0]);
break;
case VideoInsertMode_1.VideoInsertMode.REPLACE:
this.targetElement.parentNode.replaceChild(video, this.targetElement);
break;
default:
this.insertVideoElementWithMode(video, VideoInsertMode_1.VideoInsertMode.APPEND);
}
}
};
StreamManager.prototype.removeVideos = function () {
var _this = this;
this.videos.forEach(function (video) {
video.parentNode.removeChild(video);
_this.customEe.emitEvent('video-removed', [video]);
});
this.videos = [];
delete this.stream.session.videos[this.stream.connection.connectionId];
};
StreamManager.prototype.addOnCanPlayLocalVideoEvent = function (video) {
var _this = this;
video.oncanplay = function () {
if (_this.stream.isLocal() && _this.stream.displayMyRemote()) {
console.info("Your own remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
_this.customEe.emitEvent('remote-video-is-playing', [{
element: video
}]);
}
else if (!_this.stream.isLocal() && !_this.stream.displayMyRemote()) {
console.info("Remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
_this.customEe.emitEvent('video-is-playing', [{
element: video
}]);
}
};
};
StreamManager.prototype.updateMediaStream = function (mediaStream) {
this.videos.forEach(function (video) {
video.srcObject = mediaStream;
});
};
StreamManager.prototype.mirrorVideo = function (video) {
video.style.transform = 'rotateY(180deg)';
video.style.webkitTransform = 'rotateY(180deg)';
};
return StreamManager;
}());
exports.StreamManager = StreamManager;
//# sourceMappingURL=MediaManager.js.map

File diff suppressed because one or more lines are too long

View File

@ -10,8 +10,11 @@ import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/Publi
* Use it to initialize objects of type [[Session]], [[Publisher]] and [[LocalRecorder]] * Use it to initialize objects of type [[Session]], [[Publisher]] and [[LocalRecorder]]
*/ */
export declare class OpenVidu { export declare class OpenVidu {
private session;
private jsonRpcClient; private jsonRpcClient;
/**
* @hidden
*/
session: Session;
/** /**
* @hidden * @hidden
*/ */

View File

@ -62,12 +62,13 @@ var OpenVidu = /** @class */ (function () {
* *
* The [[Publisher]] object will dispatch an `accessAllowed` or `accessDenied` event once it has been granted access to the requested input devices or not. * The [[Publisher]] object will dispatch an `accessAllowed` or `accessDenied` event once it has been granted access to the requested input devices or not.
* *
* The [[Publisher]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (if _targetElement_ not null or undefined) * The [[Publisher]] object will dispatch a `videoElementCreated` event once a HTML video element has been added to DOM (only if you
* [let OpenVidu take care of the video players](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.
* *
* The [[Publisher]] object will dispatch a `videoPlaying` event once the local video starts playing (only if `videoElementCreated` event has been previously dispatched) * The [[Publisher]] object will dispatch a `streamPlaying` event once the local streams starts playing. See [[StreamManagerEvent]] to learn more.
* *
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher will be inserted (see [[PublisherProperties.insertMode]]). If null or undefined no default video will be created for this Publisher * @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher will be inserted (see [[PublisherProperties.insertMode]]). If *null* or *undefined* no default video will be created for this Publisher.
* (you can always access the native MediaStream object by calling _Publisher.stream.getMediaStream()_ and use it as _srcObject_ of any HTML video element) * You can always call method [[Publisher.addVideoElement]] or [[Publisher.createVideoElement]] to manage the video elements on your own (see [Manage video players](/docs/how-do-i/manage-videos) section)
* @param completionHandler `error` parameter is null if `initPublisher` succeeds, and is defined if it fails. * @param completionHandler `error` parameter is null if `initPublisher` succeeds, and is defined if it fails.
* `completionHandler` function is called before the Publisher dispatches an `accessAllowed` or an `accessDenied` event * `completionHandler` function is called before the Publisher dispatches an `accessAllowed` or an `accessDenied` event
*/ */
@ -112,7 +113,7 @@ var OpenVidu = /** @class */ (function () {
} }
publisher.emitEvent('accessAllowed', []); publisher.emitEvent('accessAllowed', []);
})["catch"](function (error) { })["catch"](function (error) {
if (!!completionHandler !== undefined) { if (completionHandler !== undefined) {
completionHandler(error); completionHandler(error);
} }
publisher.emitEvent('accessDenied', []); publisher.emitEvent('accessDenied', []);
@ -245,7 +246,7 @@ var OpenVidu = /** @class */ (function () {
var errorName; var errorName;
var errorMessage = error.toString(); var errorMessage = error.toString();
if (!(options.videoSource === 'screen')) { if (!(options.videoSource === 'screen')) {
errorName = (options.videoSource === false || options.videoSource === null) ? OpenViduError_1.OpenViduErrorName.MICROPHONE_ACCESS_DENIED : OpenViduError_1.OpenViduErrorName.CAMERA_ACCESS_DENIED; errorName = OpenViduError_1.OpenViduErrorName.DEVICE_ACCESS_DENIED;
} }
else { else {
errorName = OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED; errorName = OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED;

File diff suppressed because one or more lines are too long

View File

@ -1,42 +1,33 @@
import { OpenVidu } from './OpenVidu'; import { OpenVidu } from './OpenVidu';
import { Session } from './Session'; import { Session } from './Session';
import { Stream } from './Stream'; import { StreamManager } from './StreamManager';
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher'; import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/PublisherProperties'; import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/PublisherProperties';
import { StreamEvent } from '../OpenViduInternal/Events/StreamEvent'; import { Event } from '../OpenViduInternal/Events/Event';
import { VideoElementEvent } from '../OpenViduInternal/Events/VideoElementEvent';
/** /**
* Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method * Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method
*/ */
export declare class Publisher implements EventDispatcher { export declare class Publisher extends StreamManager {
private openvidu; private openvidu;
/** /**
* Whether the Publisher has been granted access to the requested input devices or not * Whether the Publisher has been granted access to the requested input devices or not
*/ */
accessAllowed: boolean; accessAllowed: boolean;
/** /**
* HTML DOM element in which the Publisher's video has been inserted * Whether you have called [[Publisher.subscribeToRemote]] with value `true` or `false` (*false* by default)
*/ */
element: HTMLElement; isSubscribedToRemote: boolean;
/**
* DOM id of the Publisher's video element
*/
id: string;
/** /**
* The [[Session]] to which the Publisher belongs * The [[Session]] to which the Publisher belongs
*/ */
session: Session; session: Session;
/** private accessDenied;
* The [[Stream]] that you are publishing
*/
stream: Stream;
private ee;
private properties; private properties;
private permissionDialogTimeout; private permissionDialogTimeout;
/** /**
* @hidden * @hidden
*/ */
constructor(targetElement: string | HTMLElement, properties: PublisherProperties, openvidu: OpenVidu); constructor(targEl: string | HTMLElement, properties: PublisherProperties, openvidu: OpenVidu);
/** /**
* Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect * Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect
* @param value `true` to publish the audio stream, `false` to unpublish it * @param value `true` to publish the audio stream, `false` to unpublish it
@ -48,21 +39,17 @@ export declare class Publisher implements EventDispatcher {
*/ */
publishVideo(value: boolean): void; publishVideo(value: boolean): void;
/** /**
* Call this method before [[Session.publish]] to subscribe to your Publisher's stream as any other user would do. The local video will be automatically replaced by the remote video * Call this method before [[Session.publish]] to subscribe to your Publisher's remote stream instead of using the local stream, as any other user would do.
*/ */
subscribeToRemote(): void; subscribeToRemote(value?: boolean): void;
/** /**
* See [[EventDispatcher.on]] * See [[EventDispatcher.on]]
*/ */
on(type: string, handler: (event: StreamEvent | VideoElementEvent) => void): EventDispatcher; on(type: string, handler: (event: Event) => void): EventDispatcher;
/** /**
* See [[EventDispatcher.once]] * See [[EventDispatcher.once]]
*/ */
once(type: string, handler: (event: StreamEvent | VideoElementEvent) => void): Publisher; once(type: string, handler: (event: Event) => void): Publisher;
/**
* See [[EventDispatcher.off]]
*/
off(type: string, handler?: (event: StreamEvent | VideoElementEvent) => void): Publisher;
/** /**
* @hidden * @hidden
*/ */
@ -75,8 +62,10 @@ export declare class Publisher implements EventDispatcher {
* @hidden * @hidden
*/ */
emitEvent(type: string, eventArray: any[]): void; emitEvent(type: string, eventArray: any[]): void;
/**
* @hidden
*/
reestablishStreamPlayingEvent(): void;
private setPermissionDialogTimer(waitTime); private setPermissionDialogTimer(waitTime);
private clearPermissionDialogTimer(startTime, waitTime); private clearPermissionDialogTimer(startTime, waitTime);
private userMediaHasVideo(callback);
private userMediaHasAudio(callback);
} }

View File

@ -15,49 +15,50 @@
* limitations under the License. * limitations under the License.
* *
*/ */
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true; exports.__esModule = true;
var Session_1 = require("./Session");
var Stream_1 = require("./Stream"); var Stream_1 = require("./Stream");
var StreamManager_1 = require("./StreamManager");
var StreamEvent_1 = require("../OpenViduInternal/Events/StreamEvent"); var StreamEvent_1 = require("../OpenViduInternal/Events/StreamEvent");
var VideoElementEvent_1 = require("../OpenViduInternal/Events/VideoElementEvent"); var VideoElementEvent_1 = require("../OpenViduInternal/Events/VideoElementEvent");
var OpenViduError_1 = require("../OpenViduInternal/Enums/OpenViduError"); var OpenViduError_1 = require("../OpenViduInternal/Enums/OpenViduError");
var EventEmitter = require("wolfy87-eventemitter");
/** /**
* Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method * Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method
*/ */
var Publisher = /** @class */ (function () { var Publisher = /** @class */ (function (_super) {
__extends(Publisher, _super);
/** /**
* @hidden * @hidden
*/ */
function Publisher(targetElement, properties, openvidu) { function Publisher(targEl, properties, openvidu) {
var _this = this; var _this = _super.call(this, new Stream_1.Stream((!!openvidu.session) ? openvidu.session : new Session_1.Session(openvidu), { publisherProperties: properties, mediaConstraints: {} }), targEl) || this;
this.openvidu = openvidu; _this.openvidu = openvidu;
/** /**
* Whether the Publisher has been granted access to the requested input devices or not * Whether the Publisher has been granted access to the requested input devices or not
*/ */
this.accessAllowed = false; _this.accessAllowed = false;
this.ee = new EventEmitter(); /**
this.properties = properties; * Whether you have called [[Publisher.subscribeToRemote]] with value `true` or `false` (*false* by default)
this.stream = new Stream_1.Stream(this.session, { publisherProperties: properties, mediaConstraints: {} }); */
this.stream.on('video-removed', function (element) { _this.isSubscribedToRemote = false;
_this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent_1.VideoElementEvent(element, _this, 'videoElementDestroyed')]); _this.accessDenied = false;
}); _this.properties = properties;
this.stream.on('stream-destroyed-by-disconnect', function (reason) { _this.stream.ee.on('local-stream-destroyed-by-disconnect', function (reason) {
var streamEvent = new StreamEvent_1.StreamEvent(true, _this, 'streamDestroyed', _this.stream, reason); var streamEvent = new StreamEvent_1.StreamEvent(true, _this, 'streamDestroyed', _this.stream, reason);
_this.ee.emitEvent('streamDestroyed', [streamEvent]); _this.ee.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehaviour(); streamEvent.callDefaultBehaviour();
}); });
if (typeof targetElement === 'string') { return _this;
var e = document.getElementById(targetElement);
if (!!e) {
this.element = e;
}
}
else if (targetElement instanceof HTMLElement) {
this.element = targetElement;
}
if (!this.element) {
console.warn("The provided 'targetElement' for the Publisher couldn't be resolved to any HTML element: " + targetElement);
}
} }
/** /**
* Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect * Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect
@ -76,83 +77,45 @@ var Publisher = /** @class */ (function () {
console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its video stream'); console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its video stream');
}; };
/** /**
* Call this method before [[Session.publish]] to subscribe to your Publisher's stream as any other user would do. The local video will be automatically replaced by the remote video * Call this method before [[Session.publish]] to subscribe to your Publisher's remote stream instead of using the local stream, as any other user would do.
*/ */
Publisher.prototype.subscribeToRemote = function () { Publisher.prototype.subscribeToRemote = function (value) {
this.stream.subscribeToMyRemote(); value = (value !== undefined) ? value : true;
this.isSubscribedToRemote = value;
this.stream.subscribeToMyRemote(value);
}; };
/** /**
* See [[EventDispatcher.on]] * See [[EventDispatcher.on]]
*/ */
Publisher.prototype.on = function (type, handler) { Publisher.prototype.on = function (type, handler) {
var _this = this; var _this = this;
this.ee.on(type, function (event) { _super.prototype.on.call(this, type, handler);
if (event) {
console.info("Event '" + type + "' triggered by 'Publisher'", event);
}
else {
console.info("Event '" + type + "' triggered by 'Publisher'");
}
handler(event);
});
if (type === 'streamCreated') { if (type === 'streamCreated') {
if (!!this.stream && this.stream.isPublisherPublished) { if (!!this.stream && this.stream.isLocalStreamPublished) {
this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, this, 'streamCreated', this.stream, '')]); this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, this, 'streamCreated', this.stream, '')]);
} }
else { else {
this.stream.on('stream-created-by-publisher', function () { this.stream.ee.on('stream-created-by-publisher', function () {
_this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', _this.stream, '')]); _this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', _this.stream, '')]);
}); });
} }
} }
if (type === 'videoElementCreated') {
if (!!this.stream && this.stream.isVideoELementCreated) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'videoElementCreated')]);
}
else {
this.stream.on('video-element-created-by-stream', function (element) {
_this.id = element.id;
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
});
}
}
if (type === 'videoPlaying') {
var video = this.stream.getVideoElement();
if (!this.stream.displayMyRemote() && video &&
video.currentTime > 0 &&
video.paused === false &&
video.ended === false &&
video.readyState === 4) {
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'videoPlaying')]);
}
else {
this.stream.on('video-is-playing', function (element) {
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
});
}
}
if (type === 'remoteVideoPlaying') { if (type === 'remoteVideoPlaying') {
var video = this.stream.getVideoElement(); if (this.stream.displayMyRemote() && this.videos[0] && this.videos[0].video &&
if (this.stream.displayMyRemote() && video && this.videos[0].video.currentTime > 0 &&
video.currentTime > 0 && this.videos[0].video.paused === false &&
video.paused === false && this.videos[0].video.ended === false &&
video.ended === false && this.videos[0].video.readyState === 4) {
video.readyState === 4) { this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'remoteVideoPlaying')]);
this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'remoteVideoPlaying')]);
}
else {
this.stream.on('remote-video-is-playing', function (element) {
_this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'remoteVideoPlaying')]);
});
} }
} }
if (type === 'accessAllowed') { if (type === 'accessAllowed') {
if (this.stream.accessIsAllowed) { if (this.accessAllowed) {
this.ee.emitEvent('accessAllowed'); this.ee.emitEvent('accessAllowed');
} }
} }
if (type === 'accessDenied') { if (type === 'accessDenied') {
if (this.stream.accessIsDenied) { if (this.accessDenied) {
this.ee.emitEvent('accessDenied'); this.ee.emitEvent('accessDenied');
} }
} }
@ -163,90 +126,38 @@ var Publisher = /** @class */ (function () {
*/ */
Publisher.prototype.once = function (type, handler) { Publisher.prototype.once = function (type, handler) {
var _this = this; var _this = this;
this.ee.once(type, function (event) { _super.prototype.once.call(this, type, handler);
if (event) {
console.info("Event '" + type + "' triggered by 'Publisher'", event);
}
else {
console.info("Event '" + type + "' triggered by 'Publisher'");
}
handler(event);
});
if (type === 'streamCreated') { if (type === 'streamCreated') {
if (!!this.stream && this.stream.isPublisherPublished) { if (!!this.stream && this.stream.isLocalStreamPublished) {
this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, this, 'streamCreated', this.stream, '')]); this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, this, 'streamCreated', this.stream, '')]);
} }
else { else {
this.stream.once('stream-created-by-publisher', function () { this.stream.ee.once('stream-created-by-publisher', function () {
_this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', _this.stream, '')]); _this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', _this.stream, '')]);
}); });
} }
} }
if (type === 'videoElementCreated') {
if (!!this.stream && this.stream.isVideoELementCreated) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'videoElementCreated')]);
}
else {
this.stream.once('video-element-created-by-stream', function (element) {
_this.id = element.id;
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
});
}
}
if (type === 'videoPlaying') {
var video = this.stream.getVideoElement();
if (!this.stream.displayMyRemote() && video &&
video.currentTime > 0 &&
video.paused === false &&
video.ended === false &&
video.readyState === 4) {
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'videoPlaying')]);
}
else {
this.stream.once('video-is-playing', function (element) {
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
});
}
}
if (type === 'remoteVideoPlaying') { if (type === 'remoteVideoPlaying') {
var video = this.stream.getVideoElement(); if (this.stream.displayMyRemote() && this.videos[0] && this.videos[0].video &&
if (this.stream.displayMyRemote() && video && this.videos[0].video.currentTime > 0 &&
video.currentTime > 0 && this.videos[0].video.paused === false &&
video.paused === false && this.videos[0].video.ended === false &&
video.ended === false && this.videos[0].video.readyState === 4) {
video.readyState === 4) { this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'remoteVideoPlaying')]);
this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'remoteVideoPlaying')]);
}
else {
this.stream.once('remote-video-is-playing', function (element) {
_this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'remoteVideoPlaying')]);
});
} }
} }
if (type === 'accessAllowed') { if (type === 'accessAllowed') {
if (this.stream.accessIsAllowed) { if (this.accessAllowed) {
this.ee.emitEvent('accessAllowed'); this.ee.emitEvent('accessAllowed');
} }
} }
if (type === 'accessDenied') { if (type === 'accessDenied') {
if (this.stream.accessIsDenied) { if (this.accessDenied) {
this.ee.emitEvent('accessDenied'); this.ee.emitEvent('accessDenied');
} }
} }
return this; return this;
}; };
/**
* See [[EventDispatcher.off]]
*/
Publisher.prototype.off = function (type, handler) {
if (!handler) {
this.ee.removeAllListeners(type);
}
else {
this.ee.off(type, handler);
}
return this;
};
/* Hidden methods */ /* Hidden methods */
/** /**
* @hidden * @hidden
@ -255,13 +166,13 @@ var Publisher = /** @class */ (function () {
var _this = this; var _this = this;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
var errorCallback = function (openViduError) { var errorCallback = function (openViduError) {
_this.stream.accessIsDenied = true; _this.accessDenied = true;
_this.stream.accessIsAllowed = false; _this.accessAllowed = false;
reject(openViduError); reject(openViduError);
}; };
var successCallback = function (mediaStream) { var successCallback = function (mediaStream) {
_this.stream.accessIsAllowed = true; _this.accessAllowed = true;
_this.stream.accessIsDenied = false; _this.accessDenied = false;
if (_this.openvidu.isMediaStreamTrack(_this.properties.audioSource)) { if (_this.openvidu.isMediaStreamTrack(_this.properties.audioSource)) {
mediaStream.removeTrack(mediaStream.getAudioTracks()[0]); mediaStream.removeTrack(mediaStream.getAudioTracks()[0]);
mediaStream.addTrack(_this.properties.audioSource); mediaStream.addTrack(_this.properties.audioSource);
@ -278,7 +189,17 @@ var Publisher = /** @class */ (function () {
mediaStream.getVideoTracks()[0].enabled = !!_this.stream.outboundStreamOpts.publisherProperties.publishVideo; mediaStream.getVideoTracks()[0].enabled = !!_this.stream.outboundStreamOpts.publisherProperties.publishVideo;
} }
_this.stream.setMediaStream(mediaStream); _this.stream.setMediaStream(mediaStream);
_this.stream.insertVideo(_this.element, _this.properties.insertMode); if (!_this.stream.displayMyRemote()) {
// When we are subscribed to our remote we don't still set the MediaStream object in the video elements to
// avoid early 'streamPlaying' event
_this.stream.updateMediaStreamInVideos();
}
_this.stream.isLocalStreamReadyToPublish = true;
_this.stream.ee.emitEvent('stream-ready-to-publish', []);
if (!!_this.firstVideoElement) {
_this.createVideoElement(_this.firstVideoElement.targetElement, _this.properties.insertMode);
}
delete _this.firstVideoElement;
resolve(); resolve();
}; };
_this.openvidu.generateMediaConstraints(_this.properties) _this.openvidu.generateMediaConstraints(_this.properties)
@ -288,45 +209,95 @@ var Publisher = /** @class */ (function () {
publisherProperties: _this.properties publisherProperties: _this.properties
}; };
_this.stream.setOutboundStreamOptions(outboundStreamOptions); _this.stream.setOutboundStreamOptions(outboundStreamOptions);
// Ask independently for audio stream and video stream. If the user asks for both of them and one is blocked, the method still
// success only with the allowed input. This is not the desierd behaviour: if any of them is blocked, access should be denied
var constraintsAux = {}; var constraintsAux = {};
var timeForDialogEvent = 1250; var timeForDialogEvent = 1250;
if (_this.stream.isSendVideo()) { if (_this.stream.isSendVideo() || _this.stream.isSendAudio()) {
constraintsAux.audio = false; var definedAudioConstraint_1 = ((constraints.audio === undefined) ? true : constraints.audio);
constraintsAux.audio = _this.stream.isSendScreen() ? false : definedAudioConstraint_1;
constraintsAux.video = constraints.video; constraintsAux.video = constraints.video;
var startTime_1 = Date.now(); var startTime_1 = Date.now();
_this.setPermissionDialogTimer(timeForDialogEvent); _this.setPermissionDialogTimer(timeForDialogEvent);
navigator.mediaDevices.getUserMedia(constraintsAux) navigator.mediaDevices.getUserMedia(constraintsAux)
.then(function (videoOnlyStream) { .then(function (mediaStream) {
_this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent); _this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);
if (_this.stream.isSendAudio()) { if (_this.stream.isSendScreen() && _this.stream.isSendAudio()) {
constraintsAux.audio = (constraints.audio === undefined) ? true : constraints.audio; // When getting desktop as user media audio constraint must be false. Now we can ask for it if required
constraintsAux.audio = definedAudioConstraint_1;
constraintsAux.video = false; constraintsAux.video = false;
startTime_1 = Date.now(); startTime_1 = Date.now();
_this.setPermissionDialogTimer(timeForDialogEvent); _this.setPermissionDialogTimer(timeForDialogEvent);
navigator.mediaDevices.getUserMedia(constraintsAux) navigator.mediaDevices.getUserMedia(constraintsAux)
.then(function (audioOnlyStream) { .then(function (audioOnlyStream) {
_this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent); _this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);
videoOnlyStream.addTrack(audioOnlyStream.getAudioTracks()[0]); mediaStream.addTrack(audioOnlyStream.getAudioTracks()[0]);
successCallback(videoOnlyStream); successCallback(mediaStream);
})["catch"](function (error) { })["catch"](function (error) {
_this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent); _this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);
videoOnlyStream.getVideoTracks().forEach(function (track) { var errorName, errorMessage;
track.stop();
});
var errorName;
var errorMessage;
switch (error.name.toLowerCase()) { switch (error.name.toLowerCase()) {
case 'notfounderror': case 'notfounderror':
errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND; errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;
errorMessage = error.toString(); errorMessage = error.toString();
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
break; break;
case 'notallowederror': case 'notallowederror':
errorName = OpenViduError_1.OpenViduErrorName.MICROPHONE_ACCESS_DENIED; errorName = OpenViduError_1.OpenViduErrorName.DEVICE_ACCESS_DENIED;
errorMessage = error.toString(); errorMessage = error.toString();
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
break; break;
case 'overconstrainederror': case 'overconstrainederror':
if (error.constraint.toLowerCase() === 'deviceid') {
errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;
errorMessage = "Audio input device with deviceId '" + constraints.video.deviceId.exact + "' not found";
}
else {
errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;
errorMessage = "Audio input device doesn't support the value passed for constraint '" + error.constraint + "'";
}
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
break;
}
});
}
else {
successCallback(mediaStream);
}
})["catch"](function (error) {
_this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);
var errorName, errorMessage;
switch (error.name.toLowerCase()) {
case 'notfounderror':
navigator.mediaDevices.getUserMedia({
audio: false,
video: constraints.video
})
.then(function (mediaStream) {
mediaStream.getVideoTracks().forEach(function (track) {
track.stop();
});
errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;
errorMessage = error.toString();
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
})["catch"](function (e) {
errorName = OpenViduError_1.OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND;
errorMessage = error.toString();
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
});
break;
case 'notallowederror':
errorName = _this.stream.isSendScreen() ? OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED : OpenViduError_1.OpenViduErrorName.DEVICE_ACCESS_DENIED;
errorMessage = error.toString();
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
break;
case 'overconstrainederror':
navigator.mediaDevices.getUserMedia({
audio: false,
video: constraints.video
})
.then(function (mediaStream) {
mediaStream.getVideoTracks().forEach(function (track) {
track.stop();
});
if (error.constraint.toLowerCase() === 'deviceid') { if (error.constraint.toLowerCase() === 'deviceid') {
errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND; errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;
errorMessage = "Audio input device with deviceId '" + constraints.audio.deviceId.exact + "' not found"; errorMessage = "Audio input device with deviceId '" + constraints.audio.deviceId.exact + "' not found";
@ -335,27 +306,8 @@ var Publisher = /** @class */ (function () {
errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR; errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;
errorMessage = "Audio input device doesn't support the value passed for constraint '" + error.constraint + "'"; errorMessage = "Audio input device doesn't support the value passed for constraint '" + error.constraint + "'";
} }
}
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage)); errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
}); })["catch"](function (e) {
}
else {
successCallback(videoOnlyStream);
}
})["catch"](function (error) {
_this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);
var errorName;
var errorMessage;
switch (error.name.toLowerCase()) {
case 'notfounderror':
errorName = OpenViduError_1.OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND;
errorMessage = error.toString();
break;
case 'notallowederror':
errorName = _this.stream.isSendScreen() ? OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED : OpenViduError_1.OpenViduErrorName.CAMERA_ACCESS_DENIED;
errorMessage = error.toString();
break;
case 'overconstrainederror':
if (error.constraint.toLowerCase() === 'deviceid') { if (error.constraint.toLowerCase() === 'deviceid') {
errorName = OpenViduError_1.OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND; errorName = OpenViduError_1.OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND;
errorMessage = "Video input device with deviceId '" + constraints.video.deviceId.exact + "' not found"; errorMessage = "Video input device with deviceId '" + constraints.video.deviceId.exact + "' not found";
@ -364,43 +316,10 @@ var Publisher = /** @class */ (function () {
errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR; errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;
errorMessage = "Video input device doesn't support the value passed for constraint '" + error.constraint + "'"; errorMessage = "Video input device doesn't support the value passed for constraint '" + error.constraint + "'";
} }
}
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage)); errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
}); });
}
else if (_this.stream.isSendAudio()) {
constraintsAux.audio = (constraints.audio === undefined) ? true : constraints.audio;
constraintsAux.video = false;
var startTime_2 = Date.now();
_this.setPermissionDialogTimer(timeForDialogEvent);
navigator.mediaDevices.getUserMedia(constraints)
.then(function (audioOnlyStream) {
_this.clearPermissionDialogTimer(startTime_2, timeForDialogEvent);
successCallback(audioOnlyStream);
})["catch"](function (error) {
_this.clearPermissionDialogTimer(startTime_2, timeForDialogEvent);
var errorName;
var errorMessage;
switch (error.name.toLowerCase()) {
case 'notfounderror':
errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;
errorMessage = error.toString();
break; break;
case 'notallowederror':
errorName = OpenViduError_1.OpenViduErrorName.MICROPHONE_ACCESS_DENIED;
errorMessage = error.toString();
break;
case 'overconstrainederror':
if (error.constraint.toLowerCase() === 'deviceid') {
errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;
errorMessage = "Audio input device with deviceId '" + constraints.audio.deviceId.exact + "' not found";
} }
else {
errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;
errorMessage = "Audio input device doesn't support the value passed for constraint '" + error.constraint + "'";
}
}
errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));
}); });
} }
else { else {
@ -424,6 +343,14 @@ var Publisher = /** @class */ (function () {
Publisher.prototype.emitEvent = function (type, eventArray) { Publisher.prototype.emitEvent = function (type, eventArray) {
this.ee.emitEvent(type, eventArray); this.ee.emitEvent(type, eventArray);
}; };
/**
* @hidden
*/
Publisher.prototype.reestablishStreamPlayingEvent = function () {
if (this.ee.getListeners('streamPlaying').length > 0) {
this.addPlayEventToFirstVideo();
}
};
/* Private methods */ /* Private methods */
Publisher.prototype.setPermissionDialogTimer = function (waitTime) { Publisher.prototype.setPermissionDialogTimer = function (waitTime) {
var _this = this; var _this = this;
@ -438,40 +365,7 @@ var Publisher = /** @class */ (function () {
this.ee.emitEvent('accessDialogClosed', []); this.ee.emitEvent('accessDialogClosed', []);
} }
}; };
/* Private methods */
Publisher.prototype.userMediaHasVideo = function (callback) {
var _this = this;
return new Promise(function (resolve, reject) {
// If the user is going to publish its screen there's a video source
if ((typeof _this.properties.videoSource === 'string') && _this.properties.videoSource === 'screen') {
resolve(true);
}
else {
_this.openvidu.getDevices()
.then(function (devices) {
resolve(!!(devices.filter(function (device) {
return device.kind === 'videoinput';
})[0]));
})["catch"](function (error) {
reject(error);
});
}
});
};
Publisher.prototype.userMediaHasAudio = function (callback) {
var _this = this;
return new Promise(function (resolve, reject) {
_this.openvidu.getDevices()
.then(function (devices) {
resolve(!!(devices.filter(function (device) {
return device.kind === 'audioinput';
})[0]));
})["catch"](function (error) {
reject(error);
});
});
};
return Publisher; return Publisher;
}()); }(StreamManager_1.StreamManager));
exports.Publisher = Publisher; exports.Publisher = Publisher;
//# sourceMappingURL=Publisher.js.map //# sourceMappingURL=Publisher.js.map

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@ import { Connection } from './Connection';
import { OpenVidu } from './OpenVidu'; import { OpenVidu } from './OpenVidu';
import { Publisher } from './Publisher'; import { Publisher } from './Publisher';
import { Stream } from './Stream'; import { Stream } from './Stream';
import { StreamManager } from './StreamManager';
import { Subscriber } from './Subscriber'; import { Subscriber } from './Subscriber';
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher'; import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
import { SignalOptions } from '../OpenViduInternal/Interfaces/Public/SignalOptions'; import { SignalOptions } from '../OpenViduInternal/Interfaces/Public/SignalOptions';
@ -17,7 +18,7 @@ import { SignalEvent } from '../OpenViduInternal/Events/SignalEvent';
import { StreamEvent } from '../OpenViduInternal/Events/StreamEvent'; import { StreamEvent } from '../OpenViduInternal/Events/StreamEvent';
/** /**
* Represents a video call. It can also be seen as a videoconference room where multiple users can connect. * Represents a video call. It can also be seen as a videoconference room where multiple users can connect.
* Participants who publish their videos to a session will be seen by the rest of users connected to that specific session. * Participants who publish their videos to a session can be seen by the rest of users connected to that specific session.
* Initialized with [[OpenVidu.initSession]] method * Initialized with [[OpenVidu.initSession]] method
*/ */
export declare class Session implements EventDispatcher { export declare class Session implements EventDispatcher {
@ -26,9 +27,13 @@ export declare class Session implements EventDispatcher {
*/ */
connection: Connection; connection: Connection;
/** /**
* Unique identifier of the Session. This is the same value you pass when calling [[OpenVidu.initSession]] * Unique identifier of the Session
*/ */
sessionId: string; sessionId: string;
/**
* Collection of all StreamManagers of this Session ([[Publisher]] and [[Subscriber]])
*/
streamManagers: StreamManager[];
/** /**
* @hidden * @hidden
*/ */
@ -63,18 +68,23 @@ export declare class Session implements EventDispatcher {
* *
* The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event. * The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event.
* This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) * This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and also delete the HTML video element associated to it. * and also deletes any HTML video element associated to each Subscriber (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` to avoid this beahviour and take care of disposing and cleaning all the Subscriber objects yourself. See [[SessionDisconnectedEvent]] to learn more. * For every video removed, each Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `sessionDisconnected` to avoid this behaviour and take care of disposing and cleaning all the Subscriber objects yourself.
* See [[SessionDisconnectedEvent]] and [[VideoElementEvent]] to learn more to learn more.
* *
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session. * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session.
* This event will automatically stop all media tracks and delete the HTML video element associated to it. * This event will automatically stop all media tracks and delete any HTML video element associated to it (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` if you want clean the Publisher object yourself or re-publish it in a different Session (to do so it is a mandatory * For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* requirement to call `Session.unpublish()` or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] to learn more. * Call `event.preventDefault()` uppon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session (to do so it is a mandatory requirement to call `Session.unpublish()`
* or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing. * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and delete the HTML video element associated to it. * and also deletes any HTML video element associated to that Subscriber (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. See [[StreamEvent]] to learn more. * For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself.
* See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more. * The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more.
*/ */
@ -89,42 +99,48 @@ export declare class Session implements EventDispatcher {
subscribeAsync(stream: Stream, targetElement: string | HTMLElement): Promise<Subscriber>; subscribeAsync(stream: Stream, targetElement: string | HTMLElement): Promise<Subscriber>;
subscribeAsync(stream: Stream, targetElement: string | HTMLElement, properties: SubscriberProperties): Promise<Subscriber>; subscribeAsync(stream: Stream, targetElement: string | HTMLElement, properties: SubscriberProperties): Promise<Subscriber>;
/** /**
* Unsubscribes from `subscriber`, automatically removing its HTML video element. * Unsubscribes from `subscriber`, automatically removing its associated HTML video elements.
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Subscriber]] object will dispatch a `videoElementDestroyed` event (only if it previously dispatched a `videoElementCreated` event). See [[VideoElementEvent]] to learn more * The [[Subscriber]] object will dispatch a `videoElementDestroyed` event for each video associated to it that was removed from DOM.
* Only videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)) will be automatically removed
*
* See [[VideoElementEvent]] to learn more
*/ */
unsubscribe(subscriber: Subscriber): void; unsubscribe(subscriber: Subscriber): void;
/** /**
* Publishes the participant's audio-video stream contained in `publisher` object to the session * Publishes to the Session the Publisher object
* *
* #### Events dispatched * #### Events dispatched
* *
* The local [[Publisher]] object will dispatch a `streamCreated` event upon successful termination of this method. See [[StreamEvent]] to learn more. * The local [[Publisher]] object will dispatch a `streamCreated` event upon successful termination of this method. See [[StreamEvent]] to learn more.
* *
* The local [[Publisher]] object will dispatch a `remoteVideoPlaying` event only if [[Publisher.subscribeToRemote]] was called before this method, once the remote video starts playing. * The local [[Publisher]] object will dispatch a `streamPlaying` once the media stream starts playing. See [[StreamManagerEvent]] to learn more.
* See [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamCreated` event so they can subscribe to it. See [[StreamEvent]] to learn more. * The [[Session]] object of every other participant connected to the session will dispatch a `streamCreated` event so they can subscribe to it. See [[StreamEvent]] to learn more.
* *
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the publisher was successfully published and rejected with an Error object if not * @returns A Promise (to which you can optionally subscribe to) that is resolved only after the publisher was successfully published and rejected with an Error object if not
*/ */
publish(publisher: Publisher): Promise<any>; publish(publisher: Publisher): Promise<any>;
/** /**
* Unpublishes the participant's audio-video stream contained in `publisher` object. * Unpublishes from the Session the Publisher object.
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event. * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event.
* This event will automatically stop all media tracks and delete the HTML video element associated to it. * This event will automatically stop all media tracks and delete any HTML video element associated to this Publisher
* Call `event.preventDefault()` if you want clean the Publisher object yourself or re-publish it in a different Session. * (only those videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event. * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and delete the HTML video element associated to it. * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and
* Call `event.preventDefault()` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. * delete any HTML video element associated to it (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object on your own.
* *
* See [[StreamEvent]] to learn more. * See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
*/ */
unpublish(publisher: Publisher): void; unpublish(publisher: Publisher): void;
/** /**

View File

@ -29,7 +29,7 @@ var platform = require("platform");
var EventEmitter = require("wolfy87-eventemitter"); var EventEmitter = require("wolfy87-eventemitter");
/** /**
* Represents a video call. It can also be seen as a videoconference room where multiple users can connect. * Represents a video call. It can also be seen as a videoconference room where multiple users can connect.
* Participants who publish their videos to a session will be seen by the rest of users connected to that specific session. * Participants who publish their videos to a session can be seen by the rest of users connected to that specific session.
* Initialized with [[OpenVidu.initSession]] method * Initialized with [[OpenVidu.initSession]] method
*/ */
var Session = /** @class */ (function () { var Session = /** @class */ (function () {
@ -37,6 +37,10 @@ var Session = /** @class */ (function () {
* @hidden * @hidden
*/ */
function Session(openvidu) { function Session(openvidu) {
/**
* Collection of all StreamManagers of this Session ([[Publisher]] and [[Subscriber]])
*/
this.streamManagers = [];
// This map is only used to avoid race condition between 'joinRoom' response and 'onParticipantPublished' notification // This map is only used to avoid race condition between 'joinRoom' response and 'onParticipantPublished' notification
/** /**
* @hidden * @hidden
@ -70,14 +74,14 @@ var Session = /** @class */ (function () {
* - Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have * - Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have
* successfully connected will also dispatch a `connectionCreated` event when they do so. * successfully connected will also dispatch a `connectionCreated` event when they do so.
* *
* The [[Session]] object of the local participant will also dispatch a `streamCreated` event for each remote active [[Publisher]] after dispatching all remote * The [[Session]] object of the local participant will also dispatch a `streamCreated` event for each remote active [[Publisher]] that was already streaming
* `connectionCreated` events. * when connecting, just after dispatching all remote `connectionCreated` events.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `connectionCreated` event. * The [[Session]] object of every other participant connected to the session will dispatch a `connectionCreated` event.
* *
* See [[ConnectionEvent]] and [[StreamEvent]] to learn more. * See [[ConnectionEvent]] and [[StreamEvent]] to learn more.
* *
* @returns A Promise to which you must subscribe that is resolved if the recording successfully started and rejected with an Error object if not * @returns A Promise to which you must subscribe that is resolved if the the connection to the Session was successful and rejected with an Error object if not
* *
*/ */
Session.prototype.connect = function (token, metadata) { Session.prototype.connect = function (token, metadata) {
@ -109,18 +113,23 @@ var Session = /** @class */ (function () {
* *
* The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event. * The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event.
* This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) * This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and also delete the HTML video element associated to it. * and also deletes any HTML video element associated to each Subscriber (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` to avoid this beahviour and take care of disposing and cleaning all the Subscriber objects yourself. See [[SessionDisconnectedEvent]] to learn more. * For every video removed, each Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `sessionDisconnected` to avoid this behaviour and take care of disposing and cleaning all the Subscriber objects yourself.
* See [[SessionDisconnectedEvent]] and [[VideoElementEvent]] to learn more to learn more.
* *
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session. * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session.
* This event will automatically stop all media tracks and delete the HTML video element associated to it. * This event will automatically stop all media tracks and delete any HTML video element associated to it (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` if you want clean the Publisher object yourself or re-publish it in a different Session (to do so it is a mandatory * For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* requirement to call `Session.unpublish()` or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] to learn more. * Call `event.preventDefault()` uppon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session (to do so it is a mandatory requirement to call `Session.unpublish()`
* or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing. * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and delete the HTML video element associated to it. * and also deletes any HTML video element associated to that Subscriber (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. See [[StreamEvent]] to learn more. * For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself.
* See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more. * The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more.
*/ */
@ -132,15 +141,14 @@ var Session = /** @class */ (function () {
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Subscriber]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (if _targetElement_ not null or undefined) * The [[Subscriber]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (only if you
* [let OpenVidu take care of the video players](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.
* *
* The [[Subscriber]] object will dispatch a `videoPlaying` event once the remote video starts playing (only if `videoElementCreated` event has been previously dispatched) * The [[Subscriber]] object will dispatch a `streamPlaying` event once the remote stream starts playing. See [[StreamManagerEvent]] to learn more.
*
* See [[VideoElementEvent]] to learn more.
* *
* @param stream Stream object to subscribe to * @param stream Stream object to subscribe to
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Subscriber will be inserted (see [[SubscriberProperties.insertMode]]). If null or undefined no default video will be created for this Subscriber * @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Subscriber will be inserted (see [[SubscriberProperties.insertMode]]). If *null* or *undefined* no default video will be created for this Subscriber.
* (you can always access the native MediaStream object by calling _Subscriber.stream.getMediaStream()_ and use it as _srcObject_ of any HTML video element) * You can always call method [[Subscriber.addVideoElement]] or [[Subscriber.createVideoElement]] to manage the video elements on your own (see [Manage video players](/docs/how-do-i/manage-videos) section)
* @param completionHandler `error` parameter is null if `subscribe` succeeds, and is defined if it fails. * @param completionHandler `error` parameter is null if `subscribe` succeeds, and is defined if it fails.
*/ */
Session.prototype.subscribe = function (stream, targetElement, param3, param4) { Session.prototype.subscribe = function (stream, targetElement, param3, param4) {
@ -179,7 +187,9 @@ var Session = /** @class */ (function () {
} }
}); });
var subscriber = new Subscriber_1.Subscriber(stream, targetElement, properties); var subscriber = new Subscriber_1.Subscriber(stream, targetElement, properties);
stream.insertVideo(subscriber.element, properties.insertMode); if (!!subscriber.targetElement) {
stream.streamManager.createVideoElement(subscriber.targetElement, properties.insertMode);
}
return subscriber; return subscriber;
}; };
Session.prototype.subscribeAsync = function (stream, targetElement, properties) { Session.prototype.subscribeAsync = function (stream, targetElement, properties) {
@ -203,18 +213,19 @@ var Session = /** @class */ (function () {
}); });
}; };
/** /**
* Unsubscribes from `subscriber`, automatically removing its HTML video element. * Unsubscribes from `subscriber`, automatically removing its associated HTML video elements.
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Subscriber]] object will dispatch a `videoElementDestroyed` event (only if it previously dispatched a `videoElementCreated` event). See [[VideoElementEvent]] to learn more * The [[Subscriber]] object will dispatch a `videoElementDestroyed` event for each video associated to it that was removed from DOM.
* Only videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)) will be automatically removed
*
* See [[VideoElementEvent]] to learn more
*/ */
Session.prototype.unsubscribe = function (subscriber) { Session.prototype.unsubscribe = function (subscriber) {
var connectionId = subscriber.stream.connection.connectionId; var connectionId = subscriber.stream.connection.connectionId;
console.info('Unsubscribing from ' + connectionId); console.info('Unsubscribing from ' + connectionId);
this.openvidu.sendRequest('unsubscribeFromVideo', { this.openvidu.sendRequest('unsubscribeFromVideo', { sender: subscriber.stream.connection.connectionId }, function (error, response) {
sender: subscriber.stream.connection.connectionId
}, function (error, response) {
if (error) { if (error) {
console.error('Error unsubscribing from ' + connectionId, error); console.error('Error unsubscribing from ' + connectionId, error);
} }
@ -224,28 +235,27 @@ var Session = /** @class */ (function () {
subscriber.stream.disposeWebRtcPeer(); subscriber.stream.disposeWebRtcPeer();
subscriber.stream.disposeMediaStream(); subscriber.stream.disposeMediaStream();
}); });
subscriber.stream.removeVideo(); subscriber.stream.streamManager.removeAllVideos();
}; };
/** /**
* Publishes the participant's audio-video stream contained in `publisher` object to the session * Publishes to the Session the Publisher object
* *
* #### Events dispatched * #### Events dispatched
* *
* The local [[Publisher]] object will dispatch a `streamCreated` event upon successful termination of this method. See [[StreamEvent]] to learn more. * The local [[Publisher]] object will dispatch a `streamCreated` event upon successful termination of this method. See [[StreamEvent]] to learn more.
* *
* The local [[Publisher]] object will dispatch a `remoteVideoPlaying` event only if [[Publisher.subscribeToRemote]] was called before this method, once the remote video starts playing. * The local [[Publisher]] object will dispatch a `streamPlaying` once the media stream starts playing. See [[StreamManagerEvent]] to learn more.
* See [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamCreated` event so they can subscribe to it. See [[StreamEvent]] to learn more. * The [[Session]] object of every other participant connected to the session will dispatch a `streamCreated` event so they can subscribe to it. See [[StreamEvent]] to learn more.
* *
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the publisher was successfully published and rejected with an Error object if not * @returns A Promise (to which you can optionally subscribe to) that is resolved only after the publisher was successfully published and rejected with an Error object if not
*/ */
Session.prototype.publish = function (publisher) { Session.prototype.publish = function (publisher) {
var _this = this; var _this = this;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
publisher.session = _this; publisher.session = _this;
publisher.stream.session = _this; publisher.stream.session = _this;
if (!publisher.stream.isPublisherPublished) { if (!publisher.stream.isLocalStreamPublished) {
// 'Session.unpublish(Publisher)' has NOT been called // 'Session.unpublish(Publisher)' has NOT been called
_this.connection.addStream(publisher.stream); _this.connection.addStream(publisher.stream);
publisher.stream.publish() publisher.stream.publish()
@ -260,6 +270,7 @@ var Session = /** @class */ (function () {
publisher.initialize() publisher.initialize()
.then(function () { .then(function () {
_this.connection.addStream(publisher.stream); _this.connection.addStream(publisher.stream);
publisher.reestablishStreamPlayingEvent();
publisher.stream.publish() publisher.stream.publish()
.then(function () { .then(function () {
resolve(); resolve();
@ -273,19 +284,23 @@ var Session = /** @class */ (function () {
}); });
}; };
/** /**
* Unpublishes the participant's audio-video stream contained in `publisher` object. * Unpublishes from the Session the Publisher object.
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event. * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event.
* This event will automatically stop all media tracks and delete the HTML video element associated to it. * This event will automatically stop all media tracks and delete any HTML video element associated to this Publisher
* Call `event.preventDefault()` if you want clean the Publisher object yourself or re-publish it in a different Session. * (only those videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event. * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and delete the HTML video element associated to it. * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and
* Call `event.preventDefault()` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. * delete any HTML video element associated to it (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object on your own.
* *
* See [[StreamEvent]] to learn more. * See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
*/ */
Session.prototype.unpublish = function (publisher) { Session.prototype.unpublish = function (publisher) {
var stream = publisher.stream; var stream = publisher.stream;
@ -664,9 +679,12 @@ var Session = /** @class */ (function () {
this.openvidu.closeWs(); this.openvidu.closeWs();
} }
if (!!this.connection.stream) { if (!!this.connection.stream) {
// Make Publisher object dispatch 'streamDestroyed' event (if there's a local stream) // Dispose Publisher's local stream
this.connection.stream.disposeWebRtcPeer(); this.connection.stream.disposeWebRtcPeer();
this.connection.stream.emitEvent('stream-destroyed-by-disconnect', [reason]); if (this.connection.stream.isLocalStreamPublished) {
// Make Publisher object dispatch 'streamDestroyed' event if the Stream was published
this.connection.stream.ee.emitEvent('local-stream-destroyed-by-disconnect', [reason]);
}
} }
if (!this.connection.disposed) { if (!this.connection.disposed) {
// Make Session object dispatch 'sessionDisconnected' event (if it is not already disposed) // Make Session object dispatch 'sessionDisconnected' event (if it is not already disposed)

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,13 @@
import { Connection } from './Connection'; import { Connection } from './Connection';
import { Session } from './Session'; import { Session } from './Session';
import { StreamManager } from './StreamManager';
import { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions'; import { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions';
import { OutboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/OutboundStreamOptions'; import { OutboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/OutboundStreamOptions';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode'; import EventEmitter = require('wolfy87-eventemitter');
/** /**
* Represents each one of the videos send and receive by a user in a session. * Represents each one of the media streams available in OpenVidu Server for certain session.
* Therefore each [[Publisher]] and [[Subscriber]] has an attribute of type Stream * Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access
* to one of them (sending and receiving it, respectively)
*/ */
export declare class Stream { export declare class Stream {
/** /**
@ -13,7 +15,8 @@ export declare class Stream {
*/ */
connection: Connection; connection: Connection;
/** /**
* Frame rate of the video in frames per second. This property is only defined if the [[Publisher]] of the stream was initialized passing a _frameRate_ property on [[OpenVidu.initPublisher]] method * Frame rate of the video in frames per second. This property is only defined if the [[Publisher]] of
* the stream was initialized passing a _frameRate_ property on [[OpenVidu.initPublisher]] method
*/ */
frameRate?: number; frameRate?: number;
/** /**
@ -29,37 +32,29 @@ export declare class Stream {
*/ */
streamId: string; streamId: string;
/** /**
* `"CAMERA"` or `"SCREEN"`. undefined if stream is audio-only * `"CAMERA"` or `"SCREEN"`. *undefined* if stream is audio-only
*/ */
typeOfVideo?: string; typeOfVideo?: string;
private ee; /**
* StreamManager object ([[Publisher]] or [[Subscriber]]) in charge of displaying this stream in the DOM
*/
streamManager: StreamManager;
/**
* @hidden
*/
ee: EventEmitter;
private webRtcPeer; private webRtcPeer;
private mediaStream; private mediaStream;
private video;
private targetElement;
private parentId;
private webRtcStats; private webRtcStats;
private isSubscribeToRemote; private isSubscribeToRemote;
/** /**
* @hidden * @hidden
*/ */
isReadyToPublish: boolean; isLocalStreamReadyToPublish: boolean;
/** /**
* @hidden * @hidden
*/ */
isPublisherPublished: boolean; isLocalStreamPublished: boolean;
/**
* @hidden
*/
isVideoELementCreated: boolean;
/**
* @hidden
*/
accessIsAllowed: boolean;
/**
* @hidden
*/
accessIsDenied: boolean;
/** /**
* @hidden * @hidden
*/ */
@ -88,6 +83,10 @@ export declare class Stream {
* @hidden * @hidden
*/ */
setMediaStream(mediaStream: MediaStream): void; setMediaStream(mediaStream: MediaStream): void;
/**
* @hidden
*/
updateMediaStreamInVideos(): void;
/** /**
* @hidden * @hidden
*/ */
@ -99,11 +98,7 @@ export declare class Stream {
/** /**
* @hidden * @hidden
*/ */
getVideoElement(): HTMLVideoElement; subscribeToMyRemote(value: boolean): void;
/**
* @hidden
*/
subscribeToMyRemote(): void;
/** /**
* @hidden * @hidden
*/ */
@ -128,22 +123,6 @@ export declare class Stream {
* @hidden * @hidden
*/ */
displayMyRemote(): boolean; displayMyRemote(): boolean;
/**
* @hidden
*/
on(eventName: string, listener: any): void;
/**
* @hidden
*/
once(eventName: string, listener: any): void;
/**
* @hidden
*/
insertVideo(targetElement?: HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement;
/**
* @hidden
*/
removeVideo(): void;
/** /**
* @hidden * @hidden
*/ */
@ -156,10 +135,6 @@ export declare class Stream {
* @hidden * @hidden
*/ */
isSendScreen(): boolean; isSendScreen(): boolean;
/**
* @hidden
*/
emitEvent(type: string, eventArray: any[]): void;
/** /**
* @hidden * @hidden
*/ */
@ -181,7 +156,8 @@ export declare class Stream {
private processSdpAnswer(sdpAnswer); private processSdpAnswer(sdpAnswer);
private initWebRtcStats(); private initWebRtcStats();
private stopWebRtcStats(); private stopWebRtcStats();
private isLocal(); /**
private insertElementWithMode(element, insertMode); * @hidden
private mirrorVideo(video); */
isLocal(): boolean;
} }

View File

@ -20,10 +20,10 @@ var WebRtcStats_1 = require("../OpenViduInternal/WebRtcStats/WebRtcStats");
var PublisherSpeakingEvent_1 = require("../OpenViduInternal/Events/PublisherSpeakingEvent"); var PublisherSpeakingEvent_1 = require("../OpenViduInternal/Events/PublisherSpeakingEvent");
var EventEmitter = require("wolfy87-eventemitter"); var EventEmitter = require("wolfy87-eventemitter");
var kurentoUtils = require("../OpenViduInternal/KurentoUtils/kurento-utils-js"); var kurentoUtils = require("../OpenViduInternal/KurentoUtils/kurento-utils-js");
var VideoInsertMode_1 = require("../OpenViduInternal/Enums/VideoInsertMode");
/** /**
* Represents each one of the videos send and receive by a user in a session. * Represents each one of the media streams available in OpenVidu Server for certain session.
* Therefore each [[Publisher]] and [[Subscriber]] has an attribute of type Stream * Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access
* to one of them (sending and receiving it, respectively)
*/ */
var Stream = /** @class */ (function () { var Stream = /** @class */ (function () {
/** /**
@ -31,28 +31,19 @@ var Stream = /** @class */ (function () {
*/ */
function Stream(session, options) { function Stream(session, options) {
var _this = this; var _this = this;
/**
* @hidden
*/
this.ee = new EventEmitter(); this.ee = new EventEmitter();
this.isSubscribeToRemote = false; this.isSubscribeToRemote = false;
/** /**
* @hidden * @hidden
*/ */
this.isReadyToPublish = false; this.isLocalStreamReadyToPublish = false;
/** /**
* @hidden * @hidden
*/ */
this.isPublisherPublished = false; this.isLocalStreamPublished = false;
/**
* @hidden
*/
this.isVideoELementCreated = false;
/**
* @hidden
*/
this.accessIsAllowed = false;
/**
* @hidden
*/
this.accessIsDenied = false;
this.session = session; this.session = session;
if (options.hasOwnProperty('id')) { if (options.hasOwnProperty('id')) {
// InboundStreamOptions: stream belongs to a Subscriber // InboundStreamOptions: stream belongs to a Subscriber
@ -84,9 +75,8 @@ var Stream = /** @class */ (function () {
this.hasAudio = this.isSendAudio(); this.hasAudio = this.isSendAudio();
this.hasVideo = this.isSendVideo(); this.hasVideo = this.isSendVideo();
} }
this.on('mediastream-updated', function () { this.ee.on('mediastream-updated', function () {
if (_this.video) _this.streamManager.updateMediaStream(_this.mediaStream);
_this.video.srcObject = _this.mediaStream;
console.debug('Video srcObject [' + _this.mediaStream + '] updated in stream [' + _this.streamId + ']'); console.debug('Video srcObject [' + _this.mediaStream + '] updated in stream [' + _this.streamId + ']');
}); });
} }
@ -102,6 +92,11 @@ var Stream = /** @class */ (function () {
*/ */
Stream.prototype.setMediaStream = function (mediaStream) { Stream.prototype.setMediaStream = function (mediaStream) {
this.mediaStream = mediaStream; this.mediaStream = mediaStream;
};
/**
* @hidden
*/
Stream.prototype.updateMediaStreamInVideos = function () {
this.ee.emitEvent('mediastream-updated'); this.ee.emitEvent('mediastream-updated');
}; };
/** /**
@ -119,14 +114,8 @@ var Stream = /** @class */ (function () {
/** /**
* @hidden * @hidden
*/ */
Stream.prototype.getVideoElement = function () { Stream.prototype.subscribeToMyRemote = function (value) {
return this.video; this.isSubscribeToRemote = value;
};
/**
* @hidden
*/
Stream.prototype.subscribeToMyRemote = function () {
this.isSubscribeToRemote = true;
}; };
/** /**
* @hidden * @hidden
@ -154,7 +143,7 @@ var Stream = /** @class */ (function () {
Stream.prototype.publish = function () { Stream.prototype.publish = function () {
var _this = this; var _this = this;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
if (_this.isReadyToPublish) { if (_this.isLocalStreamReadyToPublish) {
_this.initWebRtcPeerSend() _this.initWebRtcPeerSend()
.then(function () { .then(function () {
resolve(); resolve();
@ -163,7 +152,7 @@ var Stream = /** @class */ (function () {
}); });
} }
else { else {
_this.ee.once('stream-ready-to-publish', function (streamEvent) { _this.ee.once('stream-ready-to-publish', function () {
_this.publish() _this.publish()
.then(function () { .then(function () {
resolve(); resolve();
@ -198,6 +187,7 @@ var Stream = /** @class */ (function () {
this.mediaStream.getVideoTracks().forEach(function (track) { this.mediaStream.getVideoTracks().forEach(function (track) {
track.stop(); track.stop();
}); });
delete this.mediaStream;
} }
console.info((!!this.outboundStreamOpts ? 'Local ' : 'Remote ') + "MediaStream from 'Stream' with id [" + this.streamId + '] is now disposed'); console.info((!!this.outboundStreamOpts ? 'Local ' : 'Remote ') + "MediaStream from 'Stream' with id [" + this.streamId + '] is now disposed');
}; };
@ -207,69 +197,6 @@ var Stream = /** @class */ (function () {
Stream.prototype.displayMyRemote = function () { Stream.prototype.displayMyRemote = function () {
return this.isSubscribeToRemote; return this.isSubscribeToRemote;
}; };
/**
* @hidden
*/
Stream.prototype.on = function (eventName, listener) {
this.ee.on(eventName, listener);
};
/**
* @hidden
*/
Stream.prototype.once = function (eventName, listener) {
this.ee.once(eventName, listener);
};
/**
* @hidden
*/
Stream.prototype.insertVideo = function (targetElement, insertMode) {
var _this = this;
if (!!targetElement) {
this.video = document.createElement('video');
this.video.id = (this.isLocal() ? 'local-' : 'remote-') + 'video-' + this.streamId;
this.video.autoplay = true;
this.video.controls = false;
this.video.srcObject = this.mediaStream;
if (this.isLocal() && !this.displayMyRemote()) {
this.video.muted = true;
if (this.outboundStreamOpts.publisherProperties.mirror) {
this.mirrorVideo(this.video);
}
this.video.oncanplay = function () {
console.info("Local 'Stream' with id [" + _this.streamId + '] video is now playing');
_this.ee.emitEvent('video-is-playing', [{
element: _this.video
}]);
};
}
else {
this.video.title = this.streamId;
}
this.targetElement = targetElement;
this.parentId = targetElement.id;
var insMode = !!insertMode ? insertMode : VideoInsertMode_1.VideoInsertMode.APPEND;
this.insertElementWithMode(this.video, insMode);
this.ee.emitEvent('video-element-created-by-stream', [{
element: this.video
}]);
this.isVideoELementCreated = true;
}
this.isReadyToPublish = true;
this.ee.emitEvent('stream-ready-to-publish');
return this.video;
};
/**
* @hidden
*/
Stream.prototype.removeVideo = function () {
if (this.video) {
if (document.getElementById(this.parentId)) {
document.getElementById(this.parentId).removeChild(this.video);
this.ee.emitEvent('video-removed', [this.video]);
}
delete this.video;
}
};
/** /**
* @hidden * @hidden
*/ */
@ -293,12 +220,6 @@ var Stream = /** @class */ (function () {
return (!!this.outboundStreamOpts && return (!!this.outboundStreamOpts &&
this.outboundStreamOpts.publisherProperties.videoSource === 'screen'); this.outboundStreamOpts.publisherProperties.videoSource === 'screen');
}; };
/**
* @hidden
*/
Stream.prototype.emitEvent = function (type, eventArray) {
this.ee.emitEvent(type, eventArray);
};
/** /**
* @hidden * @hidden
*/ */
@ -379,6 +300,12 @@ var Stream = /** @class */ (function () {
else { else {
_this.processSdpAnswer(response.sdpAnswer) _this.processSdpAnswer(response.sdpAnswer)
.then(function () { .then(function () {
_this.isLocalStreamPublished = true;
if (_this.displayMyRemote()) {
// If remote now we can set the srcObject value of video elements
// 'streamPlaying' event will be triggered
_this.updateMediaStreamInVideos();
}
_this.ee.emitEvent('stream-created-by-publisher'); _this.ee.emitEvent('stream-created-by-publisher');
resolve(); resolve();
})["catch"](function (error) { })["catch"](function (error) {
@ -404,7 +331,6 @@ var Stream = /** @class */ (function () {
_this.webRtcPeer.generateOffer(successCallback); _this.webRtcPeer.generateOffer(successCallback);
}); });
} }
_this.isPublisherPublished = true;
}); });
}; };
Stream.prototype.initWebRtcPeerReceive = function () { Stream.prototype.initWebRtcPeerReceive = function () {
@ -460,8 +386,7 @@ var Stream = /** @class */ (function () {
var streamId = _this.streamId; var streamId = _this.streamId;
var peerConnection = _this.webRtcPeer.peerConnection; var peerConnection = _this.webRtcPeer.peerConnection;
peerConnection.setRemoteDescription(answer, function () { peerConnection.setRemoteDescription(answer, function () {
// Avoids to subscribe to your own stream remotely // Update remote MediaStream object except when local stream
// except when showMyRemote is true
if (!_this.isLocal() || _this.displayMyRemote()) { if (!_this.isLocal() || _this.displayMyRemote()) {
_this.mediaStream = peerConnection.getRemoteStreams()[0]; _this.mediaStream = peerConnection.getRemoteStreams()[0];
console.debug('Peer remote stream', _this.mediaStream); console.debug('Peer remote stream', _this.mediaStream);
@ -471,28 +396,6 @@ var Stream = /** @class */ (function () {
_this.enableSpeakingEvents(); _this.enableSpeakingEvents();
} }
} }
if (!!_this.video) {
// let thumbnailId = this.video.thumb;
_this.video.oncanplay = function () {
if (_this.isLocal() && _this.displayMyRemote()) {
console.info("Your own remote 'Stream' with id [" + _this.streamId + '] video is now playing');
_this.ee.emitEvent('remote-video-is-playing', [{
element: _this.video
}]);
}
else if (!_this.isLocal() && !_this.displayMyRemote()) {
console.info("Remote 'Stream' with id [" + _this.streamId + '] video is now playing');
_this.ee.emitEvent('video-is-playing', [{
element: _this.video
}]);
}
// show(thumbnailId);
// this.hideSpinner(this.streamId);
};
}
_this.session.emitEvent('stream-subscribed', [{
stream: _this
}]);
} }
_this.initWebRtcStats(); _this.initWebRtcStats();
resolve(); resolve();
@ -510,37 +413,13 @@ var Stream = /** @class */ (function () {
this.webRtcStats.stopWebRtcStats(); this.webRtcStats.stopWebRtcStats();
} }
}; };
/**
* @hidden
*/
Stream.prototype.isLocal = function () { Stream.prototype.isLocal = function () {
// inbound options undefined and outbound options defined // inbound options undefined and outbound options defined
return (!this.inboundStreamOpts && !!this.outboundStreamOpts); return (!this.inboundStreamOpts && !!this.outboundStreamOpts);
}; };
Stream.prototype.insertElementWithMode = function (element, insertMode) {
if (!!this.targetElement) {
switch (insertMode) {
case VideoInsertMode_1.VideoInsertMode.AFTER:
this.targetElement.parentNode.insertBefore(element, this.targetElement.nextSibling);
break;
case VideoInsertMode_1.VideoInsertMode.APPEND:
this.targetElement.appendChild(element);
break;
case VideoInsertMode_1.VideoInsertMode.BEFORE:
this.targetElement.parentNode.insertBefore(element, this.targetElement);
break;
case VideoInsertMode_1.VideoInsertMode.PREPEND:
this.targetElement.insertBefore(element, this.targetElement.childNodes[0]);
break;
case VideoInsertMode_1.VideoInsertMode.REPLACE:
this.targetElement.parentNode.replaceChild(element, this.targetElement);
break;
default:
this.insertElementWithMode(element, VideoInsertMode_1.VideoInsertMode.APPEND);
}
}
};
Stream.prototype.mirrorVideo = function (video) {
video.style.transform = 'rotateY(180deg)';
video.style.webkitTransform = 'rotateY(180deg)';
};
return Stream; return Stream;
}()); }());
exports.Stream = Stream; exports.Stream = Stream;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,124 @@
import { Stream } from './Stream';
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
import { StreamManagerVideo } from '../OpenViduInternal/Interfaces/Public/StreamManagerVideo';
import { Event } from '../OpenViduInternal/Events/Event';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import EventEmitter = require('wolfy87-eventemitter');
/**
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any [[Publisher]] and [[Subscriber]] object.
* You can insert as many video players fo the same Stream as you want by calling [[StreamManager.addVideoElement]] or
* [[StreamManager.createVideoElement]].
*
* The use of StreamManager wrapper is particularly useful when you don't need to differentiate between Publisher or Subscriber streams or just
* want to directly manage your own video elements (even more than one video element per Stream). This scenario is pretty common in
* declarative, MVC frontend frameworks such as Angular, React or Vue.js
*/
export declare class StreamManager implements EventDispatcher {
/**
* The Stream represented in the DOM by the Publisher/Subscriber
*/
stream: Stream;
/**
* All the videos displaying the Stream of this Publisher/Subscriber
*/
videos: StreamManagerVideo[];
/**
* Whether the Stream represented in the DOM is local or remote
* - `false` for [[Publisher]]
* - `true` for [[Subscriber]]
*/
remote: boolean;
/**
* The DOM HTMLElement assigned as target element when creating the video for the Publisher/Subscriber. This property is only defined if:
* - [[Publisher]] has been initialized by calling method [[OpenVidu.initPublisher]] with a valid `targetElement` parameter
* - [[Subscriber]] has been initialized by calling method [[Session.subscribe]] with a valid `targetElement` parameter
*/
targetElement: HTMLElement;
/**
* `id` attribute of the DOM video element displaying the Publisher/Subscriber's stream. This property is only defined if:
* - [[Publisher]] has been initialized by calling method [[OpenVidu.initPublisher]] with a valid `targetElement` parameter
* - [[Subscriber]] has been initialized by calling method [[Session.subscribe]] with a valid `targetElement` parameter
*/
id: string;
/**
* @hidden
*/
firstVideoElement: StreamManagerVideo;
/**
* @hidden
*/
lazyLaunchVideoElementCreatedEvent: boolean;
/**
* @hidden
*/
element: HTMLElement;
/**
* @hidden
*/
protected ee: EventEmitter;
/**
* @hidden
*/
protected canPlayListener: EventListenerOrEventListenerObject;
/**
* @hidden
*/
constructor(stream: Stream, targetElement?: HTMLElement | string);
/**
* See [[EventDispatcher.on]]
*/
on(type: string, handler: (event: Event) => void): EventDispatcher;
/**
* See [[EventDispatcher.once]]
*/
once(type: string, handler: (event: Event) => void): StreamManager;
/**
* See [[EventDispatcher.off]]
*/
off(type: string, handler?: (event: Event) => void): StreamManager;
/**
* Makes `video` element parameter display this [[stream]]. This is useful when you are
* [managing the video elements on your own](/docs/how-do-i/manage-videos/#you-take-care-of-the-video-players)
*
* Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be
* disassociated from that previous Publisher/Subscriber and to be associated to this one.
*
* @returns 1 if the video wasn't associated to any other Publisher/Subscriber and has been successfully added to this one.
* 0 if the video was already added to this Publisher/Subscriber. -1 if the video was previously associated to any other
* Publisher/Subscriber and has been successfully disassociated from that one and properly added to this one.
*/
addVideoElement(video: HTMLVideoElement): number;
/**
* Creates a new video element displaying this [[stream]]. This allows you to have multiple video elements displaying the same media stream.
*
* #### Events dispatched
*
* The Publisher/Subscriber object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM. See [[VideoElementEvent]]
*
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher/Subscriber will be inserted
* @param insertMode How the video element will be inserted accordingly to `targetElemet`
*/
createVideoElement(targetElement?: string | HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement;
/**
* @hidden
*/
initializeVideoProperties(video: HTMLVideoElement): void;
/**
* @hidden
*/
removeAllVideos(): void;
/**
* @hidden
*/
disassociateVideo(video: HTMLVideoElement): boolean;
/**
* @hidden
*/
addPlayEventToFirstVideo(): void;
/**
* @hidden
*/
updateMediaStream(mediaStream: MediaStream): void;
private pushNewStreamManagerVideo(streamManagerVideo);
private mirrorVideo(video);
}

View File

@ -0,0 +1,352 @@
"use strict";
/*
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
exports.__esModule = true;
var StreamManagerEvent_1 = require("../OpenViduInternal/Events/StreamManagerEvent");
var VideoElementEvent_1 = require("../OpenViduInternal/Events/VideoElementEvent");
var VideoInsertMode_1 = require("../OpenViduInternal/Enums/VideoInsertMode");
var EventEmitter = require("wolfy87-eventemitter");
/**
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any [[Publisher]] and [[Subscriber]] object.
* You can insert as many video players fo the same Stream as you want by calling [[StreamManager.addVideoElement]] or
* [[StreamManager.createVideoElement]].
*
* The use of StreamManager wrapper is particularly useful when you don't need to differentiate between Publisher or Subscriber streams or just
* want to directly manage your own video elements (even more than one video element per Stream). This scenario is pretty common in
* declarative, MVC frontend frameworks such as Angular, React or Vue.js
*/
var StreamManager = /** @class */ (function () {
/**
* @hidden
*/
function StreamManager(stream, targetElement) {
var _this = this;
/**
* All the videos displaying the Stream of this Publisher/Subscriber
*/
this.videos = [];
/**
* @hidden
*/
this.lazyLaunchVideoElementCreatedEvent = false;
/**
* @hidden
*/
this.ee = new EventEmitter();
this.stream = stream;
this.stream.streamManager = this;
this.remote = !this.stream.isLocal();
if (!!targetElement) {
var targEl = void 0;
if (typeof targetElement === 'string') {
targEl = document.getElementById(targetElement);
}
else if (targetElement instanceof HTMLElement) {
targEl = targetElement;
}
if (!!targEl) {
this.firstVideoElement = {
targetElement: targEl,
video: document.createElement('video'),
id: ''
};
this.targetElement = targEl;
this.element = targEl;
}
}
this.canPlayListener = function () {
if (_this.stream.isLocal()) {
if (!_this.stream.displayMyRemote()) {
console.info("Your local 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(_this.videos[0].video, _this, 'videoPlaying')]);
}
else {
console.info("Your own remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
_this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(_this.videos[0].video, _this, 'remoteVideoPlaying')]);
}
}
else {
console.info("Remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(_this.videos[0].video, _this, 'videoPlaying')]);
}
_this.ee.emitEvent('streamPlaying', [new StreamManagerEvent_1.StreamManagerEvent(_this)]);
};
}
/**
* See [[EventDispatcher.on]]
*/
StreamManager.prototype.on = function (type, handler) {
this.ee.on(type, function (event) {
if (event) {
console.info("Event '" + type + "' triggered", event);
}
else {
console.info("Event '" + type + "' triggered");
}
handler(event);
});
if (type === 'videoElementCreated') {
if (!!this.stream && this.lazyLaunchVideoElementCreatedEvent) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'videoElementCreated')]);
this.lazyLaunchVideoElementCreatedEvent = false;
}
}
if (type === 'streamPlaying' || type === 'videoPlaying') {
if (this.videos[0] && this.videos[0].video &&
this.videos[0].video.currentTime > 0 &&
this.videos[0].video.paused === false &&
this.videos[0].video.ended === false &&
this.videos[0].video.readyState === 4) {
this.ee.emitEvent('streamPlaying', [new StreamManagerEvent_1.StreamManagerEvent(this)]);
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'videoPlaying')]);
}
}
return this;
};
/**
* See [[EventDispatcher.once]]
*/
StreamManager.prototype.once = function (type, handler) {
this.ee.once(type, function (event) {
if (event) {
console.info("Event '" + type + "' triggered once", event);
}
else {
console.info("Event '" + type + "' triggered once");
}
handler(event);
});
if (type === 'videoElementCreated') {
if (!!this.stream && this.lazyLaunchVideoElementCreatedEvent) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'videoElementCreated')]);
}
}
if (type === 'streamPlaying' || type === 'videoPlaying') {
if (this.videos[0] && this.videos[0].video &&
this.videos[0].video.currentTime > 0 &&
this.videos[0].video.paused === false &&
this.videos[0].video.ended === false &&
this.videos[0].video.readyState === 4) {
this.ee.emitEvent('streamPlaying', [new StreamManagerEvent_1.StreamManagerEvent(this)]);
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'videoPlaying')]);
}
}
return this;
};
/**
* See [[EventDispatcher.off]]
*/
StreamManager.prototype.off = function (type, handler) {
if (!handler) {
this.ee.removeAllListeners(type);
}
else {
this.ee.off(type, handler);
}
return this;
};
/**
* Makes `video` element parameter display this [[stream]]. This is useful when you are
* [managing the video elements on your own](/docs/how-do-i/manage-videos/#you-take-care-of-the-video-players)
*
* Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be
* disassociated from that previous Publisher/Subscriber and to be associated to this one.
*
* @returns 1 if the video wasn't associated to any other Publisher/Subscriber and has been successfully added to this one.
* 0 if the video was already added to this Publisher/Subscriber. -1 if the video was previously associated to any other
* Publisher/Subscriber and has been successfully disassociated from that one and properly added to this one.
*/
StreamManager.prototype.addVideoElement = function (video) {
this.initializeVideoProperties(video);
// If the video element is already part of this StreamManager do nothing
for (var _i = 0, _a = this.videos; _i < _a.length; _i++) {
var v = _a[_i];
if (v.video === video) {
return 0;
}
}
var returnNumber = 1;
this.initializeVideoProperties(video);
for (var _b = 0, _c = this.stream.session.streamManagers; _b < _c.length; _b++) {
var streamManager = _c[_b];
if (streamManager.disassociateVideo(video)) {
returnNumber = -1;
break;
}
}
this.stream.session.streamManagers.forEach(function (streamManager) {
streamManager.disassociateVideo(video);
});
this.pushNewStreamManagerVideo({
video: video,
id: video.id
});
console.info('New video element associated to ', this);
return returnNumber;
};
/**
* Creates a new video element displaying this [[stream]]. This allows you to have multiple video elements displaying the same media stream.
*
* #### Events dispatched
*
* The Publisher/Subscriber object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM. See [[VideoElementEvent]]
*
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher/Subscriber will be inserted
* @param insertMode How the video element will be inserted accordingly to `targetElemet`
*/
StreamManager.prototype.createVideoElement = function (targetElement, insertMode) {
var targEl;
if (typeof targetElement === 'string') {
targEl = document.getElementById(targEl);
if (!targEl) {
throw new Error("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
}
}
else if (targetElement instanceof HTMLElement) {
targEl = targetElement;
}
else {
throw new Error("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
}
var video = document.createElement('video');
this.initializeVideoProperties(video);
var insMode = !!insertMode ? insertMode : VideoInsertMode_1.VideoInsertMode.APPEND;
switch (insMode) {
case VideoInsertMode_1.VideoInsertMode.AFTER:
targEl.parentNode.insertBefore(video, targEl.nextSibling);
break;
case VideoInsertMode_1.VideoInsertMode.APPEND:
targEl.appendChild(video);
break;
case VideoInsertMode_1.VideoInsertMode.BEFORE:
targEl.parentNode.insertBefore(video, targEl);
break;
case VideoInsertMode_1.VideoInsertMode.PREPEND:
targEl.insertBefore(video, targEl.childNodes[0]);
break;
case VideoInsertMode_1.VideoInsertMode.REPLACE:
targEl.parentNode.replaceChild(video, targEl);
break;
default:
insMode = VideoInsertMode_1.VideoInsertMode.APPEND;
targEl.appendChild(video);
break;
}
var v = {
targetElement: targEl,
video: video,
insertMode: insMode,
id: video.id
};
this.pushNewStreamManagerVideo(v);
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(v.video, this, 'videoElementCreated')]);
this.lazyLaunchVideoElementCreatedEvent = !!this.firstVideoElement;
return video;
};
/**
* @hidden
*/
StreamManager.prototype.initializeVideoProperties = function (video) {
video.srcObject = this.stream.getMediaStream();
video.autoplay = true;
video.controls = false;
if (!video.id) {
video.id = (this.remote ? 'remote-' : 'local-') + 'video-' + this.stream.streamId;
// DEPRECATED property: assign once the property id if the user provided a valid targetElement
if (!this.id && !!this.targetElement) {
this.id = video.id;
}
}
if (!this.remote && !this.stream.displayMyRemote()) {
video.muted = true;
if (this.stream.outboundStreamOpts.publisherProperties.mirror) {
this.mirrorVideo(video);
}
}
};
/**
* @hidden
*/
StreamManager.prototype.removeAllVideos = function () {
var _this = this;
for (var i = this.stream.session.streamManagers.length - 1; i >= 0; --i) {
if (this.stream.session.streamManagers[i] === this) {
this.stream.session.streamManagers.splice(i, 1);
}
}
this.videos.slice().reverse().forEach(function (streamManagerVideo, index, videos) {
// Remove oncanplay event listener (only OpenVidu browser one, not the user ones)
streamManagerVideo.video.removeEventListener('canplay', _this.canPlayListener);
if (!!streamManagerVideo.targetElement) {
// Only remove videos created by OpenVidu Browser (those generated by passing a valid targetElement in OpenVidu.initPublisher and Session.subscribe
// or those created by StreamManager.createVideoElement). These are also the videos that triggered a videoElementCreated event
streamManagerVideo.video.parentNode.removeChild(streamManagerVideo.video);
_this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent_1.VideoElementEvent(streamManagerVideo.video, _this, 'videoElementDestroyed')]);
_this.videos.splice(videos.length - 1 - index, 1);
}
else {
// Remove srcObject in all videos managed by the user
streamManagerVideo.video.srcObject = null;
}
});
};
/**
* @hidden
*/
StreamManager.prototype.disassociateVideo = function (video) {
var disassociated = false;
for (var i = 0; i < this.videos.length; i++) {
if (this.videos[i].video === video) {
this.videos.splice(i, 1);
disassociated = true;
console.info('Video element disassociated from ', this);
break;
}
}
return disassociated;
};
/**
* @hidden
*/
StreamManager.prototype.addPlayEventToFirstVideo = function () {
if ((!!this.videos[0]) && (!!this.videos[0].video) && (this.videos[0].video.oncanplay === null)) {
this.videos[0].video.addEventListener('canplay', this.canPlayListener);
}
};
/**
* @hidden
*/
StreamManager.prototype.updateMediaStream = function (mediaStream) {
this.videos.forEach(function (streamManagerVideo) {
streamManagerVideo.video.srcObject = mediaStream;
});
};
StreamManager.prototype.pushNewStreamManagerVideo = function (streamManagerVideo) {
this.videos.push(streamManagerVideo);
this.addPlayEventToFirstVideo();
if (this.stream.session.streamManagers.indexOf(this) === -1) {
this.stream.session.streamManagers.push(this);
}
};
StreamManager.prototype.mirrorVideo = function (video) {
video.style.transform = 'rotateY(180deg)';
video.style.webkitTransform = 'rotateY(180deg)';
};
return StreamManager;
}());
exports.StreamManager = StreamManager;
//# sourceMappingURL=StreamManager.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,29 +1,15 @@
import { Stream } from './Stream'; import { Stream } from './Stream';
import { StreamManager } from './StreamManager';
import { SubscriberProperties } from '../OpenViduInternal/Interfaces/Public/SubscriberProperties'; import { SubscriberProperties } from '../OpenViduInternal/Interfaces/Public/SubscriberProperties';
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
import { VideoElementEvent } from '../OpenViduInternal/Events/VideoElementEvent';
/** /**
* Packs remote media streams. Participants automatically receive them when others publish their streams. Initialized with [[Session.subscribe]] method * Packs remote media streams. Participants automatically receive them when others publish their streams. Initialized with [[Session.subscribe]] method
*/ */
export declare class Subscriber implements EventDispatcher { export declare class Subscriber extends StreamManager {
/**
* HTML DOM element in which the Subscriber's video has been inserted
*/
element: HTMLElement;
/**
* DOM id of the Subscriber's video element
*/
id: string;
/**
* The [[Stream]] to which you are subscribing
*/
stream: Stream;
private ee;
private properties; private properties;
/** /**
* @hidden * @hidden
*/ */
constructor(stream: Stream, targetElement: string | HTMLElement, properties: SubscriberProperties); constructor(stream: Stream, targEl: string | HTMLElement, properties: SubscriberProperties);
/** /**
* Subscribe or unsubscribe from the audio stream (if available). Calling this method twice in a row passing same value will have no effect * Subscribe or unsubscribe from the audio stream (if available). Calling this method twice in a row passing same value will have no effect
* @param value `true` to subscribe to the audio stream, `false` to unsubscribe from it * @param value `true` to subscribe to the audio stream, `false` to unsubscribe from it
@ -34,16 +20,4 @@ export declare class Subscriber implements EventDispatcher {
* @param value `true` to subscribe to the video stream, `false` to unsubscribe from it * @param value `true` to subscribe to the video stream, `false` to unsubscribe from it
*/ */
subscribeToVideo(value: boolean): Subscriber; subscribeToVideo(value: boolean): Subscriber;
/**
* See [[EventDispatcher.on]]
*/
on(type: string, handler: (event: VideoElementEvent) => void): EventDispatcher;
/**
* See [[EventDispatcher.once]]
*/
once(type: string, handler: (event: VideoElementEvent) => void): Subscriber;
/**
* See [[EventDispatcher.off]]
*/
off(type: string, handler?: (event: VideoElementEvent) => void): Subscriber;
} }

View File

@ -15,33 +15,32 @@
* limitations under the License. * limitations under the License.
* *
*/ */
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true; exports.__esModule = true;
var VideoElementEvent_1 = require("../OpenViduInternal/Events/VideoElementEvent"); var StreamManager_1 = require("./StreamManager");
var EventEmitter = require("wolfy87-eventemitter");
/** /**
* Packs remote media streams. Participants automatically receive them when others publish their streams. Initialized with [[Session.subscribe]] method * Packs remote media streams. Participants automatically receive them when others publish their streams. Initialized with [[Session.subscribe]] method
*/ */
var Subscriber = /** @class */ (function () { var Subscriber = /** @class */ (function (_super) {
__extends(Subscriber, _super);
/** /**
* @hidden * @hidden
*/ */
function Subscriber(stream, targetElement, properties) { function Subscriber(stream, targEl, properties) {
var _this = this; var _this = _super.call(this, stream, targEl) || this;
this.ee = new EventEmitter(); _this.element = _this.targetElement;
this.stream = stream; _this.stream = stream;
this.properties = properties; _this.properties = properties;
if (typeof targetElement === 'string') { return _this;
var e = document.getElementById(targetElement);
if (!!e) {
this.element = e;
}
}
else if (targetElement instanceof HTMLElement) {
this.element = targetElement;
}
this.stream.once('video-removed', function (element) {
_this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent_1.VideoElementEvent(element, _this, 'videoElementDestroyed')]);
});
} }
/** /**
* Subscribe or unsubscribe from the audio stream (if available). Calling this method twice in a row passing same value will have no effect * Subscribe or unsubscribe from the audio stream (if available). Calling this method twice in a row passing same value will have no effect
@ -65,103 +64,7 @@ var Subscriber = /** @class */ (function () {
console.info("'Subscriber' has " + (value ? 'subscribed to' : 'unsubscribed from') + ' its video stream'); console.info("'Subscriber' has " + (value ? 'subscribed to' : 'unsubscribed from') + ' its video stream');
return this; return this;
}; };
/**
* See [[EventDispatcher.on]]
*/
Subscriber.prototype.on = function (type, handler) {
var _this = this;
this.ee.on(type, function (event) {
if (event) {
console.info("Event '" + type + "' triggered by 'Subscriber'", event);
}
else {
console.info("Event '" + type + "' triggered by 'Subscriber'");
}
handler(event);
});
if (type === 'videoElementCreated') {
if (this.stream.isVideoELementCreated) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'videoElementCreated')]);
}
else {
this.stream.once('video-element-created-by-stream', function (element) {
_this.id = element.id;
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element, _this, 'videoElementCreated')]);
});
}
}
if (type === 'videoPlaying') {
var video = this.stream.getVideoElement();
if (!this.stream.displayMyRemote() && video &&
video.currentTime > 0 &&
video.paused === false &&
video.ended === false &&
video.readyState === 4) {
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'videoPlaying')]);
}
else {
this.stream.once('video-is-playing', function (element) {
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
});
}
}
return this;
};
/**
* See [[EventDispatcher.once]]
*/
Subscriber.prototype.once = function (type, handler) {
var _this = this;
this.ee.once(type, function (event) {
if (event) {
console.info("Event '" + type + "' triggered once by 'Subscriber'", event);
}
else {
console.info("Event '" + type + "' triggered once by 'Subscriber'");
}
handler(event);
});
if (type === 'videoElementCreated') {
if (this.stream.isVideoELementCreated) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'videoElementCreated')]);
}
else {
this.stream.once('video-element-created-by-stream', function (element) {
_this.id = element.id;
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element, _this, 'videoElementCreated')]);
});
}
}
if (type === 'videoPlaying') {
var video = this.stream.getVideoElement();
if (!this.stream.displayMyRemote() && video &&
video.currentTime > 0 &&
video.paused === false &&
video.ended === false &&
video.readyState === 4) {
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.stream.getVideoElement(), this, 'videoPlaying')]);
}
else {
this.stream.once('video-is-playing', function (element) {
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
});
}
}
return this;
};
/**
* See [[EventDispatcher.off]]
*/
Subscriber.prototype.off = function (type, handler) {
if (!handler) {
this.ee.removeAllListeners(type);
}
else {
this.ee.off(type, handler);
}
return this;
};
return Subscriber; return Subscriber;
}()); }(StreamManager_1.StreamManager));
exports.Subscriber = Subscriber; exports.Subscriber = Subscriber;
//# sourceMappingURL=Subscriber.js.map //# sourceMappingURL=Subscriber.js.map

View File

@ -1 +1 @@
{"version":3,"file":"Subscriber.js","sourceRoot":"","sources":["../../src/OpenVidu/Subscriber.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAKH,kFAAiF;AACjF,mDAAsD;AAGtD;;GAEG;AACH;IAqBI;;OAEG;IACH,oBAAY,MAAc,EAAE,aAAmC,EAAE,UAAgC;QAAjG,iBAgBC;QAvBO,OAAE,GAAG,IAAI,YAAY,EAAE,CAAC;QAQ5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;YACnC,IAAM,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YACjD,IAAI,CAAC,CAAC,CAAC,EAAE;gBACL,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;aACpB;SACJ;aAAM,IAAI,aAAa,YAAY,WAAW,EAAE;YAC7C,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC;SAChC;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,UAAC,OAAyB;YACxD,KAAI,CAAC,EAAE,CAAC,SAAS,CAAC,uBAAuB,EAAE,CAAC,IAAI,qCAAiB,CAAC,OAAO,EAAE,KAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC;QAChH,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,qCAAgB,GAAhB,UAAiB,KAAc;QAC3B,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,UAAC,KAAK;YACxD,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,mBAAmB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC,CAAC;QAC1G,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACH,qCAAgB,GAAhB,UAAiB,KAAc;QAC3B,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,UAAC,KAAK;YACxD,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,mBAAmB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC,CAAC;QAC1G,OAAO,IAAI,CAAC;IAChB,CAAC;IAGD;;OAEG;IACH,uBAAE,GAAF,UAAG,IAAY,EAAE,OAA2C;QAA5D,iBAoCC;QAnCG,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,UAAA,KAAK;YAClB,IAAI,KAAK,EAAE;gBACP,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,6BAA6B,EAAE,KAAK,CAAC,CAAC;aACzE;iBAAM;gBACH,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,6BAA6B,CAAC,CAAC;aAClE;YACD,OAAO,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,IAAI,IAAI,KAAK,qBAAqB,EAAE;YAChC,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;gBACnC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,qBAAqB,EAAE,CAAC,IAAI,qCAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;aACjI;iBAAM;gBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE,UAAA,OAAO;oBACvD,KAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;oBACrB,KAAI,CAAC,EAAE,CAAC,SAAS,CAAC,qBAAqB,EAAE,CAAC,IAAI,qCAAiB,CAAC,OAAO,EAAE,KAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;gBAC5G,CAAC,CAAC,CAAC;aACN;SACJ;QACD,IAAI,IAAI,KAAK,cAAc,EAAE;YACzB,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;YAC5C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,KAAK;gBACvC,KAAK,CAAC,WAAW,GAAG,CAAC;gBACrB,KAAK,CAAC,MAAM,KAAK,KAAK;gBACtB,KAAK,CAAC,KAAK,KAAK,KAAK;gBACrB,KAAK,CAAC,UAAU,KAAK,CAAC,EAAE;gBACxB,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,IAAI,qCAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;aACnH;iBAAM;gBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAC,OAAO;oBACzC,KAAI,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,IAAI,qCAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,KAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;gBACtG,CAAC,CAAC,CAAC;aACN;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAGD;;OAEG;IACH,yBAAI,GAAJ,UAAK,IAAY,EAAE,OAA2C;QAA9D,iBAoCC;QAnCG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,UAAA,KAAK;YACpB,IAAI,KAAK,EAAE;gBACP,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,kCAAkC,EAAE,KAAK,CAAC,CAAC;aAC9E;iBAAM;gBACH,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,kCAAkC,CAAC,CAAC;aACvE;YACD,OAAO,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,IAAI,IAAI,KAAK,qBAAqB,EAAE;YAChC,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;gBACnC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,qBAAqB,EAAE,CAAC,IAAI,qCAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;aACjI;iBAAM;gBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE,UAAA,OAAO;oBACvD,KAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;oBACrB,KAAI,CAAC,EAAE,CAAC,SAAS,CAAC,qBAAqB,EAAE,CAAC,IAAI,qCAAiB,CAAC,OAAO,EAAE,KAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;gBAC5G,CAAC,CAAC,CAAC;aACN;SACJ;QACD,IAAI,IAAI,KAAK,cAAc,EAAE;YACzB,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;YAC5C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,KAAK;gBACvC,KAAK,CAAC,WAAW,GAAG,CAAC;gBACrB,KAAK,CAAC,MAAM,KAAK,KAAK;gBACtB,KAAK,CAAC,KAAK,KAAK,KAAK;gBACrB,KAAK,CAAC,UAAU,KAAK,CAAC,EAAE;gBACxB,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,IAAI,qCAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;aACnH;iBAAM;gBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAC,OAAO;oBACzC,KAAI,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,IAAI,qCAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,KAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;gBACtG,CAAC,CAAC,CAAC;aACN;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAGD;;OAEG;IACH,wBAAG,GAAH,UAAI,IAAY,EAAE,OAA4C;QAC1D,IAAI,CAAC,OAAO,EAAE;YACV,IAAI,CAAC,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;SACpC;aAAM;YACH,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEL,iBAAC;AAAD,CAAC,AAnKD,IAmKC;AAnKY,gCAAU"} {"version":3,"file":"Subscriber.js","sourceRoot":"","sources":["../../src/OpenVidu/Subscriber.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAGH,iDAAgD;AAIhD;;GAEG;AACH;IAAgC,8BAAa;IAIzC;;OAEG;IACH,oBAAY,MAAc,EAAE,MAA4B,EAAE,UAAgC;QAA1F,YACI,kBAAM,MAAM,EAAE,MAAM,CAAC,SAIxB;QAHG,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,aAAa,CAAC;QAClC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;;IACjC,CAAC;IAED;;;OAGG;IACH,qCAAgB,GAAhB,UAAiB,KAAc;QAC3B,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,UAAC,KAAK;YACxD,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,mBAAmB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC,CAAC;QAC1G,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACH,qCAAgB,GAAhB,UAAiB,KAAc;QAC3B,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,UAAC,KAAK;YACxD,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,mBAAmB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC,CAAC;QAC1G,OAAO,IAAI,CAAC;IAChB,CAAC;IAEL,iBAAC;AAAD,CAAC,AAtCD,CAAgC,6BAAa,GAsC5C;AAtCY,gCAAU"}

View File

@ -2,19 +2,68 @@
* Defines property [[OpenViduError.name]] * Defines property [[OpenViduError.name]]
*/ */
export declare enum OpenViduErrorName { export declare enum OpenViduErrorName {
/**
* Browser is not supported by OpenVidu.
* Returned uppon unsuccessful [[Session.connect]]
*/
BROWSER_NOT_SUPPORTED = "BROWSER_NOT_SUPPORTED", BROWSER_NOT_SUPPORTED = "BROWSER_NOT_SUPPORTED",
CAMERA_ACCESS_DENIED = "CAMERA_ACCESS_DENIED", /**
MICROPHONE_ACCESS_DENIED = "MICROPHONE_ACCESS_DENIED", * The user hasn't granted permissions to the required input device when the browser asked for them.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
DEVICE_ACCESS_DENIED = "DEVICE_ACCESS_DENIED",
/**
* The user hasn't granted permissions to capture some desktop screen when the browser asked for them.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
SCREEN_CAPTURE_DENIED = "SCREEN_CAPTURE_DENIED", SCREEN_CAPTURE_DENIED = "SCREEN_CAPTURE_DENIED",
/**
* Browser does not support screen sharing.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
SCREEN_SHARING_NOT_SUPPORTED = "SCREEN_SHARING_NOT_SUPPORTED", SCREEN_SHARING_NOT_SUPPORTED = "SCREEN_SHARING_NOT_SUPPORTED",
/**
* Only for Chrome, there's no screen sharing extension installed
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
SCREEN_EXTENSION_NOT_INSTALLED = "SCREEN_EXTENSION_NOT_INSTALLED", SCREEN_EXTENSION_NOT_INSTALLED = "SCREEN_EXTENSION_NOT_INSTALLED",
/**
* Only for Chrome, the screen sharing extension is installed but is disabled
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
SCREEN_EXTENSION_DISABLED = "SCREEN_EXTENSION_DISABLED", SCREEN_EXTENSION_DISABLED = "SCREEN_EXTENSION_DISABLED",
/**
* No video input device found with the provided deviceId (property [[PublisherProperties.videoSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
INPUT_VIDEO_DEVICE_NOT_FOUND = "INPUT_VIDEO_DEVICE_NOT_FOUND", INPUT_VIDEO_DEVICE_NOT_FOUND = "INPUT_VIDEO_DEVICE_NOT_FOUND",
/**
* No audio input device found with the provided deviceId (property [[PublisherProperties.audioSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
INPUT_AUDIO_DEVICE_NOT_FOUND = "INPUT_AUDIO_DEVICE_NOT_FOUND", INPUT_AUDIO_DEVICE_NOT_FOUND = "INPUT_AUDIO_DEVICE_NOT_FOUND",
/**
* Method [[OpenVidu.initPublisher]] has been called with properties `videoSource` and `audioSource` of
* [[PublisherProperties]] parameter both set to *false* or *null*
*/
NO_INPUT_SOURCE_SET = "NO_INPUT_SOURCE_SET", NO_INPUT_SOURCE_SET = "NO_INPUT_SOURCE_SET",
/**
* Some media property of [[PublisherProperties]] such as `frameRate` or `resolution` is not supported
* by the input devices (whenever it is possible they are automatically adjusted to the most similar value).
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
PUBLISHER_PROPERTIES_ERROR = "PUBLISHER_PROPERTIES_ERROR", PUBLISHER_PROPERTIES_ERROR = "PUBLISHER_PROPERTIES_ERROR",
/**
* _Not in use yet_
*/
OPENVIDU_PERMISSION_DENIED = "OPENVIDU_PERMISSION_DENIED", OPENVIDU_PERMISSION_DENIED = "OPENVIDU_PERMISSION_DENIED",
/**
* _Not in use yet_
*/
OPENVIDU_NOT_CONNECTED = "OPENVIDU_NOT_CONNECTED", OPENVIDU_NOT_CONNECTED = "OPENVIDU_NOT_CONNECTED",
/**
* _Not in use yet_
*/
GENERIC_ERROR = "GENERIC_ERROR", GENERIC_ERROR = "GENERIC_ERROR",
} }
/** /**

View File

@ -21,19 +21,68 @@ exports.__esModule = true;
*/ */
var OpenViduErrorName; var OpenViduErrorName;
(function (OpenViduErrorName) { (function (OpenViduErrorName) {
/**
* Browser is not supported by OpenVidu.
* Returned uppon unsuccessful [[Session.connect]]
*/
OpenViduErrorName["BROWSER_NOT_SUPPORTED"] = "BROWSER_NOT_SUPPORTED"; OpenViduErrorName["BROWSER_NOT_SUPPORTED"] = "BROWSER_NOT_SUPPORTED";
OpenViduErrorName["CAMERA_ACCESS_DENIED"] = "CAMERA_ACCESS_DENIED"; /**
OpenViduErrorName["MICROPHONE_ACCESS_DENIED"] = "MICROPHONE_ACCESS_DENIED"; * The user hasn't granted permissions to the required input device when the browser asked for them.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
OpenViduErrorName["DEVICE_ACCESS_DENIED"] = "DEVICE_ACCESS_DENIED";
/**
* The user hasn't granted permissions to capture some desktop screen when the browser asked for them.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
OpenViduErrorName["SCREEN_CAPTURE_DENIED"] = "SCREEN_CAPTURE_DENIED"; OpenViduErrorName["SCREEN_CAPTURE_DENIED"] = "SCREEN_CAPTURE_DENIED";
/**
* Browser does not support screen sharing.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["SCREEN_SHARING_NOT_SUPPORTED"] = "SCREEN_SHARING_NOT_SUPPORTED"; OpenViduErrorName["SCREEN_SHARING_NOT_SUPPORTED"] = "SCREEN_SHARING_NOT_SUPPORTED";
/**
* Only for Chrome, there's no screen sharing extension installed
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["SCREEN_EXTENSION_NOT_INSTALLED"] = "SCREEN_EXTENSION_NOT_INSTALLED"; OpenViduErrorName["SCREEN_EXTENSION_NOT_INSTALLED"] = "SCREEN_EXTENSION_NOT_INSTALLED";
/**
* Only for Chrome, the screen sharing extension is installed but is disabled
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["SCREEN_EXTENSION_DISABLED"] = "SCREEN_EXTENSION_DISABLED"; OpenViduErrorName["SCREEN_EXTENSION_DISABLED"] = "SCREEN_EXTENSION_DISABLED";
/**
* No video input device found with the provided deviceId (property [[PublisherProperties.videoSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["INPUT_VIDEO_DEVICE_NOT_FOUND"] = "INPUT_VIDEO_DEVICE_NOT_FOUND"; OpenViduErrorName["INPUT_VIDEO_DEVICE_NOT_FOUND"] = "INPUT_VIDEO_DEVICE_NOT_FOUND";
/**
* No audio input device found with the provided deviceId (property [[PublisherProperties.audioSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["INPUT_AUDIO_DEVICE_NOT_FOUND"] = "INPUT_AUDIO_DEVICE_NOT_FOUND"; OpenViduErrorName["INPUT_AUDIO_DEVICE_NOT_FOUND"] = "INPUT_AUDIO_DEVICE_NOT_FOUND";
/**
* Method [[OpenVidu.initPublisher]] has been called with properties `videoSource` and `audioSource` of
* [[PublisherProperties]] parameter both set to *false* or *null*
*/
OpenViduErrorName["NO_INPUT_SOURCE_SET"] = "NO_INPUT_SOURCE_SET"; OpenViduErrorName["NO_INPUT_SOURCE_SET"] = "NO_INPUT_SOURCE_SET";
/**
* Some media property of [[PublisherProperties]] such as `frameRate` or `resolution` is not supported
* by the input devices (whenever it is possible they are automatically adjusted to the most similar value).
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["PUBLISHER_PROPERTIES_ERROR"] = "PUBLISHER_PROPERTIES_ERROR"; OpenViduErrorName["PUBLISHER_PROPERTIES_ERROR"] = "PUBLISHER_PROPERTIES_ERROR";
/**
* _Not in use yet_
*/
OpenViduErrorName["OPENVIDU_PERMISSION_DENIED"] = "OPENVIDU_PERMISSION_DENIED"; OpenViduErrorName["OPENVIDU_PERMISSION_DENIED"] = "OPENVIDU_PERMISSION_DENIED";
/**
* _Not in use yet_
*/
OpenViduErrorName["OPENVIDU_NOT_CONNECTED"] = "OPENVIDU_NOT_CONNECTED"; OpenViduErrorName["OPENVIDU_NOT_CONNECTED"] = "OPENVIDU_NOT_CONNECTED";
/**
* _Not in use yet_
*/
OpenViduErrorName["GENERIC_ERROR"] = "GENERIC_ERROR"; OpenViduErrorName["GENERIC_ERROR"] = "GENERIC_ERROR";
})(OpenViduErrorName = exports.OpenViduErrorName || (exports.OpenViduErrorName = {})); })(OpenViduErrorName = exports.OpenViduErrorName || (exports.OpenViduErrorName = {}));
/** /**

View File

@ -1 +1 @@
{"version":3,"file":"OpenViduError.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Enums/OpenViduError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH;;GAEG;AACH,IAAY,iBAeX;AAfD,WAAY,iBAAiB;IACzB,oEAA+C,CAAA;IAC/C,kEAA6C,CAAA;IAC7C,0EAAqD,CAAA;IACrD,oEAA+C,CAAA;IAC/C,kFAA6D,CAAA;IAC7D,sFAAiE,CAAA;IACjE,4EAAuD,CAAA;IACvD,kFAA6D,CAAA;IAC7D,kFAA6D,CAAA;IAC7D,gEAA2C,CAAA;IAC3C,8EAAyD,CAAA;IACzD,8EAAyD,CAAA;IACzD,sEAAiD,CAAA;IACjD,oDAA+B,CAAA;AACnC,CAAC,EAfW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAe5B;AAED;;GAEG;AACH;IAKI;;OAEG;IACH,uBAAY,IAAuB,EAAE,OAAe;QAChD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAEL,oBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,sCAAa"} {"version":3,"file":"OpenViduError.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Enums/OpenViduError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH;;GAEG;AACH,IAAY,iBA6EX;AA7ED,WAAY,iBAAiB;IAEzB;;;OAGG;IACH,oEAA+C,CAAA;IAE/C;;;OAGG;IACH,kEAA6C,CAAA;IAE7C;;;OAGG;IACH,oEAA+C,CAAA;IAE/C;;;OAGG;IACH,kFAA6D,CAAA;IAE7D;;;OAGG;IACH,sFAAiE,CAAA;IAEjE;;;OAGG;IACH,4EAAuD,CAAA;IAEvD;;;OAGG;IACH,kFAA6D,CAAA;IAE7D;;;OAGG;IACH,kFAA6D,CAAA;IAE7D;;;OAGG;IACH,gEAA2C,CAAA;IAE3C;;;;OAIG;IACH,8EAAyD,CAAA;IAEzD;;OAEG;IACH,8EAAyD,CAAA;IAEzD;;OAEG;IACH,sEAAiD,CAAA;IAEjD;;OAEG;IACH,oDAA+B,CAAA;AACnC,CAAC,EA7EW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QA6E5B;AAED;;GAEG;AACH;IAKI;;OAEG;IACH,uBAAY,IAAuB,EAAE,OAAe;QAChD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAEL,oBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,sCAAa"}

View File

@ -1,6 +1,5 @@
import { Publisher } from '../../OpenVidu/Publisher'; import { StreamManager } from '../../OpenVidu/StreamManager';
import { Session } from '../../OpenVidu/Session'; import { Session } from '../../OpenVidu/Session';
import { Subscriber } from '../../OpenVidu/Subscriber';
export declare abstract class Event { export declare abstract class Event {
/** /**
* Whether the event has a default behaviour that may be prevented by calling [[Event.preventDefault]] * Whether the event has a default behaviour that may be prevented by calling [[Event.preventDefault]]
@ -9,7 +8,7 @@ export declare abstract class Event {
/** /**
* The object that dispatched the event * The object that dispatched the event
*/ */
target: Session | Subscriber | Publisher; target: Session | StreamManager;
/** /**
* The type of event. This is the same string you pass as first parameter when calling method `on()` of any object implementing [[EventDispatcher]] interface * The type of event. This is the same string you pass as first parameter when calling method `on()` of any object implementing [[EventDispatcher]] interface
*/ */
@ -18,17 +17,24 @@ export declare abstract class Event {
/** /**
* @hidden * @hidden
*/ */
constructor(cancelable: any, target: any, type: any); constructor(cancelable: boolean, target: Session | StreamManager, type: string);
/** /**
* Whether the default beahivour of the event has been prevented or not. Call [[Event.preventDefault]] to prevent it * Whether the default beahivour of the event has been prevented or not. Call [[Event.preventDefault]] to prevent it
*/ */
isDefaultPrevented(): boolean; isDefaultPrevented(): boolean;
/** /**
* Prevents the default behaviour of the event. The following events have a default behaviour: * Prevents the default behaviour of the event. The following events have a default behaviour:
* - `sessionDisconnected`: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) *
* and also deletes the HTML video element associated to it. * - `sessionDisconnected`: dispatched by [[Session]] object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* - `streamDestroyed`: if dispatched by a [[Publisher]] (_you_ have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by [[Session]], * and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
* (_other user_ has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it. * by calling [[Subscriber.createVideoElement]]). For every video removed, each Subscriber object will also dispatch a `videoElementDestroyed` event.
*
* - `streamDestroyed`:
* - If dispatched by a [[Publisher]] (*you* have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement`
* in method [[OpenVidu.initPublisher]] or by calling [[Publisher.createVideoElement]]). For every video removed, the Publisher object will also dispatch a `videoElementDestroyed` event.
* - If dispatched by [[Session]] (*other user* has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
* by calling [[Subscriber.createVideoElement]]). For every video removed, the Subscriber object will also dispatch a `videoElementDestroyed` event.
*/ */
preventDefault(): void; preventDefault(): void;
protected abstract callDefaultBehaviour(): any; protected abstract callDefaultBehaviour(): any;

View File

@ -34,10 +34,17 @@ var Event = /** @class */ (function () {
}; };
/** /**
* Prevents the default behaviour of the event. The following events have a default behaviour: * Prevents the default behaviour of the event. The following events have a default behaviour:
* - `sessionDisconnected`: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) *
* and also deletes the HTML video element associated to it. * - `sessionDisconnected`: dispatched by [[Session]] object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* - `streamDestroyed`: if dispatched by a [[Publisher]] (_you_ have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by [[Session]], * and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
* (_other user_ has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it. * by calling [[Subscriber.createVideoElement]]). For every video removed, each Subscriber object will also dispatch a `videoElementDestroyed` event.
*
* - `streamDestroyed`:
* - If dispatched by a [[Publisher]] (*you* have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement`
* in method [[OpenVidu.initPublisher]] or by calling [[Publisher.createVideoElement]]). For every video removed, the Publisher object will also dispatch a `videoElementDestroyed` event.
* - If dispatched by [[Session]] (*other user* has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
* by calling [[Subscriber.createVideoElement]]). For every video removed, the Subscriber object will also dispatch a `videoElementDestroyed` event.
*/ */
Event.prototype.preventDefault = function () { Event.prototype.preventDefault = function () {
// tslint:disable-next-line:no-empty // tslint:disable-next-line:no-empty

View File

@ -1 +1 @@
{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/Event.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAMH;IAmBI;;OAEG;IACH,eAAY,UAAU,EAAE,MAAM,EAAE,IAAI;QAL5B,qBAAgB,GAAG,KAAK,CAAC;QAM7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,kCAAkB,GAAlB;QACI,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED;;;;;;OAMG;IACH,8BAAc,GAAd;QACI,oCAAoC;QACpC,IAAI,CAAC,oBAAoB,GAAG,cAAQ,CAAC,CAAC;QACtC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IACjC,CAAC;IAIL,YAAC;AAAD,CAAC,AAlDD,IAkDC;AAlDqB,sBAAK"} {"version":3,"file":"Event.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/Event.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAKH;IAmBI;;OAEG;IACH,eAAY,UAAmB,EAAE,MAA+B,EAAE,IAAY;QALtE,qBAAgB,GAAG,KAAK,CAAC;QAM7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,kCAAkB,GAAlB;QACI,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,8BAAc,GAAd;QACI,oCAAoC;QACpC,IAAI,CAAC,oBAAoB,GAAG,cAAQ,CAAC,CAAC;QACtC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IACjC,CAAC;IAIL,YAAC;AAAD,CAAC,AAzDD,IAyDC;AAzDqB,sBAAK"}

View File

@ -0,0 +1,22 @@
import { Event } from './Event';
import { Stream } from '../../OpenVidu/Stream';
/**
* Defines the following events:
* - `mediaStreamSet`: dispatched by [[Stream]]
*
* This is useful if you decide to manage the DOM video elements on your own instead of letting OpenVidu take care of them (passing _null_ or _undefined_ as `targetElement` on [[OpenVidu.initPublisher]] or [[Session.subscribe]])
*/
export declare class MediaStreamSetEvent extends Event {
/**
* The [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) object recently initialized in the [[Stream]] object. You can directly set `HTMLMediaElement.srcObject = MediaStreamEvent.mediaStream;`
*/
mediaStream: MediaStream;
/**
* @hidden
*/
constructor(mediaStream: MediaStream, target: Stream);
/**
* @hidden
*/
callDefaultBehaviour(): void;
}

View File

@ -0,0 +1,54 @@
"use strict";
/*
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var Event_1 = require("./Event");
/**
* Defines the following events:
* - `mediaStreamSet`: dispatched by [[Stream]]
*
* This is useful if you decide to manage the DOM video elements on your own instead of letting OpenVidu take care of them (passing _null_ or _undefined_ as `targetElement` on [[OpenVidu.initPublisher]] or [[Session.subscribe]])
*/
var MediaStreamSetEvent = /** @class */ (function (_super) {
__extends(MediaStreamSetEvent, _super);
/**
* @hidden
*/
function MediaStreamSetEvent(mediaStream, target) {
var _this = _super.call(this, false, target, 'mediaStreamSet') || this;
_this.mediaStream = mediaStream;
return _this;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
MediaStreamSetEvent.prototype.callDefaultBehaviour = function () { };
return MediaStreamSetEvent;
}(Event_1.Event));
exports.MediaStreamSetEvent = MediaStreamSetEvent;
//# sourceMappingURL=MediaStreamSetEvent.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MediaStreamSetEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/MediaStreamSetEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAIhC;;;;;GAKG;AACH;IAAyC,uCAAK;IAO1C;;OAEG;IACH,6BAAY,WAAwB,EAAE,MAAc;QAApD,YACI,kBAAM,KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,SAEzC;QADG,KAAI,CAAC,WAAW,GAAG,WAAW,CAAC;;IACnC,CAAC;IAED;;OAEG;IACH,oCAAoC;IACpC,kDAAoB,GAApB,cAAyB,CAAC;IAE9B,0BAAC;AAAD,CAAC,AArBD,CAAyC,aAAK,GAqB7C;AArBY,kDAAmB"}

View File

@ -51,7 +51,9 @@ var SessionDisconnectedEvent = /** @class */ (function (_super) {
if (!!session.remoteConnections[connectionId].stream) { if (!!session.remoteConnections[connectionId].stream) {
session.remoteConnections[connectionId].stream.disposeWebRtcPeer(); session.remoteConnections[connectionId].stream.disposeWebRtcPeer();
session.remoteConnections[connectionId].stream.disposeMediaStream(); session.remoteConnections[connectionId].stream.disposeMediaStream();
session.remoteConnections[connectionId].stream.removeVideo(); if (session.remoteConnections[connectionId].stream.streamManager) {
session.remoteConnections[connectionId].stream.streamManager.removeAllVideos();
}
delete session.remoteStreamsCreated[session.remoteConnections[connectionId].stream.streamId]; delete session.remoteStreamsCreated[session.remoteConnections[connectionId].stream.streamId];
session.remoteConnections[connectionId].dispose(); session.remoteConnections[connectionId].dispose();
} }

View File

@ -1 +1 @@
{"version":3,"file":"SessionDisconnectedEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/SessionDisconnectedEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAIhC;;GAEG;AACH;IAA8C,4CAAK;IAQ/C;;OAEG;IACH,kCAAY,MAAe,EAAE,MAAc;QAA3C,YACI,kBAAM,IAAI,EAAE,MAAM,EAAE,qBAAqB,CAAC,SAE7C;QADG,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACzB,CAAC;IAED;;OAEG;IACH,uDAAoB,GAApB;QAEI,OAAO,CAAC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC,CAAC;QAEjG,IAAM,OAAO,GAAY,IAAI,CAAC,MAAM,CAAC;QAErC,4CAA4C;QAC5C,KAAK,IAAM,YAAY,IAAI,OAAO,CAAC,iBAAiB,EAAE;YAClD,IAAI,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE;gBAClD,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBACnE,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBACpE,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC7D,OAAO,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAC7F,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;aACrD;YACD,OAAO,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;SAClD;IACL,CAAC;IAEL,+BAAC;AAAD,CAAC,AAtCD,CAA8C,aAAK,GAsClD;AAtCY,4DAAwB"} {"version":3,"file":"SessionDisconnectedEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/SessionDisconnectedEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAIhC;;GAEG;AACH;IAA8C,4CAAK;IAQ/C;;OAEG;IACH,kCAAY,MAAe,EAAE,MAAc;QAA3C,YACI,kBAAM,IAAI,EAAE,MAAM,EAAE,qBAAqB,CAAC,SAE7C;QADG,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACzB,CAAC;IAED;;OAEG;IACH,uDAAoB,GAApB;QAEI,OAAO,CAAC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC,CAAC;QAEjG,IAAM,OAAO,GAAY,IAAI,CAAC,MAAM,CAAC;QAErC,4CAA4C;QAC5C,KAAK,IAAM,YAAY,IAAI,OAAO,CAAC,iBAAiB,EAAE;YAClD,IAAI,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE;gBAClD,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBACnE,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBACpE,IAAI,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE;oBAC9D,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC;iBAClF;gBACD,OAAO,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAC7F,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;aACrD;YACD,OAAO,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;SAClD;IACL,CAAC;IAEL,+BAAC;AAAD,CAAC,AAxCD,CAA8C,aAAK,GAwClD;AAxCY,4DAAwB"}

View File

@ -51,19 +51,21 @@ var StreamEvent = /** @class */ (function (_super) {
StreamEvent.prototype.callDefaultBehaviour = function () { StreamEvent.prototype.callDefaultBehaviour = function () {
if (this.type === 'streamDestroyed') { if (this.type === 'streamDestroyed') {
if (this.target instanceof Session_1.Session) { if (this.target instanceof Session_1.Session) {
console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Session'");
// Remote Stream // Remote Stream
console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Session'");
this.stream.disposeWebRtcPeer(); this.stream.disposeWebRtcPeer();
this.stream.disposeMediaStream();
this.stream.removeVideo();
} }
else if (this.target instanceof Publisher_1.Publisher) { else if (this.target instanceof Publisher_1.Publisher) {
console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Publisher'");
// Local Stream // Local Stream
this.stream.disposeMediaStream(); console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Publisher'");
this.stream.removeVideo(); this.stream.isLocalStreamReadyToPublish = false;
this.stream.isReadyToPublish = false;
} }
// Dispose the MediaStream local object
this.stream.disposeMediaStream();
// Remove from DOM all video elements associated to this Stream, if there's a StreamManager defined
// (method Session.subscribe must have been called)
if (this.stream.streamManager)
this.stream.streamManager.removeAllVideos();
// Delete stream from Session.remoteStreamsCreated map // Delete stream from Session.remoteStreamsCreated map
delete this.stream.session.remoteStreamsCreated[this.stream.streamId]; delete this.stream.session.remoteStreamsCreated[this.stream.streamId];
// Delete StreamOptionsServer from remote Connection // Delete StreamOptionsServer from remote Connection

View File

@ -1 +1 @@
{"version":3,"file":"StreamEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/StreamEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAChC,sDAAqD;AACrD,kDAAiD;AAIjD;;;;GAIG;AACH;IAAiC,+BAAK;IAiBlC;;OAEG;IACH,qBAAY,UAAmB,EAAE,MAA2B,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QAA1G,YACI,kBAAM,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,SAGlC;QAFG,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACzB,CAAC;IAED;;OAEG;IACH,0CAAoB,GAApB;QACI,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,EAAE;YAEjC,IAAI,IAAI,CAAC,MAAM,YAAY,iBAAO,EAAE;gBAEhC,OAAO,CAAC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC,CAAC;gBAEjG,gBAAgB;gBAChB,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBAChC,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBACjC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;aAE7B;iBAAM,IAAI,IAAI,CAAC,MAAM,YAAY,qBAAS,EAAE;gBAEzC,OAAO,CAAC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC,CAAC;gBAEnG,eAAe;gBACf,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBACjC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC1B,IAAI,CAAC,MAAM,CAAC,gBAAgB,GAAG,KAAK,CAAC;aACxC;YAED,sDAAsD;YACtD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEtE,oDAAoD;YACpD,IAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YACpG,IAAI,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,CAAC,OAAO,EAAE;gBAClD,IAAM,mBAAmB,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC7D,KAAK,IAAI,CAAC,GAAG,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;oBACtD,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;wBACpD,mBAAmB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;qBACpC;iBACJ;aACJ;SAEJ;IACL,CAAC;IAEL,kBAAC;AAAD,CAAC,AApED,CAAiC,aAAK,GAoErC;AApEY,kCAAW"} {"version":3,"file":"StreamEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/StreamEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAChC,sDAAqD;AACrD,kDAAiD;AAIjD;;;;GAIG;AACH;IAAiC,+BAAK;IAiBlC;;OAEG;IACH,qBAAY,UAAmB,EAAE,MAA2B,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QAA1G,YACI,kBAAM,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,SAGlC;QAFG,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACzB,CAAC;IAED;;OAEG;IACH,0CAAoB,GAApB;QACI,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,EAAE;YAEjC,IAAI,IAAI,CAAC,MAAM,YAAY,iBAAO,EAAE;gBAChC,gBAAgB;gBAChB,OAAO,CAAC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC,CAAC;gBACjG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;aACnC;iBAAM,IAAI,IAAI,CAAC,MAAM,YAAY,qBAAS,EAAE;gBACzC,eAAe;gBACf,OAAO,CAAC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC,CAAC;gBACnG,IAAI,CAAC,MAAM,CAAC,2BAA2B,GAAG,KAAK,CAAC;aACnD;YAED,uCAAuC;YACvC,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAEjC,mGAAmG;YACnG,mDAAmD;YACnD,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa;gBAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC;YAE3E,sDAAsD;YACtD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEtE,oDAAoD;YACpD,IAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YACpG,IAAI,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,CAAC,OAAO,EAAE;gBAClD,IAAM,mBAAmB,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC7D,KAAK,IAAI,CAAC,GAAG,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;oBACtD,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;wBACpD,mBAAmB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;qBACpC;iBACJ;aACJ;SAEJ;IACL,CAAC;IAEL,kBAAC;AAAD,CAAC,AAlED,CAAiC,aAAK,GAkErC;AAlEY,kCAAW"}

View File

@ -0,0 +1,16 @@
import { Event } from './Event';
import { StreamManager } from '../../OpenVidu/StreamManager';
/**
* Defines the following events:
* - `streamPlaying`: dispatched by [[StreamManager]] ([[Publisher]] and [[Subscriber]])
*/
export declare class StreamManagerEvent extends Event {
/**
* @hidden
*/
constructor(target: StreamManager);
/**
* @hidden
*/
callDefaultBehaviour(): void;
}

View File

@ -0,0 +1,50 @@
"use strict";
/*
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var Event_1 = require("./Event");
/**
* Defines the following events:
* - `streamPlaying`: dispatched by [[StreamManager]] ([[Publisher]] and [[Subscriber]])
*/
var StreamManagerEvent = /** @class */ (function (_super) {
__extends(StreamManagerEvent, _super);
/**
* @hidden
*/
function StreamManagerEvent(target) {
return _super.call(this, false, target, 'streamPlaying') || this;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
StreamManagerEvent.prototype.callDefaultBehaviour = function () { };
return StreamManagerEvent;
}(Event_1.Event));
exports.StreamManagerEvent = StreamManagerEvent;
//# sourceMappingURL=StreamManagerEvent.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"StreamManagerEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/StreamManagerEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAGhC;;;GAGG;AACH;IAAwC,sCAAK;IAEzC;;OAEG;IACH,4BAAY,MAAqB;eAC7B,kBAAM,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,oCAAoC;IACpC,iDAAoB,GAApB,cAAyB,CAAC;IAE9B,yBAAC;AAAD,CAAC,AAfD,CAAwC,aAAK,GAe5C;AAfY,gDAAkB"}

View File

@ -1,22 +1,20 @@
import { Event } from './Event'; import { Event } from './Event';
import { Publisher } from '../../OpenVidu/Publisher'; import { StreamManager } from '../../OpenVidu/StreamManager';
import { Subscriber } from '../../OpenVidu/Subscriber';
/** /**
* Defines the following events: * Defines the following events:
* - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] * - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] whenever a new HTML video element has been inserted into DOM by OpenVidu Browser library. See
* - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] * [Manage video players](/docs/how-do-i/manage-videos) section.
* - `videoPlaying`: dispatched by [[Publisher]] and [[Subscriber]] * - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] whenever an HTML video element has been removed from DOM by OpenVidu Browser library.
* - `remoteVideoPlaying`: dispatched by [[Publisher]] if `Publisher.subscribeToRemote()` was called before `Session.publish(Publisher)`
*/ */
export declare class VideoElementEvent extends Event { export declare class VideoElementEvent extends Event {
/** /**
* Video element that was created, destroyed or started playing * Video element that was created or destroyed
*/ */
element: HTMLVideoElement; element: HTMLVideoElement;
/** /**
* @hidden * @hidden
*/ */
constructor(element: HTMLVideoElement, target: Publisher | Subscriber, type: string); constructor(element: HTMLVideoElement, target: StreamManager, type: string);
/** /**
* @hidden * @hidden
*/ */

View File

@ -29,10 +29,9 @@ exports.__esModule = true;
var Event_1 = require("./Event"); var Event_1 = require("./Event");
/** /**
* Defines the following events: * Defines the following events:
* - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] * - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] whenever a new HTML video element has been inserted into DOM by OpenVidu Browser library. See
* - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] * [Manage video players](/docs/how-do-i/manage-videos) section.
* - `videoPlaying`: dispatched by [[Publisher]] and [[Subscriber]] * - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] whenever an HTML video element has been removed from DOM by OpenVidu Browser library.
* - `remoteVideoPlaying`: dispatched by [[Publisher]] if `Publisher.subscribeToRemote()` was called before `Session.publish(Publisher)`
*/ */
var VideoElementEvent = /** @class */ (function (_super) { var VideoElementEvent = /** @class */ (function (_super) {
__extends(VideoElementEvent, _super); __extends(VideoElementEvent, _super);

View File

@ -1 +1 @@
{"version":3,"file":"VideoElementEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/VideoElementEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAKhC;;;;;;GAMG;AACH;IAAuC,qCAAK;IAOxC;;OAEG;IACH,2BAAY,OAAyB,EAAE,MAA8B,EAAE,IAAY;QAAnF,YACI,kBAAM,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,SAE7B;QADG,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IAC3B,CAAC;IAED;;OAEG;IACH,oCAAoC;IACpC,gDAAoB,GAApB,cAAyB,CAAC;IAE9B,wBAAC;AAAD,CAAC,AArBD,CAAuC,aAAK,GAqB3C;AArBY,8CAAiB"} {"version":3,"file":"VideoElementEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/VideoElementEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAIhC;;;;;GAKG;AACH;IAAuC,qCAAK;IAOxC;;OAEG;IACH,2BAAY,OAAyB,EAAE,MAAqB,EAAE,IAAY;QAA1E,YACI,kBAAM,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,SAE7B;QADG,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IAC3B,CAAC;IAED;;OAEG;IACH,oCAAoC;IACpC,gDAAoB,GAApB,cAAyB,CAAC;IAE9B,wBAAC;AAAD,CAAC,AArBD,CAAuC,aAAK,GAqB3C;AArBY,8CAAiB"}

View File

@ -2,14 +2,20 @@ import { Event as Event } from '../../Events/Event';
export interface EventDispatcher { export interface EventDispatcher {
/** /**
* Adds function `handler` to handle event `type` * Adds function `handler` to handle event `type`
*
* @returns The EventDispatcher object
*/ */
on(type: string, handler: (event: Event) => void): EventDispatcher; on(type: string, handler: (event: Event) => void): EventDispatcher;
/** /**
* Adds function `handler` to handle event `type` just once. The handler will be automatically removed after first execution * Adds function `handler` to handle event `type` just once. The handler will be automatically removed after first execution
*
* @returns The object that dispatched the event
*/ */
once(type: string, handler: (event: Event) => void): any; once(type: string, handler: (event: Event) => void): Object;
/** /**
* Removes a `handler` from event `type`. If no handler is provided, all handlers will be removed from the event * Removes a `handler` from event `type`. If no handler is provided, all handlers will be removed from the event
*
* @returns The object that dispatched the event
*/ */
off(type: string, handler?: (event: Event) => void): any; off(type: string, handler?: (event: Event) => void): Object;
} }

View File

@ -0,0 +1,23 @@
import { EventDispatcher } from './EventDispatcher';
import { Stream } from '../../../OpenVidu/Stream';
/**
* Interface representing a media element of the DOM. Can be local ([[Publisher]]) or remote ([[Subscriber]])
*/
export interface MediaElement extends EventDispatcher {
/**
* DOM id of the MediaElement's video
*/
id: string;
/**
* Wheter the MediaElement refers to a local stream ([[Publisher]]) or a remote stream ([[Subscriber]])
*/
remote: boolean;
/**
* The [[Stream]] of the MediaElement
*/
stream: Stream;
/**
* HTML DOM element in which the MediaElement's video has been inserted
*/
element: HTMLElement;
}

View File

@ -0,0 +1,19 @@
"use strict";
/*
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
exports.__esModule = true;
//# sourceMappingURL=MediaElement.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MediaElement.js","sourceRoot":"","sources":["../../../../src/OpenViduInternal/Interfaces/Public/MediaElement.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}

View File

@ -0,0 +1,75 @@
import { Stream } from '../../../OpenVidu/Stream';
import { EventDispatcher } from './EventDispatcher';
import { Event } from '../../Events/Event';
import { VideoInsertMode } from '../../Enums/VideoInsertMode';
import EventEmitter = require('wolfy87-eventemitter');
/**
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any Publisher and Subscriber object, as well as
* any extra representation in the DOM you assign to some Stream by calling [[Stream.addVideoElement]].
*
* The use of this interface is useful when you don't need to differentiate between streams and just want to directly manage videos
*/
export declare class MediaManager implements EventDispatcher {
/**
* The Stream represented in the DOM by the MediaManager
*/
stream: Stream;
/**
* Whether the MediaManager is representing in the DOM a local Stream ([[Publisher]]) or a remote Stream ([[Subscriber]])
*/
remote: boolean;
/**
* The DOM HTMLElement assigned as targetElement when initializing the MediaManager. This property is defined when [[OpenVidu.initPublisher]]
* or [[Session.subscribe]] methods have been called passing a valid `targetElement` parameter. It is undefined when [[OpenVidu.initPublisher]]
* or [[Session.subscribe]] methods have been called passing *null* or *undefined* as `targetElement` parameter or when the MediaManager hass been
* created by calling [[Stream.addVideoElement]]
*/
targetElement?: HTMLElement;
/**
* The DOM HTMLVideoElement displaying the MediaManager's stream
*/
video: HTMLVideoElement;
/**
* `id` attribute of the DOM HTMLVideoElement displaying the MediaManager's stream
*/
id: string;
/**
* @hidden
*/
isVideoElementCreated: boolean;
protected ee: EventEmitter;
protected customEe: EventEmitter;
/**
* @hidden
*/
constructor(stream: Stream, targetElement?: HTMLElement | string);
/**
* See [[EventDispatcher.on]]
*/
on(type: string, handler: (event: Event) => void): EventDispatcher;
/**
* See [[EventDispatcher.once]]
*/
once(type: string, handler: (event: Event) => void): MediaManager;
/**
* See [[EventDispatcher.off]]
*/
off(type: string, handler?: (event: Event) => void): MediaManager;
/**
* @hidden
*/
insertVideo(targetElement?: HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement;
/**
* @hidden
*/
insertVideoWithMode(insertMode: VideoInsertMode): void;
/**
* @hidden
*/
removeVideo(): void;
/**
* @hidden
*/
addOnCanPlayEvent(): void;
private mirrorVideo();
}

View File

@ -0,0 +1,261 @@
"use strict";
/*
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
exports.__esModule = true;
var VideoInsertMode_1 = require("../../Enums/VideoInsertMode");
var VideoElementEvent_1 = require("../../Events/VideoElementEvent");
var EventEmitter = require("wolfy87-eventemitter");
/**
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any Publisher and Subscriber object, as well as
* any extra representation in the DOM you assign to some Stream by calling [[Stream.addVideoElement]].
*
* The use of this interface is useful when you don't need to differentiate between streams and just want to directly manage videos
*/
var MediaManager = /** @class */ (function () {
/**
* @hidden
*/
function MediaManager(stream, targetElement) {
var _this = this;
/**
* @hidden
*/
this.isVideoElementCreated = false;
this.ee = new EventEmitter();
this.customEe = new EventEmitter();
this.stream = stream;
this.stream.mediaManagers.push(this);
if (typeof targetElement === 'string') {
var e = document.getElementById(targetElement);
if (!!e) {
this.targetElement = e;
}
}
else if (targetElement instanceof HTMLElement) {
this.targetElement = targetElement;
}
if (!this.targetElement) {
console.warn("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
}
this.customEe.on('video-removed', function (element) {
_this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent_1.VideoElementEvent(element, _this, 'videoElementDestroyed')]);
});
}
/**
* See [[EventDispatcher.on]]
*/
MediaManager.prototype.on = function (type, handler) {
var _this = this;
this.ee.on(type, function (event) {
if (event) {
console.info("Event '" + type + "' triggered", event);
}
else {
console.info("Event '" + type + "' triggered");
}
handler(event);
});
if (type === 'videoElementCreated') {
if (!!this.stream && this.isVideoElementCreated) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoElementCreated')]);
}
else {
this.customEe.on('video-element-created', function (element) {
_this.id = element.id;
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
});
}
}
if (type === 'videoPlaying') {
if (!this.stream.displayMyRemote() && !!this.video &&
this.video.currentTime > 0 &&
this.video.paused === false &&
this.video.ended === false &&
this.video.readyState === 4) {
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoPlaying')]);
}
else {
this.customEe.once('video-is-playing', function (element) {
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
});
}
}
return this;
};
/**
* See [[EventDispatcher.once]]
*/
MediaManager.prototype.once = function (type, handler) {
var _this = this;
this.ee.once(type, function (event) {
if (event) {
console.info("Event '" + type + "' triggered once", event);
}
else {
console.info("Event '" + type + "' triggered once");
}
handler(event);
});
if (type === 'videoElementCreated') {
if (!!this.stream && this.isVideoElementCreated) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoElementCreated')]);
}
else {
this.customEe.once('video-element-created', function (element) {
_this.id = element.id;
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
});
}
}
if (type === 'videoPlaying') {
if (!this.stream.displayMyRemote() && this.video &&
this.video.currentTime > 0 &&
this.video.paused === false &&
this.video.ended === false &&
this.video.readyState === 4) {
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoPlaying')]);
}
else {
this.customEe.once('video-is-playing', function (element) {
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
});
}
}
return this;
};
/**
* See [[EventDispatcher.off]]
*/
MediaManager.prototype.off = function (type, handler) {
if (!handler) {
this.ee.removeAllListeners(type);
}
else {
this.ee.off(type, handler);
}
return this;
};
/**
* @hidden
*/
MediaManager.prototype.insertVideo = function (targetElement, insertMode) {
var _this = this;
if (!!targetElement) {
this.video = document.createElement('video');
this.video.id = (this.stream.isLocal() ? 'local-' : 'remote-') + 'video-' + this.stream.streamId;
this.video.autoplay = true;
this.video.controls = false;
this.video.srcObject = this.stream.getMediaStream();
if (this.stream.isLocal() && !this.stream.displayMyRemote()) {
this.video.muted = true;
if (this.stream.outboundStreamOpts.publisherProperties.mirror) {
this.mirrorVideo();
}
this.video.oncanplay = function () {
console.info("Local 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
_this.customEe.emitEvent('video-is-playing', [{
element: _this.video
}]);
};
}
else {
this.video.title = this.stream.streamId;
}
this.targetElement = targetElement;
var insMode = !!insertMode ? insertMode : VideoInsertMode_1.VideoInsertMode.APPEND;
this.insertVideoWithMode(insMode);
this.customEe.emitEvent('video-element-created', [{
element: this.video
}]);
this.isVideoElementCreated = true;
}
this.stream.isReadyToPublish = true;
this.customEe.emitEvent('stream-ready-to-publish');
return this.video;
};
/**
* @hidden
*/
MediaManager.prototype.insertVideoWithMode = function (insertMode) {
if (!!this.targetElement) {
switch (insertMode) {
case VideoInsertMode_1.VideoInsertMode.AFTER:
this.targetElement.parentNode.insertBefore(this.video, this.targetElement.nextSibling);
break;
case VideoInsertMode_1.VideoInsertMode.APPEND:
this.targetElement.appendChild(this.video);
break;
case VideoInsertMode_1.VideoInsertMode.BEFORE:
this.targetElement.parentNode.insertBefore(this.video, this.targetElement);
break;
case VideoInsertMode_1.VideoInsertMode.PREPEND:
this.targetElement.insertBefore(this.video, this.targetElement.childNodes[0]);
break;
case VideoInsertMode_1.VideoInsertMode.REPLACE:
this.targetElement.parentNode.replaceChild(this.video, this.targetElement);
break;
default:
this.insertVideoWithMode(VideoInsertMode_1.VideoInsertMode.APPEND);
}
}
};
/**
* @hidden
*/
MediaManager.prototype.removeVideo = function () {
if (!!this.video) {
var videoDOM = document.getElementById(this.id);
if (!!videoDOM) {
videoDOM.parentNode.removeChild(videoDOM);
this.customEe.emitEvent('video-removed', [this.video]);
}
delete this.video;
}
};
/**
* @hidden
*/
MediaManager.prototype.addOnCanPlayEvent = function () {
var _this = this;
if (!!this.video) {
// let thumbnailId = this.video.thumb;
this.video.oncanplay = function () {
if (_this.stream.isLocal() && _this.stream.displayMyRemote()) {
console.info("Your own remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
_this.customEe.emitEvent('remote-video-is-playing', [{
element: _this.video
}]);
}
else if (!_this.stream.isLocal() && !_this.stream.displayMyRemote()) {
console.info("Remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
_this.customEe.emitEvent('video-is-playing', [{
element: _this.video
}]);
}
// show(thumbnailId);
// this.hideSpinner(this.streamId);
};
}
};
MediaManager.prototype.mirrorVideo = function () {
this.video.style.transform = 'rotateY(180deg)';
this.video.style.webkitTransform = 'rotateY(180deg)';
};
return MediaManager;
}());
exports.MediaManager = MediaManager;
//# sourceMappingURL=MediaManager.js.map

File diff suppressed because one or more lines are too long

View File

@ -26,12 +26,12 @@ export interface PublisherProperties {
*/ */
mirror?: boolean; mirror?: boolean;
/** /**
* Whether to initially publish to the session with the audio unmuted or muted. Only makes sense if property `audioSource` is NOT set to false. You can change the audio state later during the session with [[Publisher.publishAudio]] * Whether to initially publish to the session with the audio unmuted or muted. Only makes sense if property `audioSource` is NOT set to *false* or *null*. You can change the audio state later during the session with [[Publisher.publishAudio]]
* @default true * @default true
*/ */
publishAudio?: boolean; publishAudio?: boolean;
/** /**
* Whether to initially publish to the session with the video enabled or disabled. Only makes sense if property `videoSource` is NOT set to false. You can change the video state later during the session with [[Publisher.publishVideo]] * Whether to initially publish to the session with the video enabled or disabled. Only makes sense if property `videoSource` is NOT set to *false* or *null*. You can change the video state later during the session with [[Publisher.publishVideo]]
* @default true * @default true
*/ */
publishVideo?: boolean; publishVideo?: boolean;

View File

@ -0,0 +1,31 @@
import { VideoInsertMode } from '../../Enums/VideoInsertMode';
export interface StreamManagerVideo {
/**
* DOM video element displaying the StreamManager's stream
*/
video: HTMLVideoElement;
/**
* `id` attribute of the DOM video element displaying the StreamManager's stream
*/
id: string;
/**
* The DOM HTMLElement assigned as target element when creating a video for the StreamManager. This property is defined when:
* - [[OpenVidu.initPublisher]] or [[Session.subscribe]] methods have been called passing a valid `targetElement` parameter.
* - [[SessionManager.createVideoElement]] has been called.
*
* This property is undefined when:
* - [[OpenVidu.initPublisher]] or [[Session.subscribe]] methods have been called passing *null* or *undefined* as `targetElement` parameter.
* - [[SessionManager.addVideoElement]] has been called.
*/
targetElement?: HTMLElement;
/**
* How the DOM video element should be inserted with respect to `targetElement`. This property is defined when:
* - [[OpenVidu.initPublisher]] or [[Session.subscribe]] methods have been called passing a valid `targetElement` parameter.
* - [[SessionManager.createVideoElement]] has been called.
*
* This property is undefined when:
* - [[OpenVidu.initPublisher]] or [[Session.subscribe]] methods have been called passing *null* or *undefined* as `targetElement` parameter.
* - [[SessionManager.addVideoElement]] has been called.
*/
insertMode?: VideoInsertMode;
}

View File

@ -0,0 +1,19 @@
"use strict";
/*
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
exports.__esModule = true;
//# sourceMappingURL=StreamManagerVideo.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"StreamManagerVideo.js","sourceRoot":"","sources":["../../../../src/OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}

View File

@ -2,6 +2,7 @@ export { OpenVidu } from './OpenVidu/OpenVidu';
export { Session } from './OpenVidu/Session'; export { Session } from './OpenVidu/Session';
export { Publisher } from './OpenVidu/Publisher'; export { Publisher } from './OpenVidu/Publisher';
export { Subscriber } from './OpenVidu/Subscriber'; export { Subscriber } from './OpenVidu/Subscriber';
export { StreamManager } from './OpenVidu/StreamManager';
export { Stream } from './OpenVidu/Stream'; export { Stream } from './OpenVidu/Stream';
export { Connection } from './OpenVidu/Connection'; export { Connection } from './OpenVidu/Connection';
export { LocalRecorder } from './OpenVidu/LocalRecorder'; export { LocalRecorder } from './OpenVidu/LocalRecorder';
@ -15,10 +16,12 @@ export { RecordingEvent } from './OpenViduInternal/Events/RecordingEvent';
export { SessionDisconnectedEvent } from './OpenViduInternal/Events/SessionDisconnectedEvent'; export { SessionDisconnectedEvent } from './OpenViduInternal/Events/SessionDisconnectedEvent';
export { SignalEvent } from './OpenViduInternal/Events/SignalEvent'; export { SignalEvent } from './OpenViduInternal/Events/SignalEvent';
export { StreamEvent } from './OpenViduInternal/Events/StreamEvent'; export { StreamEvent } from './OpenViduInternal/Events/StreamEvent';
export { StreamManagerEvent } from './OpenViduInternal/Events/StreamManagerEvent';
export { VideoElementEvent } from './OpenViduInternal/Events/VideoElementEvent'; export { VideoElementEvent } from './OpenViduInternal/Events/VideoElementEvent';
export { Device } from './OpenViduInternal/Interfaces/Public/Device'; export { Device } from './OpenViduInternal/Interfaces/Public/Device';
export { EventDispatcher } from './OpenViduInternal/Interfaces/Public/EventDispatcher'; export { EventDispatcher } from './OpenViduInternal/Interfaces/Public/EventDispatcher';
export { OpenViduAdvancedConfiguration } from './OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration'; export { OpenViduAdvancedConfiguration } from './OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration';
export { PublisherProperties } from './OpenViduInternal/Interfaces/Public/PublisherProperties'; export { PublisherProperties } from './OpenViduInternal/Interfaces/Public/PublisherProperties';
export { SignalOptions } from './OpenViduInternal/Interfaces/Public/SignalOptions'; export { SignalOptions } from './OpenViduInternal/Interfaces/Public/SignalOptions';
export { StreamManagerVideo } from './OpenViduInternal/Interfaces/Public/StreamManagerVideo';
export { SubscriberProperties } from './OpenViduInternal/Interfaces/Public/SubscriberProperties'; export { SubscriberProperties } from './OpenViduInternal/Interfaces/Public/SubscriberProperties';

View File

@ -8,6 +8,8 @@ var Publisher_1 = require("./OpenVidu/Publisher");
exports.Publisher = Publisher_1.Publisher; exports.Publisher = Publisher_1.Publisher;
var Subscriber_1 = require("./OpenVidu/Subscriber"); var Subscriber_1 = require("./OpenVidu/Subscriber");
exports.Subscriber = Subscriber_1.Subscriber; exports.Subscriber = Subscriber_1.Subscriber;
var StreamManager_1 = require("./OpenVidu/StreamManager");
exports.StreamManager = StreamManager_1.StreamManager;
var Stream_1 = require("./OpenVidu/Stream"); var Stream_1 = require("./OpenVidu/Stream");
exports.Stream = Stream_1.Stream; exports.Stream = Stream_1.Stream;
var Connection_1 = require("./OpenVidu/Connection"); var Connection_1 = require("./OpenVidu/Connection");
@ -34,6 +36,8 @@ var SignalEvent_1 = require("./OpenViduInternal/Events/SignalEvent");
exports.SignalEvent = SignalEvent_1.SignalEvent; exports.SignalEvent = SignalEvent_1.SignalEvent;
var StreamEvent_1 = require("./OpenViduInternal/Events/StreamEvent"); var StreamEvent_1 = require("./OpenViduInternal/Events/StreamEvent");
exports.StreamEvent = StreamEvent_1.StreamEvent; exports.StreamEvent = StreamEvent_1.StreamEvent;
var StreamManagerEvent_1 = require("./OpenViduInternal/Events/StreamManagerEvent");
exports.StreamManagerEvent = StreamManagerEvent_1.StreamManagerEvent;
var VideoElementEvent_1 = require("./OpenViduInternal/Events/VideoElementEvent"); var VideoElementEvent_1 = require("./OpenViduInternal/Events/VideoElementEvent");
exports.VideoElementEvent = VideoElementEvent_1.VideoElementEvent; exports.VideoElementEvent = VideoElementEvent_1.VideoElementEvent;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,gDAA+C;AAAtC,8BAAA,QAAQ,CAAA;AACjB,8CAA6C;AAApC,4BAAA,OAAO,CAAA;AAChB,kDAAiD;AAAxC,gCAAA,SAAS,CAAA;AAClB,oDAAmD;AAA1C,kCAAA,UAAU,CAAA;AACnB,4CAA2C;AAAlC,0BAAA,MAAM,CAAA;AACf,oDAAmD;AAA1C,kCAAA,UAAU,CAAA;AACnB,0DAAyD;AAAhD,wCAAA,aAAa,CAAA;AAEtB,kFAAiF;AAAxE,kDAAA,kBAAkB,CAAA;AAC3B,wEAAuE;AAA9D,wCAAA,aAAa,CAAA;AACtB,4EAA2E;AAAlE,4CAAA,eAAe,CAAA;AAExB,yDAAwD;AAA/C,wBAAA,KAAK,CAAA;AACd,6EAA4E;AAAnE,4CAAA,eAAe,CAAA;AACxB,2FAA0F;AAAjF,0DAAA,sBAAsB,CAAA;AAC/B,2EAA0E;AAAjE,0CAAA,cAAc,CAAA;AACvB,+FAA8F;AAArF,8DAAA,wBAAwB,CAAA;AACjC,qEAAoE;AAA3D,oCAAA,WAAW,CAAA;AACpB,qEAAoE;AAA3D,oCAAA,WAAW,CAAA;AACpB,iFAAgF;AAAvE,gDAAA,iBAAiB,CAAA"} {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,gDAA+C;AAAtC,8BAAA,QAAQ,CAAA;AACjB,8CAA6C;AAApC,4BAAA,OAAO,CAAA;AAChB,kDAAiD;AAAxC,gCAAA,SAAS,CAAA;AAClB,oDAAmD;AAA1C,kCAAA,UAAU,CAAA;AACnB,0DAAyD;AAAhD,wCAAA,aAAa,CAAA;AACtB,4CAA2C;AAAlC,0BAAA,MAAM,CAAA;AACf,oDAAmD;AAA1C,kCAAA,UAAU,CAAA;AACnB,0DAAyD;AAAhD,wCAAA,aAAa,CAAA;AAEtB,kFAAiF;AAAxE,kDAAA,kBAAkB,CAAA;AAC3B,wEAAuE;AAA9D,wCAAA,aAAa,CAAA;AACtB,4EAA2E;AAAlE,4CAAA,eAAe,CAAA;AAExB,yDAAwD;AAA/C,wBAAA,KAAK,CAAA;AACd,6EAA4E;AAAnE,4CAAA,eAAe,CAAA;AACxB,2FAA0F;AAAjF,0DAAA,sBAAsB,CAAA;AAC/B,2EAA0E;AAAjE,0CAAA,cAAc,CAAA;AACvB,+FAA8F;AAArF,8DAAA,wBAAwB,CAAA;AACjC,qEAAoE;AAA3D,oCAAA,WAAW,CAAA;AACpB,qEAAoE;AAA3D,oCAAA,WAAW,CAAA;AACpB,mFAAkF;AAAzE,kDAAA,kBAAkB,CAAA;AAC3B,iFAAgF;AAAvE,gDAAA,iBAAiB,CAAA"}

View File

@ -52,6 +52,7 @@ export class LocalRecorder {
this.state = LocalRecorderState.READY; this.state = LocalRecorderState.READY;
} }
/** /**
* Starts the recording of the Stream. [[state]] property must be `READY`. After method succeeds is set to `RECORDING` * Starts the recording of the Stream. [[state]] property must be `READY`. After method succeeds is set to `RECORDING`
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording successfully started and rejected with an Error object if not * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording successfully started and rejected with an Error object if not

View File

@ -90,12 +90,13 @@ export class OpenVidu {
* *
* The [[Publisher]] object will dispatch an `accessAllowed` or `accessDenied` event once it has been granted access to the requested input devices or not. * The [[Publisher]] object will dispatch an `accessAllowed` or `accessDenied` event once it has been granted access to the requested input devices or not.
* *
* The [[Publisher]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (if _targetElement_ not null or undefined, or if you call [[Publisher.createVideoElement]]) * The [[Publisher]] object will dispatch a `videoElementCreated` event once a HTML video element has been added to DOM (only if you
* [let OpenVidu take care of the video players](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.
* *
* The [[Publisher]] object will dispatch a `streamPlaying` event once the local streams starts playing * The [[Publisher]] object will dispatch a `streamPlaying` event once the local streams starts playing. See [[StreamManagerEvent]] to learn more.
* *
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher will be inserted (see [[PublisherProperties.insertMode]]). If null or undefined no default video will be created for this Publisher * @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher will be inserted (see [[PublisherProperties.insertMode]]). If *null* or *undefined* no default video will be created for this Publisher.
* (you can always call method [[Stream.addVideoElement]] for the object [[Publisher.stream]] to manage the video elements on your own) * You can always call method [[Publisher.addVideoElement]] or [[Publisher.createVideoElement]] to manage the video elements on your own (see [Manage video players](/docs/how-do-i/manage-videos) section)
* @param completionHandler `error` parameter is null if `initPublisher` succeeds, and is defined if it fails. * @param completionHandler `error` parameter is null if `initPublisher` succeeds, and is defined if it fails.
* `completionHandler` function is called before the Publisher dispatches an `accessAllowed` or an `accessDenied` event * `completionHandler` function is called before the Publisher dispatches an `accessAllowed` or an `accessDenied` event
*/ */

View File

@ -41,7 +41,7 @@ export class Publisher extends StreamManager {
accessAllowed = false; accessAllowed = false;
/** /**
* Whether you have called [[Publisher.subscribeToRemote]] with value `true` or `false` (false by default) * Whether you have called [[Publisher.subscribeToRemote]] with value `true` or `false` (*false* by default)
*/ */
isSubscribedToRemote = false; isSubscribedToRemote = false;
@ -68,6 +68,7 @@ export class Publisher extends StreamManager {
}); });
} }
/** /**
* Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect * Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect
* @param value `true` to publish the audio stream, `false` to unpublish it * @param value `true` to publish the audio stream, `false` to unpublish it
@ -77,6 +78,7 @@ export class Publisher extends StreamManager {
console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its audio stream'); console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its audio stream');
} }
/** /**
* Publish or unpublish the video stream (if available). Calling this method twice in a row passing same value will have no effect * Publish or unpublish the video stream (if available). Calling this method twice in a row passing same value will have no effect
* @param value `true` to publish the video stream, `false` to unpublish it * @param value `true` to publish the video stream, `false` to unpublish it
@ -86,8 +88,9 @@ export class Publisher extends StreamManager {
console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its video stream'); console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its video stream');
} }
/** /**
* Call this method before [[Session.publish]] to subscribe to your Publisher's stream as any other user would do. The local video will be automatically replaced by the remote video * Call this method before [[Session.publish]] to subscribe to your Publisher's remote stream instead of using the local stream, as any other user would do.
*/ */
subscribeToRemote(value?: boolean): void { subscribeToRemote(value?: boolean): void {
value = (value !== undefined) ? value : true; value = (value !== undefined) ? value : true;

View File

@ -42,7 +42,7 @@ import EventEmitter = require('wolfy87-eventemitter');
/** /**
* Represents a video call. It can also be seen as a videoconference room where multiple users can connect. * Represents a video call. It can also be seen as a videoconference room where multiple users can connect.
* Participants who publish their videos to a session will be seen by the rest of users connected to that specific session. * Participants who publish their videos to a session can be seen by the rest of users connected to that specific session.
* Initialized with [[OpenVidu.initSession]] method * Initialized with [[OpenVidu.initSession]] method
*/ */
export class Session implements EventDispatcher { export class Session implements EventDispatcher {
@ -53,12 +53,12 @@ export class Session implements EventDispatcher {
connection: Connection; connection: Connection;
/** /**
* Unique identifier of the Session. This is the same value you pass when calling [[OpenVidu.initSession]] * Unique identifier of the Session
*/ */
sessionId: string; sessionId: string;
/** /**
* Collection of all StreamManagers of this Session ([[Publishers]] and [[Subscribers]]) * Collection of all StreamManagers of this Session ([[Publisher]] and [[Subscriber]])
*/ */
streamManagers: StreamManager[] = []; streamManagers: StreamManager[] = [];
@ -114,14 +114,14 @@ export class Session implements EventDispatcher {
* - Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have * - Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have
* successfully connected will also dispatch a `connectionCreated` event when they do so. * successfully connected will also dispatch a `connectionCreated` event when they do so.
* *
* The [[Session]] object of the local participant will also dispatch a `streamCreated` event for each remote active [[Publisher]] after dispatching all remote * The [[Session]] object of the local participant will also dispatch a `streamCreated` event for each remote active [[Publisher]] that was already streaming
* `connectionCreated` events. * when connecting, just after dispatching all remote `connectionCreated` events.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `connectionCreated` event. * The [[Session]] object of every other participant connected to the session will dispatch a `connectionCreated` event.
* *
* See [[ConnectionEvent]] and [[StreamEvent]] to learn more. * See [[ConnectionEvent]] and [[StreamEvent]] to learn more.
* *
* @returns A Promise to which you must subscribe that is resolved if the recording successfully started and rejected with an Error object if not * @returns A Promise to which you must subscribe that is resolved if the the connection to the Session was successful and rejected with an Error object if not
* *
*/ */
connect(token: string, metadata?: any): Promise<any> { connect(token: string, metadata?: any): Promise<any> {
@ -154,18 +154,23 @@ export class Session implements EventDispatcher {
* *
* The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event. * The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event.
* This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) * This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and also delete the HTML video element associated to it. * and also deletes any HTML video element associated to each Subscriber (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` to avoid this beahviour and take care of disposing and cleaning all the Subscriber objects yourself. See [[SessionDisconnectedEvent]] to learn more. * For every video removed, each Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `sessionDisconnected` to avoid this behaviour and take care of disposing and cleaning all the Subscriber objects yourself.
* See [[SessionDisconnectedEvent]] and [[VideoElementEvent]] to learn more to learn more.
* *
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session. * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session.
* This event will automatically stop all media tracks and delete the HTML video element associated to it. * This event will automatically stop all media tracks and delete any HTML video element associated to it (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` if you want clean the Publisher object yourself or re-publish it in a different Session (to do so it is a mandatory * For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* requirement to call `Session.unpublish()` or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] to learn more. * Call `event.preventDefault()` uppon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session (to do so it is a mandatory requirement to call `Session.unpublish()`
* or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing. * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and delete the HTML video element associated to it. * and also deletes any HTML video element associated to that Subscriber (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* Call `event.preventDefault()` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. See [[StreamEvent]] to learn more. * For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself.
* See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more. * The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more.
*/ */
@ -183,15 +188,14 @@ export class Session implements EventDispatcher {
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Subscriber]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (if _targetElement_ not null or undefined, or if you call [[Subscriber.createVideoElement]]) * The [[Subscriber]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (only if you
* [let OpenVidu take care of the video players](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.
* *
* The [[Subscriber]] object will dispatch a `streamPlaying` event once the remote stream starts playing * The [[Subscriber]] object will dispatch a `streamPlaying` event once the remote stream starts playing. See [[StreamManagerEvent]] to learn more.
*
* See [[VideoElementEvent]] to learn more.
* *
* @param stream Stream object to subscribe to * @param stream Stream object to subscribe to
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Subscriber will be inserted (see [[SubscriberProperties.insertMode]]). If null or undefined no default video will be created for this Subscriber * @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Subscriber will be inserted (see [[SubscriberProperties.insertMode]]). If *null* or *undefined* no default video will be created for this Subscriber.
* (you can always call method [[Stream.addVideoElement]] for the object [[Subscriber.stream]] to manage the video elements on your own) * You can always call method [[Subscriber.addVideoElement]] or [[Subscriber.createVideoElement]] to manage the video elements on your own (see [Manage video players](/docs/how-do-i/manage-videos) section)
* @param completionHandler `error` parameter is null if `subscribe` succeeds, and is defined if it fails. * @param completionHandler `error` parameter is null if `subscribe` succeeds, and is defined if it fails.
*/ */
subscribe(stream: Stream, targetElement: string | HTMLElement, param3?: ((error: Error | undefined) => void) | SubscriberProperties, param4?: ((error: Error | undefined) => void)): Subscriber { subscribe(stream: Stream, targetElement: string | HTMLElement, param3?: ((error: Error | undefined) => void) | SubscriberProperties, param4?: ((error: Error | undefined) => void)): Subscriber {
@ -269,11 +273,14 @@ export class Session implements EventDispatcher {
/** /**
* Unsubscribes from `subscriber`, automatically removing its HTML video element. * Unsubscribes from `subscriber`, automatically removing its associated HTML video elements.
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Subscriber]] object will dispatch a `videoElementDestroyed` event (only if it previously dispatched a `videoElementCreated` event). See [[VideoElementEvent]] to learn more * The [[Subscriber]] object will dispatch a `videoElementDestroyed` event for each video associated to it that was removed from DOM.
* Only videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)) will be automatically removed
*
* See [[VideoElementEvent]] to learn more
*/ */
unsubscribe(subscriber: Subscriber): void { unsubscribe(subscriber: Subscriber): void {
const connectionId = subscriber.stream.connection.connectionId; const connectionId = subscriber.stream.connection.connectionId;
@ -298,7 +305,7 @@ export class Session implements EventDispatcher {
/** /**
* Publishes the participant's audio-video stream contained in `publisher` object to the session * Publishes to the Session the Publisher object
* *
* #### Events dispatched * #### Events dispatched
* *
@ -308,7 +315,7 @@ export class Session implements EventDispatcher {
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamCreated` event so they can subscribe to it. See [[StreamEvent]] to learn more. * The [[Session]] object of every other participant connected to the session will dispatch a `streamCreated` event so they can subscribe to it. See [[StreamEvent]] to learn more.
* *
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the publisher was successfully published and rejected with an Error object if not * @returns A Promise (to which you can optionally subscribe to) that is resolved only after the publisher was successfully published and rejected with an Error object if not
*/ */
publish(publisher: Publisher): Promise<any> { publish(publisher: Publisher): Promise<any> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -347,19 +354,23 @@ export class Session implements EventDispatcher {
/** /**
* Unpublishes the participant's audio-video stream contained in `publisher` object. * Unpublishes from the Session the Publisher object.
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event. * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event.
* This event will automatically stop all media tracks and delete the HTML video element associated to it. * This event will automatically stop all media tracks and delete any HTML video element associated to this Publisher
* Call `event.preventDefault()` if you want clean the Publisher object yourself or re-publish it in a different Session. * (only those videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event. * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and delete the HTML video element associated to it. * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and
* Call `event.preventDefault()` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. * delete any HTML video element associated to it (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object on your own.
* *
* See [[StreamEvent]] to learn more. * See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
*/ */
unpublish(publisher: Publisher): void { unpublish(publisher: Publisher): void {

View File

@ -32,7 +32,7 @@ import * as kurentoUtils from '../OpenViduInternal/KurentoUtils/kurento-utils-js
/** /**
* Represents each one of the media streams available in OpenVidu Server for certain session. * Represents each one of the media streams available in OpenVidu Server for certain session.
* Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access * Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access
* to at least one of them (sending and receiving it, respectively) * to one of them (sending and receiving it, respectively)
*/ */
export class Stream { export class Stream {
@ -48,14 +48,12 @@ export class Stream {
frameRate?: number; frameRate?: number;
/** /**
* Whether the stream has a video track or not. This attribute may change if the Publisher publishing the Stream * Whether the stream has a video track or not
* calls [[Publisher.publishVideo]]. You can listen to event [[StreamPropertyChangedEvent]] to know when this happens
*/ */
hasVideo: boolean; hasVideo: boolean;
/** /**
* Whether the stream has an audio track or not. This attribute may change if the Publisher publishing the Stream * Whether the stream has an audio track or not
* calls [[Publisher.publishAudio]]. You can listen to event [[StreamPropertyChangedEvent]] to know when this happens
*/ */
hasAudio: boolean; hasAudio: boolean;

View File

@ -37,8 +37,6 @@ import EventEmitter = require('wolfy87-eventemitter');
*/ */
export class StreamManager implements EventDispatcher { export class StreamManager implements EventDispatcher {
CURRENTVIDEO: HTMLVideoElement;
/** /**
* The Stream represented in the DOM by the Publisher/Subscriber * The Stream represented in the DOM by the Publisher/Subscriber
*/ */
@ -57,7 +55,7 @@ export class StreamManager implements EventDispatcher {
remote: boolean; remote: boolean;
/** /**
* The DOM HTMLElement assigned as target element when creating the first video for the Publisher/Subscriber. This property is only defined if: * The DOM HTMLElement assigned as target element when creating the video for the Publisher/Subscriber. This property is only defined if:
* - [[Publisher]] has been initialized by calling method [[OpenVidu.initPublisher]] with a valid `targetElement` parameter * - [[Publisher]] has been initialized by calling method [[OpenVidu.initPublisher]] with a valid `targetElement` parameter
* - [[Subscriber]] has been initialized by calling method [[Session.subscribe]] with a valid `targetElement` parameter * - [[Subscriber]] has been initialized by calling method [[Session.subscribe]] with a valid `targetElement` parameter
*/ */
@ -209,9 +207,8 @@ export class StreamManager implements EventDispatcher {
} }
/** /**
* Makes `video` element parameter display this Stream. This is useful when you are managing the video elements on your own * Makes `video` element parameter display this [[stream]]. This is useful when you are
* (parameter `targetElement` of methods [[OpenVidu.initPublisher]] or [[Session.subscribe]] is set to *null* or *undefined*) * [managing the video elements on your own](/docs/how-do-i/manage-videos/#you-take-care-of-the-video-players)
* or if you want to have multiple video elements displaying the same media stream.
* *
* Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be * Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be
* disassociated from that previous Publisher/Subscriber and to be associated to this one. * disassociated from that previous Publisher/Subscriber and to be associated to this one.
@ -257,10 +254,14 @@ export class StreamManager implements EventDispatcher {
} }
/** /**
* Creates a new video element displaying this Stream. This allows you to have multiple video elements displaying the same media stream. * Creates a new video element displaying this [[stream]]. This allows you to have multiple video elements displaying the same media stream.
* *
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher/Subscriber will be inserted. * #### Events dispatched
* If *null* or *undefined* no default video will be created. You can always call later method [[StreamManager.addVideoElement]] or [[StreamManager.createVideoElement]] *
* The Publisher/Subscriber object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM. See [[VideoElementEvent]]
*
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher/Subscriber will be inserted
* @param insertMode How the video element will be inserted accordingly to `targetElemet`
*/ */
createVideoElement(targetElement?: string | HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement { createVideoElement(targetElement?: string | HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement {
let targEl; let targEl;
@ -325,6 +326,10 @@ export class StreamManager implements EventDispatcher {
video.controls = false; video.controls = false;
if (!video.id) { if (!video.id) {
video.id = (this.remote ? 'remote-' : 'local-') + 'video-' + this.stream.streamId; video.id = (this.remote ? 'remote-' : 'local-') + 'video-' + this.stream.streamId;
// DEPRECATED property: assign once the property id if the user provided a valid targetElement
if (!this.id && !!this.targetElement) {
this.id = video.id;
}
} }
if (!this.remote && !this.stream.displayMyRemote()) { if (!this.remote && !this.stream.displayMyRemote()) {
video.muted = true; video.muted = true;

View File

@ -19,18 +19,81 @@
* Defines property [[OpenViduError.name]] * Defines property [[OpenViduError.name]]
*/ */
export enum OpenViduErrorName { export enum OpenViduErrorName {
/**
* Browser is not supported by OpenVidu.
* Returned uppon unsuccessful [[Session.connect]]
*/
BROWSER_NOT_SUPPORTED = 'BROWSER_NOT_SUPPORTED', BROWSER_NOT_SUPPORTED = 'BROWSER_NOT_SUPPORTED',
/**
* The user hasn't granted permissions to the required input device when the browser asked for them.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
DEVICE_ACCESS_DENIED = 'DEVICE_ACCESS_DENIED', DEVICE_ACCESS_DENIED = 'DEVICE_ACCESS_DENIED',
/**
* The user hasn't granted permissions to capture some desktop screen when the browser asked for them.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
SCREEN_CAPTURE_DENIED = 'SCREEN_CAPTURE_DENIED', SCREEN_CAPTURE_DENIED = 'SCREEN_CAPTURE_DENIED',
/**
* Browser does not support screen sharing.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
SCREEN_SHARING_NOT_SUPPORTED = 'SCREEN_SHARING_NOT_SUPPORTED', SCREEN_SHARING_NOT_SUPPORTED = 'SCREEN_SHARING_NOT_SUPPORTED',
/**
* Only for Chrome, there's no screen sharing extension installed
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
SCREEN_EXTENSION_NOT_INSTALLED = 'SCREEN_EXTENSION_NOT_INSTALLED', SCREEN_EXTENSION_NOT_INSTALLED = 'SCREEN_EXTENSION_NOT_INSTALLED',
/**
* Only for Chrome, the screen sharing extension is installed but is disabled
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
SCREEN_EXTENSION_DISABLED = 'SCREEN_EXTENSION_DISABLED', SCREEN_EXTENSION_DISABLED = 'SCREEN_EXTENSION_DISABLED',
/**
* No video input device found with the provided deviceId (property [[PublisherProperties.videoSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
INPUT_VIDEO_DEVICE_NOT_FOUND = 'INPUT_VIDEO_DEVICE_NOT_FOUND', INPUT_VIDEO_DEVICE_NOT_FOUND = 'INPUT_VIDEO_DEVICE_NOT_FOUND',
/**
* No audio input device found with the provided deviceId (property [[PublisherProperties.audioSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
INPUT_AUDIO_DEVICE_NOT_FOUND = 'INPUT_AUDIO_DEVICE_NOT_FOUND', INPUT_AUDIO_DEVICE_NOT_FOUND = 'INPUT_AUDIO_DEVICE_NOT_FOUND',
/**
* Method [[OpenVidu.initPublisher]] has been called with properties `videoSource` and `audioSource` of
* [[PublisherProperties]] parameter both set to *false* or *null*
*/
NO_INPUT_SOURCE_SET = 'NO_INPUT_SOURCE_SET', NO_INPUT_SOURCE_SET = 'NO_INPUT_SOURCE_SET',
/**
* Some media property of [[PublisherProperties]] such as `frameRate` or `resolution` is not supported
* by the input devices (whenever it is possible they are automatically adjusted to the most similar value).
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
PUBLISHER_PROPERTIES_ERROR = 'PUBLISHER_PROPERTIES_ERROR', PUBLISHER_PROPERTIES_ERROR = 'PUBLISHER_PROPERTIES_ERROR',
/**
* _Not in use yet_
*/
OPENVIDU_PERMISSION_DENIED = 'OPENVIDU_PERMISSION_DENIED', OPENVIDU_PERMISSION_DENIED = 'OPENVIDU_PERMISSION_DENIED',
/**
* _Not in use yet_
*/
OPENVIDU_NOT_CONNECTED = 'OPENVIDU_NOT_CONNECTED', OPENVIDU_NOT_CONNECTED = 'OPENVIDU_NOT_CONNECTED',
/**
* _Not in use yet_
*/
GENERIC_ERROR = 'GENERIC_ERROR' GENERIC_ERROR = 'GENERIC_ERROR'
} }

View File

@ -55,10 +55,17 @@ export abstract class Event {
/** /**
* Prevents the default behaviour of the event. The following events have a default behaviour: * Prevents the default behaviour of the event. The following events have a default behaviour:
* - `sessionDisconnected`: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) *
* and also deletes the HTML video element associated to it. * - `sessionDisconnected`: dispatched by [[Session]] object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* - `streamDestroyed`: if dispatched by a [[Publisher]] (_you_ have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by [[Session]], * and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
* (_other user_ has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it. * by calling [[Subscriber.createVideoElement]]). For every video removed, each Subscriber object will also dispatch a `videoElementDestroyed` event.
*
* - `streamDestroyed`:
* - If dispatched by a [[Publisher]] (*you* have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement`
* in method [[OpenVidu.initPublisher]] or by calling [[Publisher.createVideoElement]]). For every video removed, the Publisher object will also dispatch a `videoElementDestroyed` event.
* - If dispatched by [[Session]] (*other user* has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
* by calling [[Subscriber.createVideoElement]]). For every video removed, the Subscriber object will also dispatch a `videoElementDestroyed` event.
*/ */
preventDefault() { preventDefault() {
// tslint:disable-next-line:no-empty // tslint:disable-next-line:no-empty

View File

@ -21,8 +21,9 @@ import { StreamManager } from '../../OpenVidu/StreamManager';
/** /**
* Defines the following events: * Defines the following events:
* - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] whenever a new HTML video element has been inserted into DOM * - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] whenever a new HTML video element has been inserted into DOM by OpenVidu Browser library. See
* - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] whenever an HTML video element has been removed from DOM * [Manage video players](/docs/how-do-i/manage-videos) section.
* - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] whenever an HTML video element has been removed from DOM by OpenVidu Browser library.
*/ */
export class VideoElementEvent extends Event { export class VideoElementEvent extends Event {

View File

@ -49,13 +49,13 @@ export interface PublisherProperties {
mirror?: boolean; mirror?: boolean;
/** /**
* Whether to initially publish to the session with the audio unmuted or muted. Only makes sense if property `audioSource` is NOT set to false. You can change the audio state later during the session with [[Publisher.publishAudio]] * Whether to initially publish to the session with the audio unmuted or muted. Only makes sense if property `audioSource` is NOT set to *false* or *null*. You can change the audio state later during the session with [[Publisher.publishAudio]]
* @default true * @default true
*/ */
publishAudio?: boolean; publishAudio?: boolean;
/** /**
* Whether to initially publish to the session with the video enabled or disabled. Only makes sense if property `videoSource` is NOT set to false. You can change the video state later during the session with [[Publisher.publishVideo]] * Whether to initially publish to the session with the video enabled or disabled. Only makes sense if property `videoSource` is NOT set to *false* or *null*. You can change the video state later during the session with [[Publisher.publishVideo]]
* @default true * @default true
*/ */
publishVideo?: boolean; publishVideo?: boolean;