Merge remote-tracking branch 'upstream/master'

pull/88/head
techcouncilbox 2018-07-05 15:48:01 +02:00
commit 799e4f5935
270 changed files with 126828 additions and 121385 deletions

View File

@ -13,7 +13,7 @@ module.exports = {
exclude: [
"**/OpenViduInternal/Interfaces/Private/**",
"**/OpenViduInternal/WebRtcStats/WebRtcStats.ts",
"**/OpenViduInternal/VersionAdapter.ts"
"**/OpenViduInternal/WebRtcPeer/WebRtcPeer.ts"
],
excludeExternals: true,
excludePrivate: true,

File diff suppressed because one or more lines are too long

View File

@ -106,7 +106,7 @@
<div class="tsd-signature tsd-kind-icon">connection<wbr>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/Connection.ts#L35">OpenVidu/Connection.ts:35</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Connection.ts#L34">OpenVidu/Connection.ts:34</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -121,7 +121,7 @@
<div class="tsd-signature tsd-kind-icon">creation<wbr>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Connection.ts#L40">OpenVidu/Connection.ts:40</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Connection.ts#L39">OpenVidu/Connection.ts:39</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -136,7 +136,7 @@
<div class="tsd-signature tsd-kind-icon">data<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/Connection.ts#L46">OpenVidu/Connection.ts:46</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Connection.ts#L45">OpenVidu/Connection.ts:45</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -230,9 +230,6 @@
<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>

View File

@ -360,9 +360,6 @@
<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>

View File

@ -97,9 +97,6 @@
<li>
<a href="publisherspeakingevent.html" class="tsd-signature-type">PublisherSpeakingEvent</a>
</li>
<li>
<a href="streampropertychangedevent.html" class="tsd-signature-type">StreamPropertyChangedEvent</a>
</li>
</ul>
</li>
</ul>
@ -346,9 +343,6 @@
<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>

View File

@ -496,9 +496,6 @@
<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>

View File

@ -122,7 +122,7 @@
<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/OpenVidu.ts#L62">OpenVidu/OpenVidu.ts:62</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L70">OpenVidu/OpenVidu.ts:70</a></li>
</ul>
</aside>
<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">
<aside class="tsd-sources">
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L213">OpenVidu/OpenVidu.ts:213</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -165,7 +165,7 @@
<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/OpenVidu.ts#L322">OpenVidu/OpenVidu.ts:322</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L330">OpenVidu/OpenVidu.ts:330</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -187,7 +187,7 @@
<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/OpenVidu.ts#L223">OpenVidu/OpenVidu.ts:223</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L231">OpenVidu/OpenVidu.ts:231</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -209,7 +209,7 @@
<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/OpenVidu.ts#L292">OpenVidu/OpenVidu.ts:292</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L300">OpenVidu/OpenVidu.ts:300</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -278,7 +278,7 @@ OV.getUserMedia({
<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/OpenVidu.ts#L196">OpenVidu/OpenVidu.ts:196</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L204">OpenVidu/OpenVidu.ts:204</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -312,7 +312,7 @@ OV.getUserMedia({
<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/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#L86">OpenVidu/OpenVidu.ts:86</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -344,7 +344,7 @@ OV.getUserMedia({
<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/OpenVidu.ts#L79">OpenVidu/OpenVidu.ts:79</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L87">OpenVidu/OpenVidu.ts:87</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -379,7 +379,7 @@ OV.getUserMedia({
<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/OpenVidu.ts#L80">OpenVidu/OpenVidu.ts:80</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L88">OpenVidu/OpenVidu.ts:88</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -438,7 +438,7 @@ OV.getUserMedia({
<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/OpenVidu.ts#L81">OpenVidu/OpenVidu.ts:81</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L89">OpenVidu/OpenVidu.ts:89</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -510,7 +510,7 @@ OV.getUserMedia({
<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/OpenVidu.ts#L167">OpenVidu/OpenVidu.ts:167</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L175">OpenVidu/OpenVidu.ts:175</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -532,7 +532,7 @@ OV.getUserMedia({
<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/OpenVidu.ts#L168">OpenVidu/OpenVidu.ts:168</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L176">OpenVidu/OpenVidu.ts:176</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -558,7 +558,7 @@ OV.getUserMedia({
<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/OpenVidu.ts#L72">OpenVidu/OpenVidu.ts:72</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>
</aside>
<div class="tsd-comment tsd-typography">
@ -580,7 +580,7 @@ OV.getUserMedia({
<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/OpenVidu.ts#L337">OpenVidu/OpenVidu.ts:337</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L345">OpenVidu/OpenVidu.ts:345</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -708,9 +708,6 @@ OV.getUserMedia({
<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>

View File

@ -199,9 +199,6 @@
<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>

View File

@ -134,7 +134,7 @@
<div class="tsd-signature tsd-kind-icon">access<wbr>Allowed<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">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L41">OpenVidu/Publisher.ts:41</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L39">OpenVidu/Publisher.ts:39</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -169,7 +169,7 @@
<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">
<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#L44">OpenVidu/Publisher.ts:44</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -204,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>
<aside class="tsd-sources">
<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/Publisher.ts#L49">OpenVidu/Publisher.ts:49</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -404,7 +404,7 @@
<aside class="tsd-sources">
<p>Overrides <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#on">on</a></p>
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L107">OpenVidu/Publisher.ts:107</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -454,7 +454,7 @@
<aside class="tsd-sources">
<p>Overrides <a href="streammanager.html">StreamManager</a>.<a href="streammanager.html#once">once</a></p>
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L144">OpenVidu/Publisher.ts:144</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -503,7 +503,7 @@
<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/Publisher.ts#L76">OpenVidu/Publisher.ts:76</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L74">OpenVidu/Publisher.ts:74</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -565,7 +565,7 @@
<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/Publisher.ts#L95">OpenVidu/Publisher.ts:95</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Publisher.ts#L97">OpenVidu/Publisher.ts:97</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -706,9 +706,6 @@
<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>

View File

@ -362,9 +362,6 @@
<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>

View File

@ -361,9 +361,6 @@
<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>

View File

@ -970,9 +970,6 @@
<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>

View File

@ -335,9 +335,6 @@
<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>

View File

@ -357,9 +357,6 @@
<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>

View File

@ -111,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>
<aside class="tsd-sources">
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L41">OpenVidu/Stream.ts:41</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -126,7 +126,7 @@
<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">
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L47">OpenVidu/Stream.ts:47</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -142,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>
<aside class="tsd-sources">
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L57">OpenVidu/Stream.ts:57</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -157,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>
<aside class="tsd-sources">
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L52">OpenVidu/Stream.ts:52</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -172,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>
<aside class="tsd-sources">
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L62">OpenVidu/Stream.ts:62</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -187,7 +187,7 @@
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L72">OpenVidu/Stream.ts:72</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -202,7 +202,7 @@
<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">
<ul>
<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>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Stream.ts#L67">OpenVidu/Stream.ts:67</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -307,9 +307,6 @@
<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>

View File

@ -361,9 +361,6 @@
<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>

View File

@ -545,9 +545,6 @@
<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>

View File

@ -316,9 +316,6 @@
</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>

View File

@ -1,494 +0,0 @@
<!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

@ -575,9 +575,6 @@
<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 class="current">
<li class="current tsd-kind-class">

View File

@ -313,9 +313,6 @@
<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>

View File

@ -212,9 +212,6 @@
<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>

View File

@ -421,9 +421,6 @@
<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>

View File

@ -258,9 +258,6 @@
<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>

View File

@ -95,7 +95,6 @@
<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>
</ul>
@ -183,9 +182,6 @@
<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>

View File

@ -213,9 +213,6 @@
<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>

View File

@ -320,9 +320,6 @@
<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>

View File

@ -67,6 +67,13 @@
<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>See <a href="../classes/openvidu.html#setadvancedconfiguration">OpenVidu.setAdvancedConfiguration</a></p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
@ -95,15 +102,16 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="iceservers" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> ice<wbr>Servers</h3>
<div class="tsd-signature tsd-kind-icon">ice<wbr>Servers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">RTCIceServer</span><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">ice<wbr>Servers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">RTCIceServer</span><span class="tsd-signature-symbol">[]</span><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/OpenViduAdvancedConfiguration.ts#L23">OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts:23</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts#L27">OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts:27</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Array of <a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer">RTCIceServer</a> to be used by OpenVidu Browser instead of the default free ice server array (got from <a href="https://github.com/DamonOehlman/freeice">freeice</a> library)</p>
<p>Array of <a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer">RTCIceServer</a> to be used by OpenVidu Browser. By default OpenVidu will generate the required credentials to use the COTURN server hosted along OpenVidu Server
You can also set this property to string &#39;freeice&#39; to force the use of free STUN servers instead (got thanks to <a href="https://github.com/DamonOehlman/freeice">freeice</a> library).</p>
</div>
</div>
</section>
@ -113,7 +121,7 @@
<div class="tsd-signature tsd-kind-icon">publisher<wbr>Speaking<wbr>Events<wbr>Options<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</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/OpenViduAdvancedConfiguration.ts#L36">OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts:36</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts#L40">OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts:40</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -132,7 +140,7 @@
<div class="tsd-signature tsd-kind-icon">screen<wbr>Share<wbr>Chrome<wbr>Extension<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/OpenViduAdvancedConfiguration.ts#L29">OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts:29</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts#L33">OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts:33</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -211,9 +219,6 @@
<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>

View File

@ -341,9 +341,6 @@
<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>

View File

@ -215,9 +215,6 @@
<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>

View File

@ -240,9 +240,6 @@
<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>

View File

@ -228,9 +228,6 @@
<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>

View File

@ -40,7 +40,7 @@ export declare class Connection {
/**
* @hidden
*/
sendIceCandidate(candidate: any): void;
sendIceCandidate(candidate: RTCIceCandidate): void;
/**
* @hidden
*/

View File

@ -1 +1 @@
{"version":3,"file":"Connection.js","sourceRoot":"","sources":["../../src/OpenVidu/Connection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAGH,mCAAkC;AAOlC;;;GAGG;AACH;IAiCI;;OAEG;IACH,oBAAoB,OAAgB,EAAE,IAAwB;QAA1C,YAAO,GAAP,OAAO,CAAS;QARpC;;WAEG;QACH,aAAQ,GAAG,KAAK,CAAC;QAOb,IAAI,GAAG,GAAG,uBAAuB,CAAC;QAClC,IAAI,CAAC,CAAC,IAAI,EAAE;YACR,GAAG,IAAI,gCAAgC,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;SAC3D;aAAM;YACH,GAAG,IAAI,SAAS,CAAC;SACpB;QACD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAElB,IAAI,CAAC,OAAO,GAAG,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ACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACzB,CAAC;IAEL,iBAAC;AAAD,CAAC,AAvID,IAuIC;AAvIY,gCAAU"}

View File

@ -79,5 +79,5 @@ export declare class LocalRecorder {
* @returns A Promise (to which you can optionally subscribe to) that is resolved with the `http.responseText` from server if the operation was successful and rejected with the failed `http.status` if not:
*/
uploadAsMultipartfile(endpoint: string, headers?: any): Promise<any>;
private onStopDefault();
private onStopDefault;
}

File diff suppressed because one or more lines are too long

View File

@ -1,18 +0,0 @@
"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

@ -1 +0,0 @@
{"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

@ -1,81 +0,0 @@
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

@ -1,242 +0,0 @@
"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

@ -27,6 +27,14 @@ export declare class OpenVidu {
* @hidden
*/
recorder: boolean;
/**
* @hidden
*/
iceServers: RTCIceServer[];
/**
* @hidden
*/
role: string;
/**
* @hidden
*/
@ -152,8 +160,8 @@ export declare class OpenVidu {
* @hidden
*/
getRecorder(): boolean;
private disconnectCallback();
private reconnectingCallback();
private reconnectedCallback();
private isRoomAvailable();
private disconnectCallback;
private reconnectingCallback;
private reconnectedCallback;
private isRoomAvailable;
}

View File

@ -21,9 +21,9 @@ var Publisher_1 = require("./Publisher");
var Session_1 = require("./Session");
var OpenViduError_1 = require("../OpenViduInternal/Enums/OpenViduError");
var VideoInsertMode_1 = require("../OpenViduInternal/Enums/VideoInsertMode");
var RpcBuilder = require("../OpenViduInternal/KurentoUtils/kurento-jsonrpc");
var screenSharingAuto = require("../OpenViduInternal/ScreenSharing/Screen-Capturing-Auto");
var screenSharing = require("../OpenViduInternal/ScreenSharing/Screen-Capturing");
var RpcBuilder = require("../OpenViduInternal/KurentoUtils/kurento-jsonrpc");
var platform = require("platform");
/**
* Entrypoint of OpenVidu Browser library.
@ -328,38 +328,40 @@ var OpenVidu = /** @class */ (function () {
}
if (!!publisherProperties.videoSource && typeof publisherProperties.videoSource === 'string') {
if (publisherProperties.videoSource === 'screen') {
if (platform.name !== 'Chrome' && platform.name !== 'Firefox') {
if (platform.name !== 'Chrome' && platform.name.indexOf('Firefox') === -1) {
var error = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_SHARING_NOT_SUPPORTED, 'You can only screen share in desktop Chrome and Firefox. Detected browser: ' + platform.name);
console.error(error);
reject(error);
}
else {
if (!!_this.advancedConfiguration.screenShareChromeExtension) {
if (!!_this.advancedConfiguration.screenShareChromeExtension && !(platform.name.indexOf('Firefox') !== -1)) {
// Custom screen sharing extension for Chrome
var extensionId = _this.advancedConfiguration.screenShareChromeExtension.split('/').pop().trim();
screenSharing.getChromeExtensionStatus(extensionId, function (status) {
if (status === 'installed-enabled') {
screenSharing.getScreenConstraints(function (error, screenConstraints) {
if (!!error && error === 'permission-denied') {
var error_1 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED, 'You must allow access to one window of your desktop');
console.error(error_1);
reject(error_1);
}
else {
mediaConstraints.video = screenConstraints;
resolve(mediaConstraints);
}
});
screenSharing.getScreenConstraints(function (error, screenConstraints) {
if (!!error || !!screenConstraints.mandatory && screenConstraints.mandatory.chromeMediaSource === 'screen') {
if (error === 'permission-denied' || error === 'PermissionDeniedError') {
var error_1 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED, 'You must allow access to one window of your desktop');
console.error(error_1);
reject(error_1);
}
else {
var extensionId = _this.advancedConfiguration.screenShareChromeExtension.split('/').pop().trim();
screenSharing.getChromeExtensionStatus(extensionId, function (status) {
if (status === 'installed-disabled') {
var error_2 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_DISABLED, 'You must enable the screen extension');
console.error(error_2);
reject(error_2);
}
if (status === 'not-installed') {
var error_3 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, _this.advancedConfiguration.screenShareChromeExtension);
console.error(error_3);
reject(error_3);
}
});
}
}
if (status === 'installed-disabled') {
var error = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_DISABLED, 'You must enable the screen extension');
console.error(error);
reject(error);
}
if (status === 'not-installed') {
var error = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, _this.advancedConfiguration.screenShareChromeExtension);
console.error(error);
reject(error);
else {
mediaConstraints.video = screenConstraints;
resolve(mediaConstraints);
}
});
}
@ -368,20 +370,22 @@ var OpenVidu = /** @class */ (function () {
screenSharingAuto.getScreenId(function (error, sourceId, screenConstraints) {
if (!!error) {
if (error === 'not-installed') {
var error_2 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, 'https://chrome.google.com/webstore/detail/screen-capturing/ajhifddimkapgcifgcodmmfdlknahffk');
console.error(error_2);
reject(error_2);
}
else if (error === 'installed-disabled') {
var error_3 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_DISABLED, 'You must enable the screen extension');
console.error(error_3);
reject(error_3);
}
else if (error === 'permission-denied') {
var error_4 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED, 'You must allow access to one window of your desktop');
var extensionUrl = !!_this.advancedConfiguration.screenShareChromeExtension ? _this.advancedConfiguration.screenShareChromeExtension :
'https://chrome.google.com/webstore/detail/openvidu-screensharing/lfcgfepafnobdloecchnfaclibenjold';
var error_4 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, extensionUrl);
console.error(error_4);
reject(error_4);
}
else if (error === 'installed-disabled') {
var error_5 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_DISABLED, 'You must enable the screen extension');
console.error(error_5);
reject(error_5);
}
else if (error === 'permission-denied') {
var error_6 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED, 'You must allow access to one window of your desktop');
console.error(error_6);
reject(error_6);
}
}
else {
mediaConstraints.video = screenConstraints.video;
@ -423,7 +427,7 @@ var OpenVidu = /** @class */ (function () {
onreconnected: this.reconnectedCallback.bind(this)
},
rpc: {
requestTimeout: 15000,
requestTimeout: 10000,
participantJoined: this.session.onParticipantJoined.bind(this.session),
participantPublished: this.session.onParticipantPublished.bind(this.session),
participantUnpublished: this.session.onParticipantUnpublished.bind(this.session),

File diff suppressed because one or more lines are too long

View File

@ -66,6 +66,6 @@ export declare class Publisher extends StreamManager {
* @hidden
*/
reestablishStreamPlayingEvent(): void;
private setPermissionDialogTimer(waitTime);
private clearPermissionDialogTimer(startTime, waitTime);
private setPermissionDialogTimer;
private clearPermissionDialogTimer;
}

View File

@ -65,7 +65,9 @@ var Publisher = /** @class */ (function (_super) {
* @param value `true` to publish the audio stream, `false` to unpublish it
*/
Publisher.prototype.publishAudio = function (value) {
this.stream.getWebRtcPeer().audioEnabled = value;
this.stream.getMediaStream().getAudioTracks().forEach(function (track) {
track.enabled = value;
});
console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its audio stream');
};
/**
@ -73,7 +75,9 @@ var Publisher = /** @class */ (function (_super) {
* @param value `true` to publish the video stream, `false` to unpublish it
*/
Publisher.prototype.publishVideo = function (value) {
this.stream.getWebRtcPeer().videoEnabled = value;
this.stream.getMediaStream().getVideoTracks().forEach(function (track) {
track.enabled = value;
});
console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its video stream');
};
/**

File diff suppressed because one or more lines are too long

View File

@ -223,9 +223,9 @@ export declare class Session implements EventDispatcher {
* @hidden
*/
leave(forced: boolean, reason: string): void;
private connectAux(token);
private stringClientMetadata(metadata);
private getConnection(connectionId, errorMessage);
private getRemoteConnection(connectionId, errorMessage);
private processToken(token);
private connectAux;
private stringClientMetadata;
private getConnection;
private getRemoteConnection;
private processToken;
}

View File

@ -579,16 +579,17 @@ var Session = /** @class */ (function () {
var candidate = {
candidate: msg.candidate,
sdpMid: msg.sdpMid,
sdpMLineIndex: msg.sdpMLineIndex
sdpMLineIndex: msg.sdpMLineIndex,
toJSON: function () {
return { candidate: msg.candidate };
}
};
this.getConnection(msg.endpointName, 'Connection not found for endpoint ' + msg.endpointName + '. Ice candidate will be ignored: ' + candidate)
.then(function (connection) {
var stream = connection.stream;
stream.getWebRtcPeer().addIceCandidate(candidate, function (error) {
if (error) {
console.error('Error adding candidate for ' + stream.streamId
+ ' stream of endpoint ' + msg.endpointName + ': ' + error);
}
stream.getWebRtcPeer().addIceCandidate(candidate)["catch"](function (error) {
console.error('Error adding candidate for ' + stream.streamId
+ ' stream of endpoint ' + msg.endpointName + ': ' + error);
});
})["catch"](function (openViduError) {
console.error(openViduError);
@ -613,14 +614,16 @@ var Session = /** @class */ (function () {
* @hidden
*/
Session.prototype.onLostConnection = function () {
if (!this.connection) {
/*if (!this.connection) {
console.warn('Not connected to session: if you are not debugging, this is probably a certificate error');
var url = 'https://' + this.openvidu.getWsUri().split('wss://')[1].split('/openvidu')[0];
const url = 'https://' + this.openvidu.getWsUri().split('wss://')[1].split('/openvidu')[0];
if (window.confirm('If you are not debugging, this is probably a certificate error at \"' + url + '\"\n\nClick OK to navigate and accept it')) {
location.assign(url + '/accept-certificate');
}
return;
}
}*/
console.warn('Lost connection in Session ' + this.sessionId);
if (!!this.sessionId && !this.connection.disposed) {
this.leave(true, 'networkDisconnect');
@ -801,12 +804,28 @@ var Session = /** @class */ (function () {
this.sessionId = url.searchParams.get('sessionId');
var secret = url.searchParams.get('secret');
var recorder = url.searchParams.get('recorder');
var turnUsername = url.searchParams.get('turnUsername');
var turnCredential = url.searchParams.get('turnCredential');
var role = url.searchParams.get('role');
if (!!secret) {
this.openvidu.secret = secret;
}
if (!!recorder) {
this.openvidu.recorder = true;
}
if (!!turnUsername && !!turnCredential) {
var stunUrl = 'stun:' + url.hostname + ':3478';
var turnUrl1 = 'turn:' + url.hostname + ':3478';
var turnUrl2 = turnUrl1 + '?transport=tcp';
this.openvidu.iceServers = [
{ urls: [stunUrl] },
{ urls: [turnUrl1, turnUrl2], username: turnUsername, credential: turnCredential }
];
console.log('TURN temp credentials [' + turnUsername + ':' + turnCredential + ']');
}
if (!!role) {
this.openvidu.role = role;
}
this.openvidu.wsUri = 'wss://' + url.host + '/openvidu';
};
return Session;

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@ import { Session } from './Session';
import { StreamManager } from './StreamManager';
import { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions';
import { OutboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/OutboundStreamOptions';
import { WebRtcPeer } from '../OpenViduInternal/WebRtcPeer/WebRtcPeer';
import EventEmitter = require('wolfy87-eventemitter');
/**
* Represents each one of the media streams available in OpenVidu Server for certain session.
@ -90,7 +91,7 @@ export declare class Stream {
/**
* @hidden
*/
getWebRtcPeer(): any;
getWebRtcPeer(): WebRtcPeer;
/**
* @hidden
*/
@ -151,13 +152,26 @@ export declare class Stream {
* @hidden
*/
disableSpeakingEvents(): void;
private initWebRtcPeerSend();
private initWebRtcPeerReceive();
private processSdpAnswer(sdpAnswer);
private initWebRtcStats();
private stopWebRtcStats();
/**
* @hidden
*/
isLocal(): boolean;
/**
* @hidden
*/
getSelectedIceCandidate(): Promise<any>;
/**
* @hidden
*/
getRemoteIceCandidateList(): RTCIceCandidate[];
/**
* @hidden
*/
getLocalIceCandidateList(): RTCIceCandidate[];
private initWebRtcPeerSend;
private initWebRtcPeerReceive;
private remotePeerSuccesfullyEstablished;
private initWebRtcStats;
private stopWebRtcStats;
private getIceServersConf;
}

View File

@ -16,10 +16,11 @@
*
*/
exports.__esModule = true;
var WebRtcPeer_1 = require("../OpenViduInternal/WebRtcPeer/WebRtcPeer");
var WebRtcStats_1 = require("../OpenViduInternal/WebRtcStats/WebRtcStats");
var PublisherSpeakingEvent_1 = require("../OpenViduInternal/Events/PublisherSpeakingEvent");
var EventEmitter = require("wolfy87-eventemitter");
var kurentoUtils = require("../OpenViduInternal/KurentoUtils/kurento-utils-js");
var hark = require("hark");
/**
* 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
@ -59,17 +60,14 @@ var Stream = /** @class */ (function () {
this.outboundStreamOpts = options;
if (this.isSendVideo()) {
if (this.isSendScreen()) {
this.streamId = 'SCREEN';
this.typeOfVideo = 'SCREEN';
}
else {
this.streamId = 'CAMERA';
this.typeOfVideo = 'CAMERA';
}
this.frameRate = this.outboundStreamOpts.publisherProperties.frameRate;
}
else {
this.streamId = 'MICRO';
delete this.typeOfVideo;
}
this.hasAudio = this.isSendAudio();
@ -109,7 +107,7 @@ var Stream = /** @class */ (function () {
* @hidden
*/
Stream.prototype.getRTCPeerConnection = function () {
return this.webRtcPeer.peerConnection;
return this.webRtcPeer.pc;
};
/**
* @hidden
@ -228,7 +226,7 @@ var Stream = /** @class */ (function () {
var harkOptions = this.session.openvidu.advancedConfiguration.publisherSpeakingEventsOptions || {};
harkOptions.interval = (typeof harkOptions.interval === 'number') ? harkOptions.interval : 50;
harkOptions.threshold = (typeof harkOptions.threshold === 'number') ? harkOptions.threshold : -50;
this.speechEvent = kurentoUtils.WebRtcPeer.hark(this.mediaStream, harkOptions);
this.speechEvent = hark(this.mediaStream, harkOptions);
}
};
/**
@ -266,6 +264,35 @@ var Stream = /** @class */ (function () {
this.speechEvent.stop();
this.speechEvent = undefined;
};
/**
* @hidden
*/
Stream.prototype.isLocal = function () {
// inbound options undefined and outbound options defined
return (!this.inboundStreamOpts && !!this.outboundStreamOpts);
};
/**
* @hidden
*/
Stream.prototype.getSelectedIceCandidate = function () {
var _this = this;
return new Promise(function (resolve, reject) {
_this.webRtcStats.getSelectedIceCandidateInfo()
.then(function (report) { return resolve(report); })["catch"](function (error) { return reject(error); });
});
};
/**
* @hidden
*/
Stream.prototype.getRemoteIceCandidateList = function () {
return this.webRtcPeer.remoteCandidatesQueue;
};
/**
* @hidden
*/
Stream.prototype.getLocalIceCandidateList = function () {
return this.webRtcPeer.localCandidatesQueue;
};
/* Private methods */
Stream.prototype.initWebRtcPeerSend = function () {
var _this = this;
@ -275,15 +302,13 @@ var Stream = /** @class */ (function () {
video: _this.isSendVideo()
};
var options = {
videoStream: _this.mediaStream,
mediaStream: _this.mediaStream,
mediaConstraints: userMediaConstraints,
onicecandidate: _this.connection.sendIceCandidate.bind(_this.connection),
iceServers: _this.session.openvidu.advancedConfiguration.iceServers
iceServers: _this.getIceServersConf(),
simulcast: false
};
var successCallback = function (error, sdpOfferParam, wp) {
if (error) {
reject(new Error('(publish) SDP offer error: ' + JSON.stringify(error)));
}
var successCallback = function (sdpOfferParam) {
console.debug('Sending SDP offer to publish as '
+ _this.streamId, sdpOfferParam);
_this.session.openvidu.sendRequest('publishVideo', {
@ -298,15 +323,15 @@ var Stream = /** @class */ (function () {
reject('Error on publishVideo: ' + JSON.stringify(error));
}
else {
_this.processSdpAnswer(response.sdpAnswer)
_this.webRtcPeer.processAnswer(response.sdpAnswer)
.then(function () {
_this.streamId = response.id;
_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.remotePeerSuccesfullyEstablished();
}
_this.ee.emitEvent('stream-created-by-publisher');
_this.initWebRtcStats();
resolve();
})["catch"](function (error) {
reject(error);
@ -316,21 +341,16 @@ var Stream = /** @class */ (function () {
});
};
if (_this.displayMyRemote()) {
_this.webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function (err) {
if (err) {
reject(err);
}
_this.webRtcPeer.generateOffer(successCallback);
});
_this.webRtcPeer = new WebRtcPeer_1.WebRtcPeerSendrecv(options);
}
else {
_this.webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendonly(options, function (error) {
if (error) {
reject(error);
}
_this.webRtcPeer.generateOffer(successCallback);
});
_this.webRtcPeer = new WebRtcPeer_1.WebRtcPeerSendonly(options);
}
_this.webRtcPeer.generateOffer().then(function (offer) {
successCallback(offer);
})["catch"](function (error) {
reject(new Error('(publish) SDP offer error: ' + JSON.stringify(error)));
});
});
};
Stream.prototype.initWebRtcPeerReceive = function () {
@ -343,12 +363,11 @@ var Stream = /** @class */ (function () {
console.debug("'Session.subscribe(Stream)' called. Constraints of generate SDP offer", offerConstraints);
var options = {
onicecandidate: _this.connection.sendIceCandidate.bind(_this.connection),
mediaConstraints: offerConstraints
mediaConstraints: offerConstraints,
iceServers: _this.getIceServersConf(),
simulcast: false
};
var successCallback = function (error, sdpOfferParam, wp) {
if (error) {
reject(new Error('(subscribe) SDP offer error: ' + JSON.stringify(error)));
}
var successCallback = function (sdpOfferParam) {
console.debug('Sending SDP offer to subscribe to '
+ _this.streamId, sdpOfferParam);
_this.session.openvidu.sendRequest('receiveVideoFrom', {
@ -359,7 +378,9 @@ var Stream = /** @class */ (function () {
reject(new Error('Error on recvVideoFrom: ' + JSON.stringify(error)));
}
else {
_this.processSdpAnswer(response.sdpAnswer).then(function () {
_this.webRtcPeer.processAnswer(response.sdpAnswer).then(function () {
_this.remotePeerSuccesfullyEstablished();
_this.initWebRtcStats();
resolve();
})["catch"](function (error) {
reject(error);
@ -367,42 +388,24 @@ var Stream = /** @class */ (function () {
}
});
};
_this.webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerRecvonly(options, function (error) {
if (error) {
reject(error);
}
_this.webRtcPeer.generateOffer(successCallback);
_this.webRtcPeer = new WebRtcPeer_1.WebRtcPeerRecvonly(options);
_this.webRtcPeer.generateOffer()
.then(function (offer) {
successCallback(offer);
})["catch"](function (error) {
reject(new Error('(subscribe) SDP offer error: ' + JSON.stringify(error)));
});
});
};
Stream.prototype.processSdpAnswer = function (sdpAnswer) {
var _this = this;
return new Promise(function (resolve, reject) {
var answer = new RTCSessionDescription({
type: 'answer',
sdp: sdpAnswer
});
console.debug(_this.streamId + ': set peer connection with recvd SDP answer', sdpAnswer);
var streamId = _this.streamId;
var peerConnection = _this.webRtcPeer.peerConnection;
peerConnection.setRemoteDescription(answer, function () {
// Update remote MediaStream object except when local stream
if (!_this.isLocal() || _this.displayMyRemote()) {
_this.mediaStream = peerConnection.getRemoteStreams()[0];
console.debug('Peer remote stream', _this.mediaStream);
if (!!_this.mediaStream) {
_this.ee.emitEvent('mediastream-updated');
if (!!_this.mediaStream.getAudioTracks()[0] && _this.session.speakingEventsEnabled) {
_this.enableSpeakingEvents();
}
}
}
_this.initWebRtcStats();
resolve();
}, function (error) {
reject(new Error(_this.streamId + ': Error setting SDP to the peer connection: ' + JSON.stringify(error)));
});
});
Stream.prototype.remotePeerSuccesfullyEstablished = function () {
this.mediaStream = this.webRtcPeer.pc.getRemoteStreams()[0];
console.debug('Peer remote stream', this.mediaStream);
if (!!this.mediaStream) {
this.ee.emitEvent('mediastream-updated');
if (!this.displayMyRemote() && !!this.mediaStream.getAudioTracks()[0] && this.session.speakingEventsEnabled) {
this.enableSpeakingEvents();
}
}
};
Stream.prototype.initWebRtcStats = function () {
this.webRtcStats = new WebRtcStats_1.WebRtcStats(this);
@ -413,12 +416,20 @@ var Stream = /** @class */ (function () {
this.webRtcStats.stopWebRtcStats();
}
};
/**
* @hidden
*/
Stream.prototype.isLocal = function () {
// inbound options undefined and outbound options defined
return (!this.inboundStreamOpts && !!this.outboundStreamOpts);
Stream.prototype.getIceServersConf = function () {
var returnValue;
if (!!this.session.openvidu.advancedConfiguration.iceServers) {
returnValue = this.session.openvidu.advancedConfiguration.iceServers === 'freeice' ?
undefined :
this.session.openvidu.advancedConfiguration.iceServers;
}
else if (this.session.openvidu.iceServers) {
returnValue = this.session.openvidu.iceServers;
}
else {
returnValue = undefined;
}
return returnValue;
};
return Stream;
}());

File diff suppressed because one or more lines are too long

View File

@ -119,6 +119,6 @@ export declare class StreamManager implements EventDispatcher {
* @hidden
*/
updateMediaStream(mediaStream: MediaStream): void;
private pushNewStreamManagerVideo(streamManagerVideo);
private mirrorVideo(video);
private pushNewStreamManagerVideo;
private mirrorVideo;
}

File diff suppressed because one or more lines are too long

View File

@ -2,5 +2,5 @@ export declare enum LocalRecorderState {
READY = "READY",
RECORDING = "RECORDING",
PAUSED = "PAUSED",
FINISHED = "FINISHED",
FINISHED = "FINISHED"
}

View File

@ -64,7 +64,7 @@ export declare enum OpenViduErrorName {
/**
* _Not in use yet_
*/
GENERIC_ERROR = "GENERIC_ERROR",
GENERIC_ERROR = "GENERIC_ERROR"
}
/**
* Simple object to identify runtime errors on the client side

View File

@ -21,5 +21,5 @@ export declare enum VideoInsertMode {
/**
* Video replaces target element
*/
REPLACE = "REPLACE",
REPLACE = "REPLACE"
}

View File

@ -1,22 +0,0 @@
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

@ -1,54 +0,0 @@
"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

@ -1 +0,0 @@
{"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

@ -1,17 +0,0 @@
import { Event } from './Event';
import { Session } from '../..';
export declare class SessionDisconnectEvent extends Event {
/**
* - "disconnect"
* - "networkDisconnect"
*/
reason: string;
/**
* @hidden
*/
constructor(target: Session, reason: string);
/**
* @hidden
*/
callDefaultBehaviour(): void;
}

View File

@ -1,61 +0,0 @@
"use strict";
/*
* (C) Copyright 2017-2018 OpenVidu (http://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");
var SessionDisconnectEvent = /** @class */ (function (_super) {
__extends(SessionDisconnectEvent, _super);
/**
* @hidden
*/
function SessionDisconnectEvent(target, reason) {
var _this = _super.call(this, true, target, 'sessionDisconnected') || this;
_this.reason = reason;
return _this;
}
/**
* @hidden
*/
SessionDisconnectEvent.prototype.callDefaultBehaviour = function () {
console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Session'");
var session = this.target;
// Dispose and delete all remote Connections
for (var connectionId in session.remoteConnections) {
if (!!session.remoteConnections[connectionId].stream) {
session.remoteConnections[connectionId].stream.disposeWebRtcPeer();
session.remoteConnections[connectionId].stream.disposeMediaStream();
session.remoteConnections[connectionId].stream.removeVideo();
delete session.remoteStreamsCreated[session.remoteConnections[connectionId].stream.streamId];
session.remoteConnections[connectionId].dispose();
}
delete session.remoteConnections[connectionId];
}
};
return SessionDisconnectEvent;
}(Event_1.Event));
exports.SessionDisconnectEvent = SessionDisconnectEvent;
//# sourceMappingURL=SessionDisconnectEvent.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"SessionDisconnectEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/SessionDisconnectEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAGhC;IAA4C,0CAAK;IAQ7C;;OAEG;IACH,gCAAY,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,qDAAoB,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,GAAG,CAAC,CAAC,IAAM,YAAY,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;YACnD,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACnD,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;YACtD,CAAC;YACD,OAAO,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAEL,6BAAC;AAAD,CAAC,AAtCD,CAA4C,aAAK,GAsChD;AAtCY,wDAAsB"}

View File

@ -1,23 +0,0 @@
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

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

View File

@ -1,75 +0,0 @@
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

@ -1,261 +0,0 @@
"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

@ -1,8 +1,12 @@
/**
* See [[OpenVidu.setAdvancedConfiguration]]
*/
export interface OpenViduAdvancedConfiguration {
/**
* Array of [RTCIceServer](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer) to be used by OpenVidu Browser instead of the default free ice server array (got from [freeice](https://github.com/DamonOehlman/freeice) library)
* Array of [RTCIceServer](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer) to be used by OpenVidu Browser. By default OpenVidu will generate the required credentials to use the COTURN server hosted along OpenVidu Server
* You can also set this property to string 'freeice' to force the use of free STUN servers instead (got thanks to [freeice](https://github.com/DamonOehlman/freeice) library).
*/
iceServers?: RTCIceServer[];
iceServers?: RTCIceServer[] | string;
/**
* URL to a custom screen share extension for Chrome (always based on ours: [openvidu-screen-sharing-chrome-extension](https://github.com/OpenVidu/openvidu-screen-sharing-chrome-extension)) to be used instead of the default one.
* Must be something like this: `https://chrome.google.com/webstore/detail/YOUR_WEBSTORE_EXTENSION_NAME/YOUR_EXTENSION_ID`

View File

@ -1,4 +1,10 @@
window.getScreenId = function (callback) {
window.getScreenId = function (callback, custom_parameter) {
if (navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveOrOpenBlob || !!navigator.msSaveBlob)) {
callback({
video: true
});
return;
}
if (!!navigator.mozGetUserMedia) {
callback(null, 'firefox', {
video: {
@ -17,7 +23,7 @@ window.getScreenId = function (callback) {
callback('permission-denied');
}
else {
callback(null, event.data.chromeMediaSourceId, getScreenConstraints(null, event.data.chromeMediaSourceId));
callback(null, event.data.chromeMediaSourceId, getScreenConstraints(null, event.data.chromeMediaSourceId, event.data.canRequestAudioTrack));
}
window.removeEventListener('message', onIFrameCallback);
}
@ -26,9 +32,16 @@ window.getScreenId = function (callback) {
window.removeEventListener('message', onIFrameCallback);
}
}
setTimeout(postGetSourceIdMessage, 100);
if (!custom_parameter) {
setTimeout(postGetSourceIdMessage, 100);
}
else {
setTimeout(function () {
postGetSourceIdMessage(custom_parameter);
}, 100);
}
};
function getScreenConstraints(error, sourceId) {
function getScreenConstraints(error, sourceId, canRequestAudioTrack) {
var screen_constraints = {
audio: false,
video: {
@ -40,25 +53,64 @@ function getScreenConstraints(error, sourceId) {
optional: []
}
};
if (!!canRequestAudioTrack) {
screen_constraints.audio = {
mandatory: {
chromeMediaSource: error ? 'screen' : 'desktop',
},
optional: []
};
}
if (sourceId) {
screen_constraints.video.mandatory.chromeMediaSourceId = sourceId;
if (screen_constraints.audio && screen_constraints.audio.mandatory) {
screen_constraints.audio.mandatory.chromeMediaSourceId = sourceId;
}
}
return screen_constraints;
}
var iframe;
function postGetSourceIdMessage() {
function postGetSourceIdMessage(custom_parameter) {
if (!iframe) {
loadIFrame(postGetSourceIdMessage);
loadIFrame(function () {
postGetSourceIdMessage(custom_parameter);
});
return;
}
if (!iframe.isLoaded) {
setTimeout(postGetSourceIdMessage, 100);
setTimeout(function () {
postGetSourceIdMessage(custom_parameter);
}, 100);
return;
}
iframe.contentWindow.postMessage({
captureSourceId: true
}, '*');
if (!custom_parameter) {
iframe.contentWindow.postMessage({
captureSourceId: true
}, '*');
}
else if (!!custom_parameter.forEach) {
iframe.contentWindow.postMessage({
captureCustomSourceId: custom_parameter
}, '*');
}
else {
iframe.contentWindow.postMessage({
captureSourceIdWithAudio: true
}, '*');
}
}
var iframe;
window.getScreenConstraints = function (callback) {
loadIFrame(function () {
getScreenId(function (error, sourceId, screen_constraints) {
if (!screen_constraints) {
screen_constraints = {
video: true
};
}
callback(error, screen_constraints.video);
});
});
};
function loadIFrame(loadCallback) {
if (iframe) {
loadCallback();
@ -69,7 +121,7 @@ function loadIFrame(loadCallback) {
iframe.isLoaded = true;
loadCallback();
};
iframe.src = 'https://www.webrtc-experiment.com/getSourceId/';
iframe.src = 'https://openvidu.github.io/openvidu-screen-sharing-chrome-extension/';
iframe.style.display = 'none';
(document.body || document.documentElement).appendChild(iframe);
}
@ -84,8 +136,8 @@ window.getChromeExtensionStatus = function (callback) {
return;
if (event.data.chromeExtensionStatus) {
callback(event.data.chromeExtensionStatus);
window.removeEventListener('message', onIFrameCallback);
}
window.removeEventListener('message', onIFrameCallback);
}
setTimeout(postGetChromeExtensionStatusMessage, 100);
};

View File

@ -1 +1 @@
{"version":3,"file":"Screen-Capturing-Auto.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/ScreenSharing/Screen-Capturing-Auto.js"],"names":[],"mappings":"AAuBA,MAAM,CAAC,WAAW,GAAG,UAAU,QAAQ;IAInC,IAAI,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE;QAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE;YACtB,KAAK,EAAE;gBACH,cAAc,EAAE,QAAQ;gBACxB,WAAW,EAAE,QAAQ;aACxB;SACJ,CAAC,CAAC;QACH,OAAO;KACV;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAErD,0BAA0B,KAAK;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,OAAO;QAExB,IAAI,KAAK,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAChC,IAAI,KAAK,CAAC,IAAI,CAAC,mBAAmB,KAAK,uBAAuB,EAAE;gBAC5D,QAAQ,CAAC,mBAAmB,CAAC,CAAC;aACjC;iBAAM;gBACH,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,EAAE,oBAA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,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF;IACI,IAAI,CAAC,MAAM,EAAE;QACT,UAAU,CAAC,mCAAmC,CAAC,CAAC;QAChD,OAAO;KACV;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QAClB,UAAU,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAC;QACrD,OAAO;KACV;IAED,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC;QAC7B,wBAAwB,EAAE,IAAI;KACjC,EAAE,GAAG,CAAC,CAAC;AACZ,CAAC;AAED,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC"}
{"version":3,"file":"Screen-Capturing-Auto.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/ScreenSharing/Screen-Capturing-Auto.js"],"names":[],"mappings":"AAyBA,MAAM,CAAC,WAAW,GAAG,UAAU,QAAQ,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,gBAAgB,IAAI,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;QAExG,QAAQ,CAAC;YACL,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;QACH,OAAO;KACV;IAKD,IAAI,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE;QAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE;YACtB,KAAK,EAAE;gBACH,cAAc,EAAE,QAAQ;gBACxB,WAAW,EAAE,QAAQ;aACxB;SACJ,CAAC,CAAC;QACH,OAAO;KACV;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAErD,0BAA0B,KAAK;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,OAAO;QAExB,IAAI,KAAK,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAChC,IAAI,KAAK,CAAC,IAAI,CAAC,mBAAmB,KAAK,uB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AK,CAAC,IAAI,CAAC,qBAAqB,EAAE;YAClC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;YAG3C,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;SAC3D;IACL,CAAC;IAED,UAAU,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF;IACI,IAAI,CAAC,MAAM,EAAE;QACT,UAAU,CAAC,mCAAmC,CAAC,CAAC;QAChD,OAAO;KACV;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QAClB,UAAU,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAC;QACrD,OAAO;KACV;IAED,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC;QAC7B,wBAAwB,EAAE,IAAI;KACjC,EAAE,GAAG,CAAC,CAAC;AACZ,CAAC;AAED,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC"}

View File

@ -1,4 +1,5 @@
var chromeMediaSource = 'screen';
var sourceId;
var screenCallback;
var isFirefox = typeof window.InstallTrigger !== 'undefined';
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
@ -11,7 +12,6 @@ window.addEventListener('message', function (event) {
});
function onMessageCallback(data) {
if (data == 'PermissionDeniedError') {
chromeMediaSource = 'PermissionDeniedError';
if (screenCallback)
return screenCallback('PermissionDeniedError');
else
@ -21,21 +21,21 @@ function onMessageCallback(data) {
chromeMediaSource = 'desktop';
}
if (data.sourceId && screenCallback) {
screenCallback(sourceId = data.sourceId);
screenCallback(sourceId = data.sourceId, data.canRequestAudioTrack === true);
}
}
function isChromeExtensionAvailable(callback) {
if (isFirefox)
return callback(false);
if (!callback)
return;
if (chromeMediaSource == 'desktop')
return callback('isFirefox');
return callback(true);
window.postMessage('are-you-there', '*');
setTimeout(function () {
if (chromeMediaSource == 'screen') {
callback('unavailable');
callback(false);
}
else
callback('available');
callback(true);
}, 2000);
}
function getSourceId(callback) {
@ -46,12 +46,32 @@ function getSourceId(callback) {
screenCallback = callback;
window.postMessage('get-sourceId', '*');
}
function getCustomSourceId(arr, callback) {
if (!arr || !arr.forEach)
throw '"arr" parameter is mandatory and it must be an array.';
if (!callback)
throw '"callback" parameter is mandatory.';
if (sourceId)
return callback(sourceId);
screenCallback = callback;
window.postMessage({
'get-custom-sourceId': arr
}, '*');
}
function getSourceIdWithAudio(callback) {
if (!callback)
throw '"callback" parameter is mandatory.';
if (sourceId)
return callback(sourceId);
screenCallback = callback;
window.postMessage('audio-plus-tab', '*');
}
function getChromeExtensionStatus(extensionid, callback) {
if (isFirefox)
return callback('not-chrome');
if (arguments.length != 2) {
callback = extensionid;
extensionid = 'ajhifddimkapgcifgcodmmfdlknahffk';
extensionid = 'lfcgfepafnobdloecchnfaclibenjold';
}
var image = document.createElement('img');
image.src = 'chrome-extension://' + extensionid + '/icon.png';
@ -60,7 +80,7 @@ function getChromeExtensionStatus(extensionid, callback) {
window.postMessage('are-you-there', '*');
setTimeout(function () {
if (chromeMediaSource == 'screen') {
callback(extensionid == extensionid ? 'installed-enabled' : 'installed-disabled');
callback('installed-disabled');
}
else
callback('installed-enabled');
@ -70,7 +90,10 @@ function getChromeExtensionStatus(extensionid, callback) {
callback('not-installed');
};
}
function getScreenConstraints(callback) {
function getScreenConstraintsWithAudio(callback) {
getScreenConstraints(callback, true);
}
function getScreenConstraints(callback, captureSourceIdWithAudio) {
sourceId = '';
var firefoxScreenConstraints = {
mozMediaSource: 'window',
@ -87,10 +110,21 @@ function getScreenConstraints(callback) {
optional: []
};
if (chromeMediaSource == 'desktop' && !sourceId) {
getSourceId(function () {
screen_constraints.mandatory.chromeMediaSourceId = sourceId;
callback(sourceId == 'PermissionDeniedError' ? sourceId : null, screen_constraints);
});
if (captureSourceIdWithAudio) {
getSourceIdWithAudio(function (sourceId, canRequestAudioTrack) {
screen_constraints.mandatory.chromeMediaSourceId = sourceId;
if (canRequestAudioTrack) {
screen_constraints.canRequestAudioTrack = true;
}
callback(sourceId == 'PermissionDeniedError' ? sourceId : null, screen_constraints);
});
}
else {
getSourceId(function (sourceId) {
screen_constraints.mandatory.chromeMediaSourceId = sourceId;
callback(sourceId == 'PermissionDeniedError' ? sourceId : null, screen_constraints);
});
}
return;
}
if (chromeMediaSource == 'desktop') {
@ -99,6 +133,7 @@ function getScreenConstraints(callback) {
callback(null, screen_constraints);
}
exports.getScreenConstraints = getScreenConstraints;
exports.getScreenConstraintsWithAudio = getScreenConstraintsWithAudio;
exports.isChromeExtensionAvailable = isChromeExtensionAvailable;
exports.getChromeExtensionStatus = getChromeExtensionStatus;
exports.getSourceId = getSourceId;

View File

@ -1 +1 @@
{"version":3,"file":"Screen-Capturing.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/ScreenSharing/Screen-Capturing.js"],"names":[],"mappings":"AACA,IAAI,iBAAiB,GAAG,QAAQ,CAAC;AACjC,IAAI,cAAc,CAAC;AACnB,IAAI,SAAS,GAAG,OAAO,MAAM,CAAC,cAAc,KAAK,WAAW,CAAC;AAC7D,IAAI,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1E,IAAI,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC;AAE3C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAU,KAAK;IAC9C,IAAI,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE;QACxC,OAAO;KACV;IACD,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC;AAGH,2BAA2B,IAAI;IAE3B,IAAI,IAAI,IAAI,uBAAuB,EAAE;QACjC,iBAAiB,GAAG,uBAAuB,CAAC;QAC5C,IAAI,cAAc;YACd,OAAO,cAAc,CAAC,uBAAuB,CAAC,CA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AAI,iBAAiB,IAAI,SAAS,EAAE;QAChC,kBAAkB,CAAC,SAAS,CAAC,mBAAmB,GAAG,QAAQ,CAAC;KAC/D;IAGD,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;AACvC,CAAC;AAED,OAAO,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;AACpD,OAAO,CAAC,6BAA6B,GAAG,6BAA6B,CAAC;AACtE,OAAO,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;AAChE,OAAO,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;AAC5D,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC"}

View File

@ -1,3 +0,0 @@
import { PublisherProperties } from './Interfaces/Public/PublisherProperties';
export declare function solveIfCallback(methodName: string, completionHandler: ((error: Error | undefined) => void) | undefined, promise: Promise<any>): Promise<any>;
export declare function adaptPublisherProperties(properties: any): PublisherProperties;

View File

@ -1,79 +0,0 @@
"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");
function solveIfCallback(methodName, completionHandler, promise) {
if (!!completionHandler) {
console.warn("DEPRECATION WANING: In future releases the 'completionHandler' parameter will be removed from method '" + methodName + "'. Refactor your callbacks to Promise API (see https://openvidu.io/api/openvidu-browser/index.html)");
}
return new Promise(function (resolve, reject) {
if (!!completionHandler && typeof completionHandler === 'function') {
promise.then(function () {
completionHandler(undefined);
})["catch"](function (error) {
completionHandler(error);
});
}
else {
promise.then(function () {
return resolve();
})["catch"](function (error) {
return reject(error);
});
}
});
}
exports.solveIfCallback = solveIfCallback;
function adaptPublisherProperties(properties) {
if ('audio' in properties ||
'video' in properties ||
'audioActive' in properties ||
'videoActive' in properties ||
'quality' in properties ||
'screen' in properties) {
console.warn("DEPRECATION WANING: In future releases the properties passed to 'OpenVidu.initPublisher' method must match PublisherProperties interface (see https://openvidu.io/api/openvidu-browser/interfaces/publisherproperties.html)");
}
var scr = (typeof properties.screen !== 'undefined' && properties.screen === true);
var res = '';
if (typeof properties.quality === 'string') {
switch (properties.quality) {
case 'LOW':
res = '320x240';
break;
case 'MEDIUM':
res = '640x480';
break;
case 'HIGH':
res = '1280x720';
break;
}
}
var publisherProperties = {
audioSource: (typeof properties.audio !== 'undefined' && properties.audio === false) ? false : ((typeof properties.audioSource !== 'undefined') ? properties.audioSource : undefined),
frameRate: (typeof properties.frameRate !== 'undefined') ? properties.frameRate : undefined,
insertMode: (typeof properties.insertMode !== 'undefined') ? properties.insertMode : VideoInsertMode_1.VideoInsertMode.APPEND,
mirror: (typeof properties.mirror !== 'undefined') ? properties.mirror : true,
publishAudio: (typeof properties.audioActive !== 'undefined' && properties.audioActive === false) ? false : (typeof properties.publishAudio !== 'undefined') ? properties.publishAudio : true,
publishVideo: (typeof properties.videoActive !== 'undefined' && properties.videoActive === false) ? false : (typeof properties.publishVideo !== 'undefined') ? properties.publishVideo : true,
resolution: !!res ? res : ((typeof properties.resolution !== 'undefined') ? properties.resolution : '640x480'),
videoSource: scr ? 'screen' : ((typeof properties.video !== 'undefined' && properties.video === false) ? false : ((typeof properties.videoSource !== 'undefined') ? properties.videoSource : undefined))
};
return publisherProperties;
}
exports.adaptPublisherProperties = adaptPublisherProperties;
//# sourceMappingURL=VersionAdapter.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"VersionAdapter.js","sourceRoot":"","sources":["../../src/OpenViduInternal/VersionAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAGH,2DAA0D;AAE1D,yBAAgC,UAAkB,EAAE,iB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,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI;QAC7L,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,UAAU,CAAC,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9G,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,UAAU,CAAC,KAAK,KAAK,WAAW,IAAI,UAAU,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,UAAU,CAAC,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;KAC3M,CAAC;IAEF,OAAO,mBAAmB,CAAC;AAC/B,CAAC;AAzCD,4DAyCC"}

View File

@ -0,0 +1,63 @@
export interface WebRtcPeerConfiguration {
mediaConstraints: {
audio: boolean;
video: boolean;
};
simulcast: boolean;
onicecandidate: (event: any) => void;
iceServers: RTCIceServer[] | undefined;
mediaStream?: MediaStream;
mode?: string;
id?: string;
}
export declare class WebRtcPeer {
private configuration;
pc: RTCPeerConnection;
id: string;
remoteCandidatesQueue: RTCIceCandidate[];
localCandidatesQueue: RTCIceCandidate[];
iceCandidateList: RTCIceCandidate[];
private candidategatheringdone;
constructor(configuration: WebRtcPeerConfiguration);
/**
* This function creates the RTCPeerConnection object taking into account the
* properties received in the constructor. It starts the SDP negotiation
* process: generates the SDP offer and invokes the onsdpoffer callback. This
* callback is expected to send the SDP offer, in order to obtain an SDP
* answer from another peer.
*/
start(): Promise<any>;
/**
* This method frees the resources used by WebRtcPeer
*/
dispose(): void;
/**
* 1) Function that creates an offer, sets it as local description and returns the offer param
* to send to OpenVidu Server (will be the remote description of other peer)
*/
generateOffer(): Promise<string>;
/**
* 2) Function to invoke when a SDP offer is received. Sets it as remote description,
* generates and answer and returns it to send it to OpenVidu Server
*/
processOffer(sdpOffer: string): Promise<ConstrainDOMString>;
/**
* 3) Function invoked when a SDP answer is received. Final step in SDP negotiation, the peer
* just needs to set the answer as its remote description
*/
processAnswer(sdpAnswer: string): Promise<string>;
/**
* Callback function invoked when an ICE candidate is received
*/
addIceCandidate(iceCandidate: RTCIceCandidate): Promise<void>;
private streamStop;
}
export declare class WebRtcPeerRecvonly extends WebRtcPeer {
constructor(configuration: WebRtcPeerConfiguration);
}
export declare class WebRtcPeerSendonly extends WebRtcPeer {
constructor(configuration: WebRtcPeerConfiguration);
}
export declare class WebRtcPeerSendrecv extends WebRtcPeer {
constructor(configuration: WebRtcPeerConfiguration);
}

View File

@ -0,0 +1,264 @@
"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 freeice = require("freeice");
var uuid = require("uuid");
var platform = require("platform");
var WebRtcPeer = /** @class */ (function () {
function WebRtcPeer(configuration) {
var _this = this;
this.configuration = configuration;
this.remoteCandidatesQueue = [];
this.localCandidatesQueue = [];
this.iceCandidateList = [];
this.candidategatheringdone = false;
this.configuration.iceServers = (!!this.configuration.iceServers && this.configuration.iceServers.length > 0) ? this.configuration.iceServers : freeice();
this.pc = new RTCPeerConnection({ iceServers: this.configuration.iceServers });
this.id = !!configuration.id ? configuration.id : uuid.v4();
this.pc.onicecandidate = function (event) {
var candidate = event.candidate;
if (candidate) {
_this.localCandidatesQueue.push({ candidate: candidate.candidate });
_this.candidategatheringdone = false;
_this.configuration.onicecandidate(event.candidate);
}
else if (!_this.candidategatheringdone) {
_this.candidategatheringdone = true;
}
};
this.pc.onsignalingstatechange = function () {
if (_this.pc.signalingState === 'stable') {
while (_this.iceCandidateList.length > 0) {
_this.pc.addIceCandidate(_this.iceCandidateList.shift());
}
}
};
this.start();
}
/**
* This function creates the RTCPeerConnection object taking into account the
* properties received in the constructor. It starts the SDP negotiation
* process: generates the SDP offer and invokes the onsdpoffer callback. This
* callback is expected to send the SDP offer, in order to obtain an SDP
* answer from another peer.
*/
WebRtcPeer.prototype.start = function () {
var _this = this;
return new Promise(function (resolve, reject) {
if (_this.pc.signalingState === 'closed') {
reject('The peer connection object is in "closed" state. This is most likely due to an invocation of the dispose method before accepting in the dialogue');
}
if (!!_this.configuration.mediaStream) {
_this.pc.addStream(_this.configuration.mediaStream);
}
// [Hack] https://code.google.com/p/chromium/issues/detail?id=443558
if (_this.configuration.mode === 'sendonly' &&
(platform.name === 'Chrome' && platform.version.toString().substring(0, 2) === '39')) {
_this.configuration.mode = 'sendrecv';
}
resolve();
});
};
/**
* This method frees the resources used by WebRtcPeer
*/
WebRtcPeer.prototype.dispose = function () {
var _this = this;
console.debug('Disposing WebRtcPeer');
try {
if (this.pc) {
if (this.pc.signalingState === 'closed') {
return;
}
this.remoteCandidatesQueue = [];
this.localCandidatesQueue = [];
this.pc.getLocalStreams().forEach(function (str) {
_this.streamStop(str);
});
// FIXME This is not yet implemented in firefox
// if(videoStream) pc.removeStream(videoStream);
// if(audioStream) pc.removeStream(audioStream);
this.pc.close();
}
}
catch (err) {
console.warn('Exception disposing webrtc peer ' + err);
}
};
/**
* 1) Function that creates an offer, sets it as local description and returns the offer param
* to send to OpenVidu Server (will be the remote description of other peer)
*/
WebRtcPeer.prototype.generateOffer = function () {
var _this = this;
return new Promise(function (resolve, reject) {
var offerAudio, offerVideo = true;
// Constraints must have both blocks
if (!!_this.configuration.mediaConstraints) {
offerAudio = (typeof _this.configuration.mediaConstraints.audio === 'boolean') ?
_this.configuration.mediaConstraints.audio : true;
offerVideo = (typeof _this.configuration.mediaConstraints.video === 'boolean') ?
_this.configuration.mediaConstraints.video : true;
}
var constraints = {
offerToReceiveAudio: +(_this.configuration.mode !== 'sendonly' && offerAudio),
offerToReceiveVideo: +(_this.configuration.mode !== 'sendonly' && offerVideo)
};
console.debug('RTCPeerConnection constraints: ' + JSON.stringify(constraints));
_this.pc.createOffer(constraints).then(function (offer) {
console.debug('Created SDP offer');
return _this.pc.setLocalDescription(offer);
}).then(function () {
var localDescription = _this.pc.localDescription;
if (!!localDescription) {
console.debug('Local description set', localDescription.sdp);
resolve(localDescription.sdp);
}
else {
reject('Local description is not defined');
}
})["catch"](function (error) { return reject(error); });
});
};
/**
* 2) Function to invoke when a SDP offer is received. Sets it as remote description,
* generates and answer and returns it to send it to OpenVidu Server
*/
WebRtcPeer.prototype.processOffer = function (sdpOffer) {
var _this = this;
return new Promise(function (resolve, reject) {
var offer = {
type: 'offer',
sdp: sdpOffer
};
console.debug('SDP offer received, setting remote description');
if (_this.pc.signalingState === 'closed') {
reject('PeerConnection is closed');
}
_this.pc.setRemoteDescription(offer)
.then(function () {
return _this.pc.createAnswer();
}).then(function (answer) {
console.debug('Created SDP answer');
return _this.pc.setLocalDescription(answer);
}).then(function () {
var localDescription = _this.pc.localDescription;
if (!!localDescription) {
console.debug('Local description set', localDescription.sdp);
resolve(localDescription.sdp);
}
else {
reject('Local description is not defined');
}
})["catch"](function (error) { return reject(error); });
});
};
/**
* 3) Function invoked when a SDP answer is received. Final step in SDP negotiation, the peer
* just needs to set the answer as its remote description
*/
WebRtcPeer.prototype.processAnswer = function (sdpAnswer) {
var _this = this;
return new Promise(function (resolve, reject) {
var answer = {
type: 'answer',
sdp: sdpAnswer
};
console.debug('SDP answer received, setting remote description');
if (_this.pc.signalingState === 'closed') {
reject('RTCPeerConnection is closed');
}
_this.pc.setRemoteDescription(answer).then(function () { return resolve(); })["catch"](function (error) { return reject(error); });
});
};
/**
* Callback function invoked when an ICE candidate is received
*/
WebRtcPeer.prototype.addIceCandidate = function (iceCandidate) {
var _this = this;
return new Promise(function (resolve, reject) {
console.debug('Remote ICE candidate received', iceCandidate);
_this.remoteCandidatesQueue.push(iceCandidate);
switch (_this.pc.signalingState) {
case 'closed':
reject(new Error('PeerConnection object is closed'));
break;
case 'stable':
if (!!_this.pc.remoteDescription) {
_this.pc.addIceCandidate(iceCandidate).then(function () { return resolve(); })["catch"](function (error) { return reject(error); });
}
break;
default:
_this.iceCandidateList.push(iceCandidate);
resolve();
}
});
};
WebRtcPeer.prototype.streamStop = function (stream) {
stream.getTracks().forEach(function (track) {
track.stop();
stream.removeTrack(track);
});
};
return WebRtcPeer;
}());
exports.WebRtcPeer = WebRtcPeer;
var WebRtcPeerRecvonly = /** @class */ (function (_super) {
__extends(WebRtcPeerRecvonly, _super);
function WebRtcPeerRecvonly(configuration) {
var _this = this;
configuration.mode = 'recvonly';
_this = _super.call(this, configuration) || this;
return _this;
}
return WebRtcPeerRecvonly;
}(WebRtcPeer));
exports.WebRtcPeerRecvonly = WebRtcPeerRecvonly;
var WebRtcPeerSendonly = /** @class */ (function (_super) {
__extends(WebRtcPeerSendonly, _super);
function WebRtcPeerSendonly(configuration) {
var _this = this;
configuration.mode = 'sendonly';
_this = _super.call(this, configuration) || this;
return _this;
}
return WebRtcPeerSendonly;
}(WebRtcPeer));
exports.WebRtcPeerSendonly = WebRtcPeerSendonly;
var WebRtcPeerSendrecv = /** @class */ (function (_super) {
__extends(WebRtcPeerSendrecv, _super);
function WebRtcPeerSendrecv(configuration) {
var _this = this;
configuration.mode = 'sendrecv';
_this = _super.call(this, configuration) || this;
return _this;
}
return WebRtcPeerSendrecv;
}(WebRtcPeer));
exports.WebRtcPeerSendrecv = WebRtcPeerSendrecv;
//# sourceMappingURL=WebRtcPeer.js.map

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,8 @@ export declare class WebRtcStats {
isEnabled(): boolean;
initWebRtcStats(): void;
stopWebRtcStats(): void;
private sendStatsToHttpEndpoint(instrumentation);
private standardizeReport(response);
private getStatsAgnostic(pc, successCb, failureCb);
getSelectedIceCandidateInfo(): Promise<any>;
private sendStatsToHttpEndpoint;
private standardizeReport;
private getStatsAgnostic;
}

View File

@ -77,6 +77,70 @@ var WebRtcStats = /** @class */ (function () {
console.warn('WebRtc stats stopped for disposed stream ' + this.stream.streamId + ' of connection ' + this.stream.connection.connectionId);
}
};
WebRtcStats.prototype.getSelectedIceCandidateInfo = function () {
var _this = this;
return new Promise(function (resolve, reject) {
_this.getStatsAgnostic(_this.stream.getRTCPeerConnection(), function (stats) {
if ((platform.name.indexOf('Chrome') !== -1) || (platform.name.indexOf('Opera') !== -1)) {
var localCandidateId = void 0, remoteCandidateId = void 0, googCandidatePair = void 0;
var localCandidates = {};
var remoteCandidates = {};
for (var key in stats) {
var stat = stats[key];
if (stat.type === 'localcandidate') {
localCandidates[stat.id] = stat;
}
else if (stat.type === 'remotecandidate') {
remoteCandidates[stat.id] = stat;
}
else if (stat.type === 'googCandidatePair' && (stat.googActiveConnection === 'true')) {
googCandidatePair = stat;
localCandidateId = stat.localCandidateId;
remoteCandidateId = stat.remoteCandidateId;
}
}
var finalLocalCandidate_1 = localCandidates[localCandidateId];
if (!!finalLocalCandidate_1) {
var candList = _this.stream.getLocalIceCandidateList();
var cand = candList.filter(function (c) {
return (!!c.candidate &&
c.candidate.indexOf(finalLocalCandidate_1.ipAddress) >= 0 &&
c.candidate.indexOf(finalLocalCandidate_1.portNumber) >= 0 &&
c.candidate.indexOf(finalLocalCandidate_1.priority) >= 0);
});
finalLocalCandidate_1.raw = !!cand[0] ? cand[0].candidate : 'ERROR: Cannot find local candidate in list of sent ICE candidates';
}
else {
finalLocalCandidate_1 = 'ERROR: No active local ICE candidate. Probably ICE-TCP is being used';
}
var finalRemoteCandidate_1 = remoteCandidates[remoteCandidateId];
if (!!finalRemoteCandidate_1) {
var candList = _this.stream.getRemoteIceCandidateList();
var cand = candList.filter(function (c) {
return (!!c.candidate &&
c.candidate.indexOf(finalRemoteCandidate_1.ipAddress) >= 0 &&
c.candidate.indexOf(finalRemoteCandidate_1.portNumber) >= 0 &&
c.candidate.indexOf(finalRemoteCandidate_1.priority) >= 0);
});
finalRemoteCandidate_1.raw = !!cand[0] ? cand[0].candidate : 'ERROR: Cannot find remote candidate in list of received ICE candidates';
}
else {
finalRemoteCandidate_1 = 'ERROR: No active remote ICE candidate. Probably ICE-TCP is being used';
}
resolve({
googCandidatePair: googCandidatePair,
localCandidate: finalLocalCandidate_1,
remoteCandidate: finalRemoteCandidate_1
});
}
else {
reject('Selected ICE candidate info only available for Chrome');
}
}, function (error) {
reject(error);
});
});
};
WebRtcStats.prototype.sendStatsToHttpEndpoint = function (instrumentation) {
var _this = this;
var sendPost = function (json) {
@ -174,7 +238,7 @@ var WebRtcStats = /** @class */ (function () {
}
});
}
else if (platform.name.indexOf('Chrome') !== -1) {
else if ((platform.name.indexOf('Chrome') !== -1) || (platform.name.indexOf('Opera') !== -1)) {
for (var _i = 0, _a = Object.keys(stats); _i < _a.length; _i++) {
var key = _a[_i];
var stat = stats[key];
@ -256,10 +320,14 @@ var WebRtcStats = /** @class */ (function () {
this.getStatsAgnostic(this.stream.getRTCPeerConnection(), f, function (error) { console.log(error); });
};
WebRtcStats.prototype.standardizeReport = function (response) {
console.log(response);
var standardReport = {};
if (platform.name.indexOf('Firefox') !== -1) {
Object.keys(response).forEach(function (key) {
console.log(response[key]);
});
return response;
}
var standardReport = {};
response.result().forEach(function (report) {
var standardStats = {
id: report.id,
@ -277,12 +345,12 @@ var WebRtcStats = /** @class */ (function () {
var _this = this;
if (platform.name.indexOf('Firefox') !== -1) {
// getStats takes args in different order in Chrome and Firefox
return pc.getStats(null, function (response) {
return pc.getStats(null).then(function (response) {
var report = _this.standardizeReport(response);
successCb(report);
}, failureCb);
})["catch"](failureCb);
}
else if (platform.name.indexOf('Chrome') !== -1) {
else if ((platform.name.indexOf('Chrome') !== -1) || (platform.name.indexOf('Opera') !== -1)) {
// In Chrome, the first two arguments are reversed
return pc.getStats(function (response) {
var report = _this.standardizeReport(response);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +1,48 @@
{
"author": "OpenVidu",
"author": "OpenVidu",
"dependencies": {
"@types/node": "^9.6.7",
"@types/platform": "^1.3.1",
"freeice": "2.2.0",
"hark": "1.2.0",
"inherits": "2.0.3",
"merge": "1.2.0",
"platform": "^1.3.5",
"sdp-translator": "0.1.24",
"ua-parser-js": "0.7.18",
"uuid": "3.2.1",
"webrtc-adapter": "6.1.5",
"wolfy87-eventemitter": "5.2.4"
},
"description": "OpenVidu Browser",
"@types/node": "10.5.1",
"@types/platform": "1.3.1",
"freeice": "2.2.0",
"hark": "1.2.0",
"platform": "1.3.5",
"uuid": "3.3.2",
"webrtc-adapter": "6.2.1",
"wolfy87-eventemitter": "5.2.5"
},
"description": "OpenVidu Browser",
"devDependencies": {
"browserify": "16.1.1",
"grunt": "1.0.2",
"grunt-autoprefixer": "3.0.4",
"grunt-cli": "1.2.0",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-sass": "1.0.0",
"grunt-contrib-uglify": "3.3.0",
"grunt-contrib-watch": "1.1.0",
"grunt-string-replace": "1.3.1",
"grunt-ts": "6.0.0-beta.19",
"tsify": "4.0.0",
"tslint": "5.10.0",
"typedoc": "0.11.1",
"typedoc-plugin-sourcefile-url": "1.0.3",
"typescript": "2.8.3",
"uglify-js": "3.3.25"
},
"license": "Apache-2.0",
"main": "lib/index.js",
"name": "openvidu-browser",
"browserify": "16.2.2",
"grunt": "1.0.3",
"grunt-autoprefixer": "3.0.4",
"grunt-cli": "1.2.0",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-sass": "1.0.0",
"grunt-contrib-uglify": "3.3.0",
"grunt-contrib-watch": "1.1.0",
"grunt-string-replace": "1.3.1",
"grunt-ts": "6.0.0-beta.20",
"tsify": "4.0.0",
"tslint": "5.10.0",
"typedoc": "0.11.1",
"typedoc-plugin-sourcefile-url": "1.0.3",
"typescript": "2.9.2",
"uglify-js": "3.4.3"
},
"license": "Apache-2.0",
"main": "lib/index.js",
"name": "openvidu-browser",
"repository": {
"type": "git",
"type": "git",
"url": "git://github.com/OpenVidu/openvidu"
},
},
"scripts": {
"browserify": "VERSION=${VERSION:-}; cd src && browserify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v",
"browserify-prod": "VERSION=${VERSION:-}; cd src && browserify --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | uglifyjs --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js",
"build": "cd src/OpenVidu && tsc && cd ../.. && tsc --declaration src/index.ts --outDir ./lib --sourceMap --lib dom,es5,es2015.promise,scripthost",
"docs": "grunt --gruntfile config/typedoc/custom-theme/gruntfile.js && typedoc --options ./config/typedoc/typedoc.js --out ./docs ./src && rm -rf ../../openvidu.io/api/openvidu-browser/* && cp -R ./docs/. ../../openvidu.io/api/openvidu-browser",
"browserify": "VERSION=${VERSION:-}; cd src && browserify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v",
"browserify-prod": "VERSION=${VERSION:-}; cd src && browserify --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | uglifyjs --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js",
"build": "cd src/OpenVidu && tsc && cd ../.. && tsc --declaration src/index.ts --outDir ./lib --sourceMap --lib dom,es5,es2015.promise,scripthost",
"docs": "grunt --gruntfile config/typedoc/custom-theme/gruntfile.js && typedoc --options ./config/typedoc/typedoc.js --out ./docs ./src && rm -rf ../../openvidu.io/api/openvidu-browser/* && cp -R ./docs/. ../../openvidu.io/api/openvidu-browser",
"test": "echo \"Error: no test specified\" && exit 1"
},
"types": "lib/index.d.ts",
"version": "2.1.0"
},
"types": "lib/index.d.ts",
"version": "2.2.0"
}

View File

@ -19,7 +19,6 @@ import { Session } from './Session';
import { Stream } from './Stream';
import { ConnectionOptions } from '../OpenViduInternal/Interfaces/Private/ConnectionOptions';
import { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions';
import { OutboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/OutboundStreamOptions';
import { StreamOptionsServer } from '../OpenViduInternal/Interfaces/Private/StreamOptionsServer';
@ -95,7 +94,7 @@ export class Connection {
/**
* @hidden
*/
sendIceCandidate(candidate): void {
sendIceCandidate(candidate: RTCIceCandidate): void {
console.debug((!!this.stream.outboundStreamOpts ? 'Local' : 'Remote'), 'candidate for',
this.connectionId, JSON.stringify(candidate));
@ -124,10 +123,13 @@ export class Connection {
const streamOptions: InboundStreamOptions = {
id: opts.id,
connection: this,
hasAudio: opts.hasAudio,
hasVideo: opts.hasVideo,
audioActive: opts.audioActive,
videoActive: opts.videoActive,
typeOfVideo: opts.typeOfVideo,
frameRate: opts.frameRate,
recvAudio: opts.audioActive,
recvVideo: opts.videoActive,
typeOfVideo: opts.typeOfVideo
videoDimensions: !!opts.videoDimensions ? JSON.parse(opts.videoDimensions) : undefined
};
const stream = new Stream(this.session, streamOptions);

View File

@ -19,16 +19,17 @@ import { LocalRecorder } from './LocalRecorder';
import { Publisher } from './Publisher';
import { Session } from './Session';
import { Stream } from './Stream';
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent';
import { Device } from '../OpenViduInternal/Interfaces/Public/Device';
import { OpenViduAdvancedConfiguration } from '../OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration';
import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/PublisherProperties';
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import * as RpcBuilder from '../OpenViduInternal/KurentoUtils/kurento-jsonrpc';
import * as screenSharingAuto from '../OpenViduInternal/ScreenSharing/Screen-Capturing-Auto';
import * as screenSharing from '../OpenViduInternal/ScreenSharing/Screen-Capturing';
import RpcBuilder = require('../OpenViduInternal/KurentoUtils/kurento-jsonrpc');
import platform = require('platform');
@ -44,6 +45,10 @@ export class OpenVidu {
* @hidden
*/
session: Session;
/**
* @hidden
*/
publishers: Publisher[] = [];
/**
* @hidden
*/
@ -56,6 +61,14 @@ export class OpenVidu {
* @hidden
*/
recorder = false;
/**
* @hidden
*/
iceServers: RTCIceServer[];
/**
* @hidden
*/
role: string;
/**
* @hidden
*/
@ -63,6 +76,63 @@ export class OpenVidu {
constructor() {
console.info("'OpenVidu' initialized");
if (platform.name!!.toLowerCase().indexOf('mobile') !== -1) {
// Listen to orientationchange only on mobile browsers
(<any>window).onorientationchange = () => {
this.publishers.forEach(publisher => {
if (!!publisher.stream && !!publisher.stream.hasVideo && !!publisher.stream.streamManager.videos[0]) {
let attempts = 0;
const oldWidth = publisher.stream.videoDimensions.width;
const oldHeight = publisher.stream.videoDimensions.height;
// New resolution got from different places for Chrome and Firefox. Chrome needs a videoWidth and videoHeight of a videoElement.
// Firefox needs getSettings from the videoTrack
let firefoxSettings = publisher.stream.getMediaStream().getVideoTracks()[0].getSettings();
let newWidth = (platform.name!!.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings.width : publisher.videoReference.videoWidth;
let newHeight = (platform.name!!.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings.height : publisher.videoReference.videoHeight;
const repeatUntilChange = setInterval(() => {
firefoxSettings = publisher.stream.getMediaStream().getVideoTracks()[0].getSettings();
newWidth = (platform.name!!.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings.width : publisher.videoReference.videoWidth;
newHeight = (platform.name!!.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings.height : publisher.videoReference.videoHeight;
sendStreamPropertyChangedEvent(oldWidth, oldHeight, newWidth, newHeight);
}, 100);
const sendStreamPropertyChangedEvent = (oldWidth, oldHeight, newWidth, newHeight) => {
attempts++;
if (attempts > 4) {
clearTimeout(repeatUntilChange);
}
if (newWidth !== oldWidth || newHeight !== oldHeight) {
publisher.stream.videoDimensions = {
width: newWidth || 0,
height: newHeight || 0
};
this.sendRequest(
'streamPropertyChanged',
{
streamId: publisher.stream.streamId,
property: 'videoDimensions',
newValue: JSON.stringify(publisher.stream.videoDimensions),
reason: 'deviceRotated'
},
(error, response) => {
if (error) {
console.error("Error sending 'streamPropertyChanged' event", error);
} else {
this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this.session, publisher.stream, 'videoDimensions', publisher.stream.videoDimensions, { width: oldWidth, height: oldHeight }, 'deviceRotated')]);
publisher.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(publisher, publisher.stream, 'videoDimensions', publisher.stream.videoDimensions, { width: oldWidth, height: oldHeight }, 'deviceRotated')]);
}
});
clearTimeout(repeatUntilChange);
}
};
}
});
};
}
}
@ -155,6 +225,7 @@ export class OpenVidu {
publisher.emitEvent('accessDenied', []);
});
this.publishers.push(publisher);
return publisher;
}
@ -396,39 +467,40 @@ export class OpenVidu {
if (publisherProperties.videoSource === 'screen') {
if (platform.name !== 'Chrome' && platform.name !== 'Firefox') {
if (platform.name !== 'Chrome' && platform.name!.indexOf('Firefox') === -1) {
const error = new OpenViduError(OpenViduErrorName.SCREEN_SHARING_NOT_SUPPORTED, 'You can only screen share in desktop Chrome and Firefox. Detected browser: ' + platform.name);
console.error(error);
reject(error);
} else {
if (!!this.advancedConfiguration.screenShareChromeExtension) {
if (!!this.advancedConfiguration.screenShareChromeExtension && !(platform.name!.indexOf('Firefox') !== -1)) {
// Custom screen sharing extension for Chrome
const extensionId = this.advancedConfiguration.screenShareChromeExtension.split('/').pop()!!.trim();
screenSharing.getChromeExtensionStatus(extensionId, (status) => {
if (status === 'installed-enabled') {
screenSharing.getScreenConstraints((error, screenConstraints) => {
if (!!error && error === 'permission-denied') {
const error = new OpenViduError(OpenViduErrorName.SCREEN_CAPTURE_DENIED, 'You must allow access to one window of your desktop');
console.error(error);
reject(error);
} else {
mediaConstraints.video = screenConstraints;
resolve(mediaConstraints);
}
});
}
if (status === 'installed-disabled') {
const error = new OpenViduError(OpenViduErrorName.SCREEN_EXTENSION_DISABLED, 'You must enable the screen extension');
console.error(error);
reject(error);
}
if (status === 'not-installed') {
const error = new OpenViduError(OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, (<string>this.advancedConfiguration.screenShareChromeExtension));
console.error(error);
reject(error);
screenSharing.getScreenConstraints((error, screenConstraints) => {
if (!!error || !!screenConstraints.mandatory && screenConstraints.mandatory.chromeMediaSource === 'screen') {
if (error === 'permission-denied' || error === 'PermissionDeniedError') {
const error = new OpenViduError(OpenViduErrorName.SCREEN_CAPTURE_DENIED, 'You must allow access to one window of your desktop');
console.error(error);
reject(error);
} else {
const extensionId = this.advancedConfiguration.screenShareChromeExtension!.split('/').pop()!!.trim();
screenSharing.getChromeExtensionStatus(extensionId, (status) => {
if (status === 'installed-disabled') {
const error = new OpenViduError(OpenViduErrorName.SCREEN_EXTENSION_DISABLED, 'You must enable the screen extension');
console.error(error);
reject(error);
}
if (status === 'not-installed') {
const error = new OpenViduError(OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, (<string>this.advancedConfiguration.screenShareChromeExtension));
console.error(error);
reject(error);
}
});
}
} else {
mediaConstraints.video = screenConstraints;
resolve(mediaConstraints);
}
});
} else {
@ -438,7 +510,9 @@ export class OpenVidu {
screenSharingAuto.getScreenId((error, sourceId, screenConstraints) => {
if (!!error) {
if (error === 'not-installed') {
const error = new OpenViduError(OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, 'https://chrome.google.com/webstore/detail/screen-capturing/ajhifddimkapgcifgcodmmfdlknahffk');
const extensionUrl = !!this.advancedConfiguration.screenShareChromeExtension ? this.advancedConfiguration.screenShareChromeExtension :
'https://chrome.google.com/webstore/detail/openvidu-screensharing/lfcgfepafnobdloecchnfaclibenjold';
const error = new OpenViduError(OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, extensionUrl);
console.error(error);
reject(error);
} else if (error === 'installed-disabled') {
@ -490,7 +564,7 @@ export class OpenVidu {
onreconnected: this.reconnectedCallback.bind(this)
},
rpc: {
requestTimeout: 15000,
requestTimeout: 10000,
participantJoined: this.session.onParticipantJoined.bind(this.session),
participantPublished: this.session.onParticipantPublished.bind(this.session),
participantUnpublished: this.session.onParticipantUnpublished.bind(this.session),
@ -499,6 +573,7 @@ export class OpenVidu {
recordingStarted: this.session.onRecordingStarted.bind(this.session),
recordingStopped: this.session.onRecordingStopped.bind(this.session),
sendMessage: this.session.onNewMessage.bind(this.session),
streamPropertyChanged: this.session.onStreamPropertyChanged.bind(this.session),
iceCandidate: this.session.recvIceCandidate.bind(this.session),
mediaError: this.session.onMediaError.bind(this.session)
}

View File

@ -21,14 +21,15 @@ import { Stream } from './Stream';
import { StreamManager } from './StreamManager';
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/PublisherProperties';
import { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions';
import { OutboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/OutboundStreamOptions';
import { Event } from '../OpenViduInternal/Events/Event';
import { StreamEvent } from '../OpenViduInternal/Events/StreamEvent';
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent';
import { VideoElementEvent } from '../OpenViduInternal/Events/VideoElementEvent';
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import platform = require('platform');
/**
* Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method
@ -54,43 +55,121 @@ export class Publisher extends StreamManager {
private properties: PublisherProperties;
private permissionDialogTimeout: NodeJS.Timer;
/**
* hidden
*/
openvidu: OpenVidu;
/**
* @hidden
*/
constructor(targEl: string | HTMLElement, properties: PublisherProperties, private openvidu: OpenVidu) {
videoReference: HTMLVideoElement;
/**
* @hidden
*/
screenShareResizeInterval: NodeJS.Timer;
/**
* @hidden
*/
constructor(targEl: string | HTMLElement, properties: PublisherProperties, openvidu: OpenVidu) {
super(new Stream((!!openvidu.session) ? openvidu.session : new Session(openvidu), { publisherProperties: properties, mediaConstraints: {} }), targEl);
this.properties = properties;
this.openvidu = openvidu;
this.stream.ee.on('local-stream-destroyed-by-disconnect', (reason: string) => {
const streamEvent = new StreamEvent(true, this, 'streamDestroyed', this.stream, reason);
this.ee.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehaviour();
this.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehavior();
});
}
/**
* Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect
*
* #### Events dispatched
*
* The [[Session]] object of the local participant will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"audioActive"` and `reason` set to `"publishAudio"`
* The [[Publisher]] object of the local participant will also dispatch the exact same event
*
* The [[Session]] object of every other participant connected to the session will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"audioActive"` and `reason` set to `"publishAudio"`
* The respective [[Subscriber]] object of every other participant receiving this Publisher's stream will also dispatch the exact same event
*
* See [[StreamPropertyChangedEvent]] to learn more.
*
* @param value `true` to publish the audio stream, `false` to unpublish it
*/
publishAudio(value: boolean): void {
this.stream.getWebRtcPeer().audioEnabled = value;
console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its audio stream');
if (this.stream.audioActive !== value) {
this.stream.getMediaStream().getAudioTracks().forEach((track) => {
track.enabled = value;
});
this.session.openvidu.sendRequest(
'streamPropertyChanged',
{
streamId: this.stream.streamId,
property: 'audioActive',
newValue: value,
reason: 'publishAudio'
},
(error, response) => {
if (error) {
console.error("Error sending 'streamPropertyChanged' event", error);
} else {
this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this.session, this.stream, 'audioActive', value, !value, 'publishAudio')]);
this.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this, this.stream, 'audioActive', value, !value, 'publishAudio')]);
}
});
this.stream.audioActive = value;
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
*
* #### Events dispatched
*
* The [[Session]] object of the local participant will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"videoActive"` and `reason` set to `"publishVideo"`
* The [[Publisher]] object of the local participant will also dispatch the exact same event
*
* The [[Session]] object of every other participant connected to the session will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"videoActive"` and `reason` set to `"publishVideo"`
* The respective [[Subscriber]] object of every other participant receiving this Publisher's stream will also dispatch the exact same event
*
* See [[StreamPropertyChangedEvent]] to learn more.
*
* @param value `true` to publish the video stream, `false` to unpublish it
*/
publishVideo(value: boolean): void {
this.stream.getWebRtcPeer().videoEnabled = value;
console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its video stream');
if (this.stream.videoActive !== value) {
this.stream.getMediaStream().getVideoTracks().forEach((track) => {
track.enabled = value;
});
this.session.openvidu.sendRequest(
'streamPropertyChanged',
{
streamId: this.stream.streamId,
property: 'videoActive',
newValue: value,
reason: 'publishVideo'
},
(error, response) => {
if (error) {
console.error("Error sending 'streamPropertyChanged' event", error);
} else {
this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this.session, this.stream, 'videoActive', value, !value, 'publishVideo')]);
this.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this, this.stream, 'videoActive', value, !value, 'publishVideo')]);
}
});
this.stream.videoActive = value;
console.info("'Publisher' has " + (value ? 'published' : 'unpublished') + ' its video stream');
}
}
/**
* 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.
* Call this method before [[Session.publish]] if you prefer to subscribe to your Publisher's remote stream instead of using the local stream, as any other user would do.
*/
subscribeToRemote(value?: boolean): void {
value = (value !== undefined) ? value : true;
@ -106,10 +185,10 @@ export class Publisher extends StreamManager {
super.on(type, handler);
if (type === 'streamCreated') {
if (!!this.stream && this.stream.isLocalStreamPublished) {
this.ee.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
this.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
} else {
this.stream.ee.on('stream-created-by-publisher', () => {
this.ee.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
this.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
});
}
}
@ -119,17 +198,17 @@ export class Publisher extends StreamManager {
this.videos[0].video.paused === false &&
this.videos[0].video.ended === false &&
this.videos[0].video.readyState === 4) {
this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent(this.videos[0].video, this, 'remoteVideoPlaying')]);
this.emitEvent('remoteVideoPlaying', [new VideoElementEvent(this.videos[0].video, this, 'remoteVideoPlaying')]);
}
}
if (type === 'accessAllowed') {
if (this.accessAllowed) {
this.ee.emitEvent('accessAllowed');
this.emitEvent('accessAllowed', []);
}
}
if (type === 'accessDenied') {
if (this.accessDenied) {
this.ee.emitEvent('accessDenied');
this.emitEvent('accessDenied', []);
}
}
return this;
@ -143,10 +222,10 @@ export class Publisher extends StreamManager {
super.once(type, handler);
if (type === 'streamCreated') {
if (!!this.stream && this.stream.isLocalStreamPublished) {
this.ee.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
this.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
} else {
this.stream.ee.once('stream-created-by-publisher', () => {
this.ee.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
this.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
});
}
}
@ -156,17 +235,17 @@ export class Publisher extends StreamManager {
this.videos[0].video.paused === false &&
this.videos[0].video.ended === false &&
this.videos[0].video.readyState === 4) {
this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent(this.videos[0].video, this, 'remoteVideoPlaying')]);
this.emitEvent('remoteVideoPlaying', [new VideoElementEvent(this.videos[0].video, this, 'remoteVideoPlaying')]);
}
}
if (type === 'accessAllowed') {
if (this.accessAllowed) {
this.ee.emitEvent('accessAllowed');
this.emitEvent('accessAllowed', []);
}
}
if (type === 'accessDenied') {
if (this.accessDenied) {
this.ee.emitEvent('accessDenied');
this.emitEvent('accessDenied', []);
}
}
return this;
@ -215,14 +294,79 @@ export class Publisher extends StreamManager {
// 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, <VideoInsertMode>this.properties.insertMode);
}
delete this.firstVideoElement;
if (this.stream.isSendVideo()) {
if (!this.stream.isSendScreen()) {
// With no screen share, video dimension can be set directly from MediaStream (getSettings)
// Orientation must be checked for mobile devices (width and height are reversed)
const { width, height } = mediaStream.getVideoTracks()[0].getSettings();
if (platform.name!!.toLowerCase().indexOf('mobile') !== -1 && (window.innerHeight > window.innerWidth)) {
// Mobile portrait mode
this.stream.videoDimensions = {
width: height || 0,
height: width || 0
};
} else {
this.stream.videoDimensions = {
width: width || 0,
height: height || 0
};
}
this.stream.isLocalStreamReadyToPublish = true;
this.stream.ee.emitEvent('stream-ready-to-publish', []);
} else {
// With screen share, video dimension must be got from a video element (onloadedmetadata event)
this.videoReference = document.createElement('video');
this.videoReference.srcObject = mediaStream;
this.videoReference.onloadedmetadata = () => {
this.stream.videoDimensions = {
width: this.videoReference.videoWidth,
height: this.videoReference.videoHeight
};
this.screenShareResizeInterval = setInterval(() => {
const firefoxSettings = mediaStream.getVideoTracks()[0].getSettings();
const newWidth = (platform.name === 'Chrome') ? this.videoReference.videoWidth : firefoxSettings.width;
const newHeight = (platform.name === 'Chrome') ? this.videoReference.videoHeight : firefoxSettings.height;
if (this.stream.isLocalStreamPublished &&
(newWidth !== this.stream.videoDimensions.width ||
newHeight !== this.stream.videoDimensions.height)) {
const oldValue = { width: this.stream.videoDimensions.width, height: this.stream.videoDimensions.height };
this.stream.videoDimensions = {
width: newWidth || 0,
height: newHeight || 0
};
this.session.openvidu.sendRequest(
'streamPropertyChanged',
{
streamId: this.stream.streamId,
property: 'videoDimensions',
newValue: JSON.stringify(this.stream.videoDimensions),
reason: 'screenResized'
},
(error, response) => {
if (error) {
console.error("Error sending 'streamPropertyChanged' event", error);
} else {
this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this.session, this.stream, 'videoDimensions', this.stream.videoDimensions, oldValue, 'screenResized')]);
this.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this, this.stream, 'videoDimensions', this.stream.videoDimensions, oldValue, 'screenResized')]);
}
});
}
}, 500);
this.stream.isLocalStreamReadyToPublish = true;
this.stream.ee.emitEvent('stream-ready-to-publish', []);
};
}
} else {
this.stream.isLocalStreamReadyToPublish = true;
this.stream.ee.emitEvent('stream-ready-to-publish', []);
}
resolve();
};
@ -369,13 +513,6 @@ export class Publisher extends StreamManager {
this.stream.session = session;
}
/**
* @hidden
*/
emitEvent(type: string, eventArray: any[]): void {
this.ee.emitEvent(type, eventArray);
}
/**
* @hidden
*/
@ -390,7 +527,7 @@ export class Publisher extends StreamManager {
private setPermissionDialogTimer(waitTime: number): void {
this.permissionDialogTimeout = setTimeout(() => {
this.ee.emitEvent('accessDialogOpened', []);
this.emitEvent('accessDialogOpened', []);
}, waitTime);
}
@ -398,7 +535,7 @@ export class Publisher extends StreamManager {
clearTimeout(this.permissionDialogTimeout);
if ((Date.now() - startTime) > waitTime) {
// Permission dialog was shown and now is closed
this.ee.emitEvent('accessDialogClosed', []);
this.emitEvent('accessDialogClosed', []);
}
}

View File

@ -21,6 +21,7 @@ import { Publisher } from './Publisher';
import { Stream } from './Stream';
import { StreamManager } from './StreamManager';
import { Subscriber } from './Subscriber';
import { Capabilities } from '../OpenViduInternal/Interfaces/Public/Capabilities';
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
import { SignalOptions } from '../OpenViduInternal/Interfaces/Public/SignalOptions';
import { SubscriberProperties } from '../OpenViduInternal/Interfaces/Public/SubscriberProperties';
@ -33,6 +34,7 @@ import { RecordingEvent } from '../OpenViduInternal/Events/RecordingEvent';
import { SessionDisconnectedEvent } from '../OpenViduInternal/Events/SessionDisconnectedEvent';
import { SignalEvent } from '../OpenViduInternal/Events/SignalEvent';
import { StreamEvent } from '../OpenViduInternal/Events/StreamEvent';
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent';
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
@ -62,6 +64,12 @@ export class Session implements EventDispatcher {
*/
streamManagers: StreamManager[] = [];
/**
* Object defining the methods that the client is able to call. These are defined by the role of the token used to connect to the Session.
* This object is only defined after [[Session.connect]] has been successfully resolved
*/
capabilities: Capabilities;
// This map is only used to avoid race condition between 'joinRoom' response and 'onParticipantPublished' notification
/**
* @hidden
@ -156,20 +164,20 @@ export class Session implements EventDispatcher {
* 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 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)).
* 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.
* Call `event.preventDefault()` upon event `sessionDisconnected` to avoid this behavior 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.
* 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)).
* 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 (to do so it is a mandatory requirement to call `Session.unpublish()`
* Call `event.preventDefault()` upon 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.
* This event will automatically unsubscribe the 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](/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 yourself.
* Call `event.preventDefault()` upon event `streamDestroyed` to avoid this default behavior 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.
@ -362,13 +370,13 @@ export class Session implements EventDispatcher {
* This event will automatically stop all media tracks and delete any HTML video element associated to this Publisher
* (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.
* Call `event.preventDefault()` upon 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.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) 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)).
* 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.
* Call `event.preventDefault()` upon event `streamDestroyed` to avoid this default behavior and take care of disposing and cleaning the Subscriber object on your own.
*
* See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
*/
@ -400,7 +408,7 @@ export class Session implements EventDispatcher {
const streamEvent = new StreamEvent(true, publisher, 'streamDestroyed', publisher.stream, 'unpublish');
publisher.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehaviour();
streamEvent.callDefaultBehavior();
}
}
@ -557,7 +565,7 @@ export class Session implements EventDispatcher {
* @hidden
*/
onParticipantLeft(msg): void {
this.getRemoteConnection(msg.name, 'Remote connection ' + msg.name + " unknown when 'onParticipantLeft'. " +
this.getRemoteConnection(msg.connectionId, 'Remote connection ' + msg.connectionId + " unknown when 'onParticipantLeft'. " +
'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))
.then(connection => {
@ -566,7 +574,7 @@ export class Session implements EventDispatcher {
const streamEvent = new StreamEvent(true, this, 'streamDestroyed', stream, msg.reason);
this.ee.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehaviour();
streamEvent.callDefaultBehavior();
delete this.remoteStreamsCreated[stream.streamId];
}
@ -622,14 +630,14 @@ export class Session implements EventDispatcher {
* @hidden
*/
onParticipantUnpublished(msg): void {
this.getRemoteConnection(msg.name, "Remote connection '" + msg.name + "' unknown when 'onParticipantUnpublished'. " +
this.getRemoteConnection(msg.connectionId, "Remote connection '" + msg.connectionId + "' unknown when 'onParticipantUnpublished'. " +
'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))
.then(connection => {
const streamEvent = new StreamEvent(true, this, 'streamDestroyed', connection.stream, msg.reason);
this.ee.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehaviour();
streamEvent.callDefaultBehavior();
// Deleting the remote stream
const streamId: string = connection.stream.streamId;
@ -645,26 +653,33 @@ export class Session implements EventDispatcher {
* @hidden
*/
onParticipantEvicted(msg): void {
/*this.getRemoteConnection(msg.name, 'Remote connection ' + msg.name + " unknown when 'onParticipantLeft'. " +
'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))
if (msg.connectionId === this.connection.connectionId) {
// You have been evicted from the session
if (!!this.sessionId && !this.connection.disposed) {
this.leave(true, msg.reason);
}
} else {
// Other user has been evicted from the session
this.getRemoteConnection(msg.connectionId, 'Remote connection ' + msg.connectionId + " unknown when 'onParticipantEvicted'. " +
'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))
.then(connection => {
if (!!connection.stream) {
const stream = connection.stream;
.then(connection => {
if (!!connection.stream) {
const stream = connection.stream;
const streamEvent = new StreamEvent(true, this, 'streamDestroyed', stream, 'forceDisconnect');
this.ee.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehaviour();
const streamEvent = new StreamEvent(true, this, 'streamDestroyed', stream, msg.reason);
this.ee.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehavior();
delete this.remoteStreamsCreated[stream.streamId];
}
connection.dispose();
delete this.remoteConnections[connection.connectionId];
this.ee.emitEvent('connectionDestroyed', [new ConnectionEvent(false, this, 'connectionDestroyed', connection, 'forceDisconnect')]);
})
.catch(openViduError => {
console.error(openViduError);
});*/
delete this.remoteStreamsCreated[stream.streamId];
}
delete this.remoteConnections[connection.connectionId];
this.ee.emitEvent('connectionDestroyed', [new ConnectionEvent(false, this, 'connectionDestroyed', connection, msg.reason)]);
})
.catch(openViduError => {
console.error(openViduError);
});
}
}
/**
@ -686,6 +701,46 @@ export class Session implements EventDispatcher {
});
}
/**
* @hidden
*/
onStreamPropertyChanged(msg): void {
this.getRemoteConnection(msg.connectionId, 'Remote connection ' + msg.connectionId + " unknown when 'onStreamPropertyChanged'. " +
'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))
.then(connection => {
if (!!connection.stream && connection.stream.streamId === msg.streamId) {
const stream = connection.stream;
let oldValue;
switch (msg.property) {
case 'audioActive':
oldValue = stream.audioActive;
msg.newValue = msg.newValue === 'true';
stream.audioActive = msg.newValue;
break;
case 'videoActive':
oldValue = stream.videoActive;
msg.newValue = msg.newValue === 'true';
stream.videoActive = msg.newValue;
break;
case 'videoDimensions':
oldValue = stream.videoDimensions;
msg.newValue = JSON.parse(JSON.parse(msg.newValue));
stream.videoDimensions = msg.newValue;
break;
}
this.ee.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this, stream, msg.property, msg.newValue, oldValue, msg.reason)]);
stream.streamManager.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(stream.streamManager, stream, msg.property, msg.newValue, oldValue, msg.reason)]);
} else {
console.error("No stream with streamId '" + msg.streamId + "' found for connection '" + msg.connectionId + "' on 'streamPropertyChanged' event");
}
})
.catch(openViduError => {
console.error(openViduError);
});
}
/**
* @hidden
*/
@ -693,17 +748,17 @@ export class Session implements EventDispatcher {
const candidate = {
candidate: msg.candidate,
sdpMid: msg.sdpMid,
sdpMLineIndex: msg.sdpMLineIndex
sdpMLineIndex: msg.sdpMLineIndex,
toJSON: () => {
return { candidate: msg.candidate };
}
};
this.getConnection(msg.endpointName, 'Connection not found for endpoint ' + msg.endpointName + '. Ice candidate will be ignored: ' + candidate)
.then(connection => {
const stream = connection.stream;
stream.getWebRtcPeer().addIceCandidate(candidate, (error) => {
if (error) {
console.error('Error adding candidate for ' + stream.streamId
+ ' stream of endpoint ' + msg.endpointName + ': ' + error);
}
stream.getWebRtcPeer().addIceCandidate(candidate).catch(error => {
console.error('Error adding candidate for ' + stream.streamId
+ ' stream of endpoint ' + msg.endpointName + ': ' + error);
});
})
.catch(openViduError => {
@ -716,7 +771,7 @@ export class Session implements EventDispatcher {
*/
onSessionClosed(msg): void {
console.info('Session closed: ' + JSON.stringify(msg));
const s = msg.room;
const s = msg.sessionId;
if (s !== undefined) {
this.ee.emitEvent('session-closed', [{
session: s
@ -731,7 +786,7 @@ export class Session implements EventDispatcher {
*/
onLostConnection(): void {
if (!this.connection) {
/*if (!this.connection) {
console.warn('Not connected to session: if you are not debugging, this is probably a certificate error');
@ -740,7 +795,7 @@ export class Session implements EventDispatcher {
location.assign(url + '/accept-certificate');
}
return;
}
}*/
console.warn('Lost connection in Session ' + this.sessionId);
if (!!this.sessionId && !this.connection.disposed) {
@ -818,7 +873,7 @@ export class Session implements EventDispatcher {
// Make Session object dispatch 'sessionDisconnected' event (if it is not already disposed)
const sessionDisconnectEvent = new SessionDisconnectedEvent(this, reason);
this.ee.emitEvent('sessionDisconnected', [sessionDisconnectEvent]);
sessionDisconnectEvent.callDefaultBehaviour();
sessionDisconnectEvent.callDefaultBehavior();
}
} else {
console.warn('You were not connected to the session ' + this.sessionId);
@ -848,6 +903,12 @@ export class Session implements EventDispatcher {
reject(error);
} else {
// Initialize capabilities object with the role
this.capabilities = {
subscribe: true,
publish: this.openvidu.role !== 'SUBSCRIBER'
};
// Initialize local Connection object with values returned by openvidu-server
this.connection = new Connection(this);
this.connection.connectionId = response.id;
@ -934,6 +995,9 @@ export class Session implements EventDispatcher {
this.sessionId = <string>url.searchParams.get('sessionId');
const secret = url.searchParams.get('secret');
const recorder = url.searchParams.get('recorder');
const turnUsername = url.searchParams.get('turnUsername');
const turnCredential = url.searchParams.get('turnCredential');
const role = url.searchParams.get('role');
if (!!secret) {
this.openvidu.secret = secret;
@ -941,6 +1005,19 @@ export class Session implements EventDispatcher {
if (!!recorder) {
this.openvidu.recorder = true;
}
if (!!turnUsername && !!turnCredential) {
const stunUrl = 'stun:' + url.hostname + ':3478';
const turnUrl1 = 'turn:' + url.hostname + ':3478';
const turnUrl2 = turnUrl1 + '?transport=tcp';
this.openvidu.iceServers = [
{ urls: [stunUrl] },
{ urls: [turnUrl1, turnUrl2], username: turnUsername, credential: turnCredential }
];
console.log('TURN temp credentials [' + turnUsername + ':' + turnCredential + ']');
}
if (!!role) {
this.openvidu.role = role;
}
this.openvidu.wsUri = 'wss://' + url.host + '/openvidu';
}

View File

@ -20,13 +20,12 @@ import { Session } from './Session';
import { StreamManager } from './StreamManager';
import { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions';
import { OutboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/OutboundStreamOptions';
import { WebRtcPeer, WebRtcPeerSendonly, WebRtcPeerRecvonly, WebRtcPeerSendrecv } from '../OpenViduInternal/WebRtcPeer/WebRtcPeer';
import { WebRtcStats } from '../OpenViduInternal/WebRtcStats/WebRtcStats';
import { PublisherSpeakingEvent } from '../OpenViduInternal/Events/PublisherSpeakingEvent';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import EventEmitter = require('wolfy87-eventemitter');
import * as kurentoUtils from '../OpenViduInternal/KurentoUtils/kurento-utils-js';
import hark = require('hark');
/**
@ -57,13 +56,30 @@ export class Stream {
*/
hasAudio: boolean;
/**
* Whether the stream has the video track muted or unmuted. If [[hasVideo]] is false, this property is undefined.
*
* This property may change if the Publisher publishing the stream calls [[Publisher.publishVideo]]. Whenever this happens a [[StreamPropertyChangedEvent]] will be dispatched
* by the Session object as well as by the affected Subscriber/Publisher object
*/
videoActive: boolean;
/**
* Whether the stream has the audio track muted or unmuted. If [[hasAudio]] is false, this property is undefined
*
* This property may change if the Publisher publishing the stream calls [[Publisher.publishAudio]]. Whenever this happens a [[StreamPropertyChangedEvent]] will be dispatched
* by the Session object as well as by the affected Subscriber/Publisher object
*/
audioActive: boolean;
/**
* Unique identifier of the stream
*/
streamId: string;
/**
* `"CAMERA"` or `"SCREEN"`. *undefined* if stream is audio-only
* `"CAMERA"`, `"SCREEN"` or `"CUSTOM"` (the latter when [[PublisherProperties.videoSource]] is a MediaStreamTrack when calling [[OpenVidu.initPublisher]]).
* If [[hasVideo]] is false, this property is undefined
*/
typeOfVideo?: string;
@ -72,12 +88,23 @@ export class Stream {
*/
streamManager: StreamManager;
/**
* Width and height in pixels of the encoded video stream. If [[hasVideo]] is false, this property is undefined
*
* This property may change if the Publisher that is publishing:
* - If it is a mobile device, whenever the user rotates the device.
* - If it is screen-sharing, whenever the user changes the size of the captured window.
*
* Whenever this happens a [[StreamPropertyChangedEvent]] will be dispatched by the Session object as well as by the affected Subscriber/Publisher object
*/
videoDimensions: { width: number, height: number };
/**
* @hidden
*/
ee = new EventEmitter();
private webRtcPeer: any;
private webRtcPeer: WebRtcPeer;
private mediaStream: MediaStream;
private webRtcStats: WebRtcStats;
@ -120,29 +147,36 @@ export class Stream {
// InboundStreamOptions: stream belongs to a Subscriber
this.inboundStreamOpts = <InboundStreamOptions>options;
this.streamId = this.inboundStreamOpts.id;
this.hasAudio = this.inboundStreamOpts.recvAudio;
this.hasVideo = this.inboundStreamOpts.recvVideo;
this.typeOfVideo = (!this.inboundStreamOpts.typeOfVideo) ? undefined : this.inboundStreamOpts.typeOfVideo;
this.frameRate = (this.inboundStreamOpts.frameRate === -1) ? undefined : this.inboundStreamOpts.frameRate;
this.hasAudio = this.inboundStreamOpts.hasAudio;
this.hasVideo = this.inboundStreamOpts.hasVideo;
if (this.hasAudio) {
this.audioActive = this.inboundStreamOpts.audioActive;
}
if (this.hasVideo) {
this.videoActive = this.inboundStreamOpts.videoActive;
this.typeOfVideo = (!this.inboundStreamOpts.typeOfVideo) ? undefined : this.inboundStreamOpts.typeOfVideo;
this.frameRate = (this.inboundStreamOpts.frameRate === -1) ? undefined : this.inboundStreamOpts.frameRate;
this.videoDimensions = this.inboundStreamOpts.videoDimensions;
}
} else {
// OutboundStreamOptions: stream belongs to a Publisher
this.outboundStreamOpts = <OutboundStreamOptions>options;
if (this.isSendVideo()) {
if (this.isSendScreen()) {
this.streamId = 'SCREEN';
this.typeOfVideo = 'SCREEN';
} else {
this.streamId = 'CAMERA';
this.typeOfVideo = 'CAMERA';
}
this.frameRate = this.outboundStreamOpts.publisherProperties.frameRate;
} else {
this.streamId = 'MICRO';
delete this.typeOfVideo;
}
this.hasAudio = this.isSendAudio();
this.hasVideo = this.isSendVideo();
if (this.hasAudio) {
this.audioActive = !!this.outboundStreamOpts.publisherProperties.publishAudio;
}
if (this.hasVideo) {
this.videoActive = !!this.outboundStreamOpts.publisherProperties.publishVideo;
this.frameRate = this.outboundStreamOpts.publisherProperties.frameRate;
if (this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack) {
this.typeOfVideo = 'CUSTOM';
} else {
this.typeOfVideo = this.isSendScreen() ? 'SCREEN' : 'CAMERA';
}
}
}
this.ee.on('mediastream-updated', () => {
@ -178,7 +212,7 @@ export class Stream {
/**
* @hidden
*/
getWebRtcPeer(): any {
getWebRtcPeer(): WebRtcPeer {
return this.webRtcPeer;
}
@ -186,7 +220,7 @@ export class Stream {
* @hidden
*/
getRTCPeerConnection(): RTCPeerConnection {
return this.webRtcPeer.peerConnection;
return this.webRtcPeer.pc;
}
/**
@ -319,7 +353,7 @@ export class Stream {
harkOptions.interval = (typeof harkOptions.interval === 'number') ? harkOptions.interval : 50;
harkOptions.threshold = (typeof harkOptions.threshold === 'number') ? harkOptions.threshold : -50;
this.speechEvent = kurentoUtils.WebRtcPeer.hark(this.mediaStream, harkOptions);
this.speechEvent = hark(this.mediaStream, harkOptions);
}
}
@ -359,6 +393,38 @@ export class Stream {
this.speechEvent = undefined;
}
/**
* @hidden
*/
isLocal(): boolean {
// inbound options undefined and outbound options defined
return (!this.inboundStreamOpts && !!this.outboundStreamOpts);
}
/**
* @hidden
*/
getSelectedIceCandidate(): Promise<any> {
return new Promise((resolve, reject) => {
this.webRtcStats.getSelectedIceCandidateInfo()
.then(report => resolve(report))
.catch(error => reject(error));
});
}
/**
* @hidden
*/
getRemoteIceCandidateList(): RTCIceCandidate[] {
return this.webRtcPeer.remoteCandidatesQueue;
}
/**
* @hidden
*/
getLocalIceCandidateList(): RTCIceCandidate[] {
return this.webRtcPeer.localCandidatesQueue;
}
/* Private methods */
@ -370,41 +436,46 @@ export class Stream {
video: this.isSendVideo()
};
const options: any = {
videoStream: this.mediaStream,
const options = {
mediaStream: this.mediaStream,
mediaConstraints: userMediaConstraints,
onicecandidate: this.connection.sendIceCandidate.bind(this.connection),
iceServers: this.session.openvidu.advancedConfiguration.iceServers
iceServers: this.getIceServersConf(),
simulcast: false
};
const successCallback = (error, sdpOfferParam, wp) => {
if (error) {
reject(new Error('(publish) SDP offer error: ' + JSON.stringify(error)));
}
const successCallback = (sdpOfferParam) => {
console.debug('Sending SDP offer to publish as '
+ this.streamId, sdpOfferParam);
let typeOfVideo = '';
if (this.isSendVideo()) {
typeOfVideo = this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack ? 'CUSTOM' : (this.isSendScreen() ? 'SCREEN' : 'CAMERA');
}
this.session.openvidu.sendRequest('publishVideo', {
sdpOffer: sdpOfferParam,
doLoopback: this.displayMyRemote() || false,
audioActive: this.isSendAudio(),
videoActive: this.isSendVideo(),
typeOfVideo: ((this.isSendVideo()) ? (this.isSendScreen() ? 'SCREEN' : 'CAMERA') : ''),
frameRate: !!this.frameRate ? this.frameRate : -1
hasAudio: this.isSendAudio(),
hasVideo: this.isSendVideo(),
audioActive: this.audioActive,
videoActive: this.videoActive,
typeOfVideo,
frameRate: !!this.frameRate ? this.frameRate : -1,
videoDimensions: JSON.stringify(this.videoDimensions)
}, (error, response) => {
if (error) {
reject('Error on publishVideo: ' + JSON.stringify(error));
} else {
this.processSdpAnswer(response.sdpAnswer)
this.webRtcPeer.processAnswer(response.sdpAnswer)
.then(() => {
this.streamId = response.id;
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.remotePeerSuccessfullyEstablished();
}
this.ee.emitEvent('stream-created-by-publisher');
this.initWebRtcStats();
resolve();
})
.catch(error => {
@ -416,20 +487,15 @@ export class Stream {
};
if (this.displayMyRemote()) {
this.webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, err => {
if (err) {
reject(err);
}
this.webRtcPeer.generateOffer(successCallback);
});
this.webRtcPeer = new WebRtcPeerSendrecv(options);
} else {
this.webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendonly(options, error => {
if (error) {
reject(error);
}
this.webRtcPeer.generateOffer(successCallback);
});
this.webRtcPeer = new WebRtcPeerSendonly(options);
}
this.webRtcPeer.generateOffer().then(offer => {
successCallback(offer);
}).catch(error => {
reject(new Error('(publish) SDP offer error: ' + JSON.stringify(error)));
});
});
}
@ -437,21 +503,19 @@ export class Stream {
return new Promise((resolve, reject) => {
const offerConstraints = {
audio: this.inboundStreamOpts.recvAudio,
video: this.inboundStreamOpts.recvVideo
audio: this.inboundStreamOpts.hasAudio,
video: this.inboundStreamOpts.hasVideo
};
console.debug("'Session.subscribe(Stream)' called. Constraints of generate SDP offer",
offerConstraints);
const options = {
onicecandidate: this.connection.sendIceCandidate.bind(this.connection),
mediaConstraints: offerConstraints
mediaConstraints: offerConstraints,
iceServers: this.getIceServersConf(),
simulcast: false
};
const successCallback = (error, sdpOfferParam, wp) => {
if (error) {
reject(new Error('(subscribe) SDP offer error: ' + JSON.stringify(error)));
}
const successCallback = (sdpOfferParam) => {
console.debug('Sending SDP offer to subscribe to '
+ this.streamId, sdpOfferParam);
this.session.openvidu.sendRequest('receiveVideoFrom', {
@ -461,7 +525,9 @@ export class Stream {
if (error) {
reject(new Error('Error on recvVideoFrom: ' + JSON.stringify(error)));
} else {
this.processSdpAnswer(response.sdpAnswer).then(() => {
this.webRtcPeer.processAnswer(response.sdpAnswer).then(() => {
this.remotePeerSuccessfullyEstablished();
this.initWebRtcStats();
resolve();
}).catch(error => {
reject(error);
@ -470,48 +536,27 @@ export class Stream {
});
};
this.webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerRecvonly(options, error => {
if (error) {
reject(error);
}
this.webRtcPeer.generateOffer(successCallback);
});
this.webRtcPeer = new WebRtcPeerRecvonly(options);
this.webRtcPeer.generateOffer()
.then(offer => {
successCallback(offer);
})
.catch(error => {
reject(new Error('(subscribe) SDP offer error: ' + JSON.stringify(error)));
});
});
}
private processSdpAnswer(sdpAnswer): Promise<any> {
return new Promise((resolve, reject) => {
const answer = new RTCSessionDescription({
type: 'answer',
sdp: sdpAnswer,
});
private remotePeerSuccessfullyEstablished(): void {
this.mediaStream = this.webRtcPeer.pc.getRemoteStreams()[0];
console.debug('Peer remote stream', this.mediaStream);
console.debug(this.streamId + ': set peer connection with recvd SDP answer', sdpAnswer);
const streamId = this.streamId;
const peerConnection = this.webRtcPeer.peerConnection;
peerConnection.setRemoteDescription(answer, () => {
// Update remote MediaStream object except when local stream
if (!this.isLocal() || this.displayMyRemote()) {
this.mediaStream = peerConnection.getRemoteStreams()[0];
console.debug('Peer remote stream', this.mediaStream);
if (!!this.mediaStream) {
this.ee.emitEvent('mediastream-updated');
if (!!this.mediaStream.getAudioTracks()[0] && this.session.speakingEventsEnabled) {
this.enableSpeakingEvents();
}
}
}
this.initWebRtcStats();
resolve();
}, error => {
reject(new Error(this.streamId + ': Error setting SDP to the peer connection: ' + JSON.stringify(error)));
});
});
if (!!this.mediaStream) {
this.ee.emitEvent('mediastream-updated');
if (!this.displayMyRemote() && !!this.mediaStream.getAudioTracks()[0] && this.session.speakingEventsEnabled) {
this.enableSpeakingEvents();
}
}
}
private initWebRtcStats(): void {
@ -525,12 +570,18 @@ export class Stream {
}
}
/**
* @hidden
*/
isLocal(): boolean {
// inbound options undefined and outbound options defined
return (!this.inboundStreamOpts && !!this.outboundStreamOpts);
private getIceServersConf(): RTCIceServer[] | undefined {
let returnValue;
if (!!this.session.openvidu.advancedConfiguration.iceServers) {
returnValue = this.session.openvidu.advancedConfiguration.iceServers === 'freeice' ?
undefined :
this.session.openvidu.advancedConfiguration.iceServers;
} else if (this.session.openvidu.iceServers) {
returnValue = this.session.openvidu.iceServers;
} else {
returnValue = undefined;
}
return returnValue;
}
}

View File

@ -139,9 +139,9 @@ export class StreamManager implements EventDispatcher {
on(type: string, handler: (event: Event) => void): EventDispatcher {
this.ee.on(type, event => {
if (event) {
console.info("Event '" + type + "' triggered", event);
console.info("Event '" + type + "' triggered by '" + (this.remote ? 'Subscriber' : 'Publisher') + "'", event);
} else {
console.info("Event '" + type + "' triggered");
console.info("Event '" + type + "' triggered by '" + (this.remote ? 'Subscriber' : 'Publisher') + "'");
}
handler(event);
});
@ -230,8 +230,6 @@ export class StreamManager implements EventDispatcher {
let returnNumber = 1;
this.initializeVideoProperties(video);
for (const streamManager of this.stream.session.streamManagers) {
if (streamManager.disassociateVideo(video)) {
returnNumber = -1;
@ -321,7 +319,10 @@ export class StreamManager implements EventDispatcher {
* @hidden
*/
initializeVideoProperties(video: HTMLVideoElement): void {
video.srcObject = this.stream.getMediaStream();
if (!(this.stream.isLocal() && this.stream.displayMyRemote())) {
// Avoid setting the MediaStream into the srcObject if remote subscription before publishing
video.srcObject = this.stream.getMediaStream();
}
video.autoplay = true;
video.controls = false;
if (!video.id) {
@ -399,6 +400,13 @@ export class StreamManager implements EventDispatcher {
});
}
/**
* @hidden
*/
emitEvent(type: string, eventArray: any[]): void {
this.ee.emitEvent(type, eventArray);
}
private pushNewStreamManagerVideo(streamManagerVideo: StreamManagerVideo) {
this.videos.push(streamManagerVideo);
this.addPlayEventToFirstVideo();

View File

@ -22,49 +22,49 @@ export enum OpenViduErrorName {
/**
* Browser is not supported by OpenVidu.
* Returned uppon unsuccessful [[Session.connect]]
* Returned upon unsuccessful [[Session.connect]]
*/
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]]
* Returned upon 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]]
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
SCREEN_CAPTURE_DENIED = 'SCREEN_CAPTURE_DENIED',
/**
* Browser does not support screen sharing.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
*/
SCREEN_SHARING_NOT_SUPPORTED = 'SCREEN_SHARING_NOT_SUPPORTED',
/**
* Only for Chrome, there's no screen sharing extension installed
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
*/
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]]
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
*/
SCREEN_EXTENSION_DISABLED = 'SCREEN_EXTENSION_DISABLED',
/**
* No video input device found with the provided deviceId (property [[PublisherProperties.videoSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
*/
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]]
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
*/
INPUT_AUDIO_DEVICE_NOT_FOUND = 'INPUT_AUDIO_DEVICE_NOT_FOUND',
@ -77,7 +77,7 @@ export enum OpenViduErrorName {
/**
* 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]]
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
*/
PUBLISHER_PROPERTIES_ERROR = 'PUBLISHER_PROPERTIES_ERROR',

View File

@ -54,6 +54,6 @@ export class ConnectionEvent extends Event {
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehaviour() { }
callDefaultBehavior() { }
}

View File

@ -21,7 +21,7 @@ import { Session } from '../../OpenVidu/Session';
export abstract class Event {
/**
* Whether the event has a default behaviour that may be prevented by calling [[Event.preventDefault]]
* Whether the event has a default behavior that may be prevented by calling [[Event.preventDefault]]
*/
cancelable: boolean;
@ -54,7 +54,7 @@ export abstract class Event {
}
/**
* Prevents the default behaviour of the event. The following events have a default behaviour:
* Prevents the default behavior of the event. The following events have a default behavior:
*
* - `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)
* 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
@ -69,10 +69,10 @@ export abstract class Event {
*/
preventDefault() {
// tslint:disable-next-line:no-empty
this.callDefaultBehaviour = () => { };
this.callDefaultBehavior = () => { };
this.hasBeenPrevented = true;
}
protected abstract callDefaultBehaviour();
protected abstract callDefaultBehavior();
}

View File

@ -57,6 +57,6 @@ export class PublisherSpeakingEvent extends Event {
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehaviour() { }
callDefaultBehavior() { }
}

View File

@ -56,6 +56,6 @@ export class RecordingEvent extends Event {
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehaviour() { }
callDefaultBehavior() { }
}

View File

@ -41,9 +41,9 @@ export class SessionDisconnectedEvent extends Event {
/**
* @hidden
*/
callDefaultBehaviour() {
callDefaultBehavior() {
console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Session'");
console.info("Calling default behavior upon '" + this.type + "' event dispatched by 'Session'");
const session = <Session>this.target;

View File

@ -60,6 +60,6 @@ export class SignalEvent extends Event {
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehaviour() { }
callDefaultBehavior() { }
}

View File

@ -55,17 +55,27 @@ export class StreamEvent extends Event {
/**
* @hidden
*/
callDefaultBehaviour() {
callDefaultBehavior() {
if (this.type === 'streamDestroyed') {
if (this.target instanceof Session) {
// Remote Stream
console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Session'");
console.info("Calling default behavior upon '" + this.type + "' event dispatched by 'Session'");
this.stream.disposeWebRtcPeer();
} else if (this.target instanceof Publisher) {
// Local Stream
console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Publisher'");
console.info("Calling default behavior upon '" + this.type + "' event dispatched by 'Publisher'");
clearInterval((<Publisher>this.target).screenShareResizeInterval);
this.stream.isLocalStreamReadyToPublish = false;
// Delete Publisher object from OpenVidu publishers array
const openviduPublishers = (<Publisher>this.target).openvidu.publishers;
for (let i = 0; i < openviduPublishers.length; i++) {
if (openviduPublishers[i] === (<Publisher>this.target)) {
openviduPublishers.splice(i, 1);
break;
}
}
}
// Dispose the MediaStream local object

View File

@ -35,6 +35,6 @@ export class StreamManagerEvent extends Event {
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehaviour() { }
callDefaultBehavior() { }
}

Some files were not shown because too many files have changed in this diff Show More