-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPeerConnection.js.html
686 lines (582 loc) · 49.5 KB
/
PeerConnection.js.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Adding favicon -->
<!-- Adding meta -->
<!-- Adding external script-->
<!-- Adding external style-->
<!-- Adding scripts-->
<!-- Adding style-->
<!-- Adding overlay script-->
<!-- Adding overlay style-->
<title>
PeerConnection.js
</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/third-party/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/third-party/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/reset.css">
<link type="text/css" rel="stylesheet" href="styles/clean-jsdoc-theme-base.css">
<link type="text/css" rel="stylesheet" href="styles/clean-jsdoc-theme-light.css">
<svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
style="display:none">
<defs>
<symbol id="copy-icon" viewbox="0 0 488.3 488.3">
<g>
<path
d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z" />
<path
d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z" />
</g>
</symbol>
<symbol id='search-icon' viewBox="0 0 512 512">
<g>
<g>
<path
d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z" />
</g>
</g>
<g>
<g>
<path
d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z" />
</g>
</g>
</symbol>
<symbol id="down-icon" viewBox="0 0 16 16">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"
>
</path>
</symbol>
</defs>
</svg>
</head>
<body>
<nav class="navbar" id="navbar">
<div class="navbar-heading" id="navbar-heading"><a href="index.html"><h2 class="navbar-heading-text">JavaScript SDK</h2></a></div><div class="search-box" id="search-box"><div class="search-box-input-container"><input class="search-box-input" type="text" placeholder="Search..." id="search-box-input" /><svg class="search-icon" alt="search-icon"><use xlink:href="#search-icon"></use></svg></div><div class="search-item-container" id="search-item-container"><ul class="search-item-ul" id="search-item-ul"></ul></div></div><div class="sidebar-main-content" id="sidebar-main-content"><div class="accordion collapsed" id="7557599" > <h3 class="accordion-heading">Modules<svg><use xlink:href="#down-icon"></use></svg></h3><ul class="accordion-content"><li class="accordion collapsed child" id=8443790><div class="accordion-heading child"><a href="module-Director.html">Director</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="module-Director.html#~getEndpoint">getEndpoint</a></li><li data-type='method'><a href="module-Director.html#~getLiveDomain">getLiveDomain</a></li><li data-type='method'><a href="module-Director.html#~getPublisher">getPublisher</a></li><li data-type='method'><a href="module-Director.html#~getSubscriber">getSubscriber</a></li><li data-type='method'><a href="module-Director.html#~setEndpoint">setEndpoint</a></li><li data-type='method'><a href="module-Director.html#~setLiveDomain">setLiveDomain</a></li></ul></li><li class="accordion collapsed child" id=5836212><div class="accordion-heading child"><a href="module-Logger.html">Logger</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="module-Logger.html#~get">get</a></li><li data-type='method'><a href="module-Logger.html#~getHistory">getHistory</a></li><li data-type='method'><a href="module-Logger.html#~getHistoryMaxSize">getHistoryMaxSize</a></li><li data-type='method'><a href="module-Logger.html#~getLevel">getLevel</a></li><li data-type='method'><a href="module-Logger.html#~setHandler">setHandler</a></li><li data-type='method'><a href="module-Logger.html#~setHistoryMaxSize">setHistoryMaxSize</a></li><li data-type='method'><a href="module-Logger.html#~setLevel">setLevel</a></li></ul></li><li class="accordion collapsed child" id=810655><div class="accordion-heading child"><a href="module-SdpParser.html">SdpParser</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="module-SdpParser.html#~adaptCodecName">adaptCodecName</a></li><li data-type='method'><a href="module-SdpParser.html#~getAvailableHeaderExtensionIdRange">getAvailableHeaderExtensionIdRange</a></li><li data-type='method'><a href="module-SdpParser.html#~getAvailablePayloadTypeRange">getAvailablePayloadTypeRange</a></li><li data-type='method'><a href="module-SdpParser.html#~removeSdpLine">removeSdpLine</a></li><li data-type='method'><a href="module-SdpParser.html#~renegotiate">renegotiate</a></li><li data-type='method'><a href="module-SdpParser.html#~setAbsoluteCaptureTime">setAbsoluteCaptureTime</a></li><li data-type='method'><a href="module-SdpParser.html#~setDependencyDescriptor">setDependencyDescriptor</a></li><li data-type='method'><a href="module-SdpParser.html#~setDTX">setDTX</a></li><li data-type='method'><a href="module-SdpParser.html#~setMultiopus">setMultiopus</a></li><li data-type='method'><a href="module-SdpParser.html#~setSimulcast">setSimulcast</a></li><li data-type='method'><a href="module-SdpParser.html#~setStereo">setStereo</a></li><li data-type='method'><a href="module-SdpParser.html#~setVideoBitrate">setVideoBitrate</a></li><li data-type='method'><a href="module-SdpParser.html#~updateMissingVideoExtensions">updateMissingVideoExtensions</a></li></ul></li></ul> </div><div class="accordion collapsed" id="1490423" > <h3 class="accordion-heading">Classes<svg><use xlink:href="#down-icon"></use></svg></h3><ul class="accordion-content"><li class="accordion collapsed child" id=4205529><div class="accordion-heading child"><a href="BaseWebRTC.html">BaseWebRTC</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="BaseWebRTC.html#getRTCPeerConnection">getRTCPeerConnection</a></li><li data-type='method'><a href="BaseWebRTC.html#isActive">isActive</a></li><li data-type='method'><a href="BaseWebRTC.html#reconnect">reconnect</a></li><li data-type='method'><a href="BaseWebRTC.html#setReconnect">setReconnect</a></li><li data-type='method'><a href="BaseWebRTC.html#stop">stop</a></li></ul></li><li class="accordion collapsed child" id=8899913><div class="accordion-heading child"><a href="PeerConnection.html">PeerConnection</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="PeerConnection.html#.getCapabilities">getCapabilities</a></li><li data-type='method'><a href="PeerConnection.html#addRemoteTrack">addRemoteTrack</a></li><li data-type='method'><a href="PeerConnection.html#closeRTCPeer">closeRTCPeer</a></li><li data-type='method'><a href="PeerConnection.html#createRTCPeer">createRTCPeer</a></li><li data-type='method'><a href="PeerConnection.html#getRTCLocalSDP">getRTCLocalSDP</a></li><li data-type='method'><a href="PeerConnection.html#getRTCPeer">getRTCPeer</a></li><li data-type='method'><a href="PeerConnection.html#getRTCPeerStatus">getRTCPeerStatus</a></li><li data-type='method'><a href="PeerConnection.html#getTracks">getTracks</a></li><li data-type='method'><a href="PeerConnection.html#initStats">initStats</a></li><li data-type='method'><a href="PeerConnection.html#replaceTrack">replaceTrack</a></li><li data-type='method'><a href="PeerConnection.html#setRTCRemoteSDP">setRTCRemoteSDP</a></li><li data-type='method'><a href="PeerConnection.html#stopStats">stopStats</a></li><li data-type='method'><a href="PeerConnection.html#updateBandwidthRestriction">updateBandwidthRestriction</a></li><li data-type='method'><a href="PeerConnection.html#updateBitrate">updateBitrate</a></li></ul></li><li class="accordion collapsed child" id=281125><div class="accordion-heading child"><a href="Publish.html">Publish</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Publish.html#connect">connect</a></li><li data-type='method'><a href="Publish.html#getRTCPeerConnection">getRTCPeerConnection</a></li><li data-type='method'><a href="Publish.html#isActive">isActive</a></li><li data-type='method'><a href="Publish.html#reconnect">reconnect</a></li><li data-type='method'><a href="Publish.html#record">record</a></li><li data-type='method'><a href="Publish.html#setReconnect">setReconnect</a></li><li data-type='method'><a href="Publish.html#stop">stop</a></li><li data-type='method'><a href="Publish.html#unrecord">unrecord</a></li></ul></li><li class="accordion collapsed child" id=6958554><div class="accordion-heading child"><a href="Signaling.html">Signaling</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Signaling.html#close">close</a></li><li data-type='method'><a href="Signaling.html#cmd">cmd</a></li><li data-type='method'><a href="Signaling.html#connect">connect</a></li><li data-type='method'><a href="Signaling.html#publish">publish</a></li><li data-type='method'><a href="Signaling.html#subscribe">subscribe</a></li></ul></li><li class="accordion collapsed child" id=3108999><div class="accordion-heading child"><a href="StreamEvents.html">StreamEvents</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="StreamEvents.html#.getEventsLocation">getEventsLocation</a></li><li data-type='method'><a href="StreamEvents.html#.init">init</a></li><li data-type='method'><a href="StreamEvents.html#.setEventsLocation">setEventsLocation</a></li><li data-type='method'><a href="StreamEvents.html#onUserCount">onUserCount</a></li><li data-type='method'><a href="StreamEvents.html#stop">stop</a></li></ul></li><li class="accordion collapsed child" id=9464527><div class="accordion-heading child"><a href="View.html">View</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="View.html#addRemoteTrack">addRemoteTrack</a></li><li data-type='method'><a href="View.html#connect">connect</a></li><li data-type='method'><a href="View.html#getRTCPeerConnection">getRTCPeerConnection</a></li><li data-type='method'><a href="View.html#isActive">isActive</a></li><li data-type='method'><a href="View.html#project">project</a></li><li data-type='method'><a href="View.html#reconnect">reconnect</a></li><li data-type='method'><a href="View.html#select">select</a></li><li data-type='method'><a href="View.html#setReconnect">setReconnect</a></li><li data-type='method'><a href="View.html#stop">stop</a></li><li data-type='method'><a href="View.html#unproject">unproject</a></li></ul></li></ul> </div><div class="accordion collapsed" id="2939770" > <h3 class="accordion-heading">Events<svg><use xlink:href="#down-icon"></use></svg></h3><ul class="accordion-content"><li class="accordion-list" id=""><a href="BaseWebRTC.html#event:reconnect">reconnect</a></li><li class="accordion-list" id=""><a href="PeerConnection.html#event:connectionStateChange">connectionStateChange</a></li><li class="accordion-list" id=""><a href="PeerConnection.html#event:stats">stats</a></li><li class="accordion-list" id=""><a href="PeerConnection.html#event:track">track</a></li><li class="accordion-list" id=""><a href="Publish.html#event:reconnect">reconnect</a></li><li class="accordion-list" id=""><a href="Signaling.html#event:broadcastEvent">broadcastEvent</a></li><li class="accordion-list" id=""><a href="Signaling.html#event:wsConnectionClose">wsConnectionClose</a></li><li class="accordion-list" id=""><a href="Signaling.html#event:wsConnectionError">wsConnectionError</a></li><li class="accordion-list" id=""><a href="Signaling.html#event:wsConnectionSuccess">wsConnectionSuccess</a></li><li class="accordion-list" id=""><a href="View.html#event:reconnect">reconnect</a></li></ul> </div><div class="accordion collapsed" id="3049150" > <h3 class="accordion-heading">Global<svg><use xlink:href="#down-icon"></use></svg></h3><ul class="accordion-content"><li class="accordion-list" id=""><a href="global.html#addCandidateReport">addCandidateReport</a></li><li class="accordion-list" id=""><a href="global.html#addInboundRtpReport">addInboundRtpReport</a></li><li class="accordion-list" id=""><a href="global.html#addOutboundRtpReport">addOutboundRtpReport</a></li><li class="accordion-list" id=""><a href="global.html#addPeerEvents">addPeerEvents</a></li><li class="accordion-list" id=""><a href="global.html#AudioCodec">AudioCodec</a></li><li class="accordion-list" id=""><a href="global.html#calculatePacketsLostDelta">calculatePacketsLostDelta</a></li><li class="accordion-list" id=""><a href="global.html#calculatePacketsLostRatio">calculatePacketsLostRatio</a></li><li class="accordion-list" id=""><a href="global.html#ConnectionStats">ConnectionStats</a></li><li class="accordion-list" id=""><a href="global.html#DirectorPublisherOptions">DirectorPublisherOptions</a></li><li class="accordion-list" id=""><a href="global.html#DirectorSubscriberOptions">DirectorSubscriberOptions</a></li><li class="accordion-list" id=""><a href="global.html#getBaseRtpReportData">getBaseRtpReportData</a></li><li class="accordion-list" id=""><a href="global.html#getCodecData">getCodecData</a></li><li class="accordion-list" id=""><a href="global.html#getMediaType">getMediaType</a></li><li class="accordion-list" id=""><a href="global.html#InboundStats">InboundStats</a></li><li class="accordion-list" id=""><a href="global.html#LayerInfo">LayerInfo</a></li><li class="accordion-list" id=""><a href="global.html#loggerHandler">loggerHandler</a></li><li class="accordion-list" id=""><a href="global.html#LogLevel">LogLevel</a></li><li class="accordion-list" id=""><a href="global.html#onUserCountCallback">onUserCountCallback</a></li><li class="accordion-list" id=""><a href="global.html#OnUserCountOptions">OnUserCountOptions</a></li><li class="accordion-list" id=""><a href="global.html#OutboundStats">OutboundStats</a></li><li class="accordion-list" id=""><a href="global.html#SignalingPublishOptions">SignalingPublishOptions</a></li><li class="accordion-list" id=""><a href="global.html#SignalingSubscribeOptions">SignalingSubscribeOptions</a></li><li class="accordion-list" id=""><a href="global.html#tokenGeneratorCallback">tokenGeneratorCallback</a></li><li class="accordion-list" id=""><a href="global.html#TrackReport">TrackReport</a></li><li class="accordion-list" id=""><a href="global.html#VideoCodec">VideoCodec</a></li><li class="accordion-list" id=""><a href="global.html#WowzaCapability">WowzaCapability</a></li><li class="accordion-list" id=""><a href="global.html#WowzaDirectorResponse">WowzaDirectorResponse</a></li></ul> </div>
</nav>
<div class="navbar-ham" id="navbar-ham">
<div>
<div class="first"></div>
<div class="second"></div>
<div class="third"></div>
</div>
</div>
<div id="main" class="main-content">
<h1 id='page-title' class="page-title">
PeerConnection.js
</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>import EventEmitter from 'events'
import reemit from 're-emitter'
import PeerConnectionStats, { peerConnectionStatsEvents } from './PeerConnectionStats'
import SdpParser from './utils/SdpParser'
import UserAgent from './utils/UserAgent'
import Logger from './Logger'
import { VideoCodec, AudioCodec } from './utils/Codecs'
import mozGetCapabilities from './utils/FirefoxCapabilities'
const logger = Logger.get('PeerConnection')
export const webRTCEvents = {
track: 'track',
connectionStateChange: 'connectionStateChange'
}
const localSDPOptions = {
stereo: false,
mediaStream: null,
codec: 'h264',
simulcast: false,
scalabilityMode: null,
disableAudio: false,
disableVideo: false,
setSDPToPeer: true
}
/**
* @class PeerConnection
* @extends EventEmitter
* @classdesc Manages WebRTC connection and SDP information between peers.
* @example const peerConnection = new PeerConnection()
* @constructor
*/
export default class PeerConnection extends EventEmitter {
constructor () {
super()
this.sessionDescription = null
this.peer = null
this.peerConnectionStats = null
}
/**
* Instance new RTCPeerConnection.
* @param {RTCConfiguration} config - Peer configuration.
*/
async createRTCPeer (config = null) {
logger.info('Creating new RTCPeerConnection')
logger.debug('RTC configuration provided by user: ', config)
this.peer = instanceRTCPeerConnection(this, config)
}
/**
* Get current RTC peer connection.
* @returns {RTCPeerConnection} Object which represents the RTCPeerConnection.
*/
getRTCPeer () {
logger.info('Getting RTC Peer')
return this.peer
}
/**
* Close RTC peer connection.
* @fires PeerConnection#connectionStateChange
*/
async closeRTCPeer () {
logger.info('Closing RTCPeerConnection')
this.peer?.close()
this.peer = null
this.stopStats()
this.emit(webRTCEvents.connectionStateChange, 'closed')
}
/**
* Set SDP information to remote peer.
* @param {String} sdp - New SDP to be set in the remote peer.
* @returns {Promise<void>} Promise object which resolves when SDP information was successfully set.
*/
async setRTCRemoteSDP (sdp) {
logger.info('Setting RTC Remote SDP')
const answer = { type: 'answer', sdp }
try {
await this.peer.setRemoteDescription(answer)
logger.info('RTC Remote SDP was set successfully.')
logger.debug('RTC Remote SDP new value: ', sdp)
} catch (e) {
logger.error('Error while setting RTC Remote SDP: ', e)
throw e
}
}
/**
* Get the SDP modified depending the options. Optionally set the SDP information to local peer.
* @param {Object} options
* @param {Boolean} options.stereo - True to modify SDP for support stereo. Otherwise False.
* @param {Boolean} options.dtx - True to modify SDP for supporting dtx in opus. Otherwise False.*
* @param {MediaStream|Array<MediaStreamTrack>} options.mediaStream - MediaStream to offer in a stream. This object must have
* 1 audio track and 1 video track, or at least one of them. Alternative you can provide both tracks in an array.
* @param {VideoCodec} options.codec - Selected codec for support simulcast.
* @param {Boolean} options.simulcast - True to modify SDP for support simulcast. **Only available in Google Chrome and with H.264 or VP8 video codecs.**
* @param {String} options.scalabilityMode - Selected scalability mode. You can get the available capabilities using <a href="PeerConnection#.getCapabilities">PeerConnection.getCapabilities</a> method.
* **Only available in Google Chrome.**
* @param {Boolean} options.absCaptureTime - True to modify SDP for supporting absolute capture time header extension. Otherwise False.
* @param {Boolean} options.dependencyDescriptor - True to modify SDP for supporting aom dependency descriptor header extension. Otherwise False.
* @param {Boolean} options.disableAudio - True to not support audio.
* @param {Boolean} options.disableVideo - True to not support video.
* @param {Boolean} options.setSDPToPeer - True to set the SDP to local peer.
* @returns {Promise<String>} Promise object which represents the SDP information of the created offer.
*/
async getRTCLocalSDP (options = localSDPOptions) {
logger.info('Getting RTC Local SDP')
options = { ...localSDPOptions, ...options }
logger.debug('Options: ', options)
const mediaStream = getValidMediaStream(options.mediaStream)
if (mediaStream) {
addMediaStreamToPeer(this.peer, mediaStream, options)
} else {
addReceiveTransceivers(this.peer, options)
}
logger.info('Creating peer offer')
const response = await this.peer.createOffer()
logger.info('Peer offer created')
logger.debug('Peer offer response: ', response.sdp)
this.sessionDescription = response
if (!options.disableAudio) {
if (options.stereo) {
this.sessionDescription.sdp = SdpParser.setStereo(this.sessionDescription.sdp)
}
if (options.dtx) {
this.sessionDescription.sdp = SdpParser.setDTX(this.sessionDescription.sdp)
}
this.sessionDescription.sdp = SdpParser.setMultiopus(this.sessionDescription.sdp, mediaStream)
}
if (!options.disableVideo && options.simulcast) {
this.sessionDescription.sdp = SdpParser.setSimulcast(this.sessionDescription.sdp, options.codec)
}
if (options.absCaptureTime) {
this.sessionDescription.sdp = SdpParser.setAbsoluteCaptureTime(this.sessionDescription.sdp)
}
if (options.dependencyDescriptor) {
this.sessionDescription.sdp = SdpParser.setDependencyDescriptor(this.sessionDescription.sdp)
}
if (options.setSDPToPeer) {
await this.peer.setLocalDescription(this.sessionDescription)
logger.info('Peer local description set')
}
return this.sessionDescription.sdp
}
/**
* Add remote receving track.
* @param {String} media - Media kind ('audio' | 'video').
* @param {Array<MediaStream>} streams - Streams the track will belong to.
* @return {Promise<RTCRtpTransceiver>} Promise that will be resolved when the RTCRtpTransceiver is assigned an mid value.
*/
async addRemoteTrack (media, streams) {
try {
let transceiver = this.peer.addTransceiver(media, {
direction: 'recvonly',
streams
})
transceiver = await getTransceiverWithMid(transceiver, streams)
return transceiver
} catch (e) {
logger.error('Error while adding the remote track: ', e)
throw e
}
}
/**
* Update remote SDP information to restrict bandwidth.
* @param {String} sdp - Remote SDP.
* @param {Number} bitrate - New bitrate value in kbps or 0 unlimited bitrate.
* @return {String} Updated SDP information with new bandwidth restriction.
*/
updateBandwidthRestriction (sdp, bitrate) {
logger.info('Updating bandwidth restriction, bitrate value: ', bitrate)
logger.debug('SDP value: ', sdp)
return SdpParser.setVideoBitrate(sdp, bitrate)
}
/**
* Set SDP information to remote peer with bandwidth restriction.
* @param {Number} bitrate - New bitrate value in kbps or 0 unlimited bitrate.
* @returns {Promise<void>} Promise object which resolves when bitrate was successfully updated.
*/
async updateBitrate (bitrate = 0) {
if (!this.peer) {
logger.error('Cannot update bitrate. No peer found.')
throw new Error('Cannot update bitrate. No peer found.')
}
logger.info('Updating bitrate to value: ', bitrate)
this.sessionDescription = await this.peer.createOffer()
await this.peer.setLocalDescription(this.sessionDescription)
const sdp = this.updateBandwidthRestriction(this.peer.remoteDescription.sdp, bitrate)
await this.setRTCRemoteSDP(sdp)
logger.info('Bitrate restirctions updated: ', `${bitrate > 0 ? bitrate : 'unlimited'} kbps`)
}
/**
* Get peer connection state.
* @returns {RTCPeerConnectionState?} Promise object which represents the peer connection state.
*/
getRTCPeerStatus () {
logger.info('Getting RTC peer status')
if (!this.peer) {
return null
}
const connectionState = getConnectionState(this.peer)
logger.info('RTC peer status getted, value: ', connectionState)
return connectionState
}
/**
* Replace current audio or video track that is being broadcasted.
* @param {MediaStreamTrack} mediaStreamTrack - New audio or video track to replace the current one.
*/
replaceTrack (mediaStreamTrack) {
if (!this.peer) {
logger.error('Could not change track if there is not an active connection.')
return
}
const currentSender = this.peer.getSenders().find(s => s.track.kind === mediaStreamTrack.kind)
if (currentSender) {
currentSender.replaceTrack(mediaStreamTrack)
} else {
logger.error(`There is no ${mediaStreamTrack.kind} track in active broadcast.`)
}
}
/**
* @typedef {Object} WowzaCapability
* @property {Array<Object>} codecs
* @property {String} codecs.codec - Audio or video codec name.
* @property {String} codecs.mimeType - Audio or video codec mime type.
* @property {Array<String>} [codecs.scalabilityModes] - In case of SVC support, a list of scalability modes supported.
* @property {Number} [codecs.channels] - Only for audio, the number of audio channels supported.
* @property {Array<RTCRtpHeaderExtensionCapability>} headerExtensions - An array specifying the URI of the header extension, as described in RFC 5285.
*/
/**
* Gets user's browser media capabilities compared with Wowza Media Server support.
*
* @param {"audio"|"video"} kind - Type of media for which you wish to get sender capabilities.
* @returns {WowzaCapability} Object with all capabilities supported by user's browser and Wowza Media Server.
*/
static getCapabilities (kind) {
const browserData = new UserAgent()
if (browserData.isFirefox()) {
return mozGetCapabilities(kind)
}
const browserCapabilites = RTCRtpSender.getCapabilities(kind)
if (browserCapabilites) {
const codecs = {}
let regex = new RegExp(`^video/(${Object.values(VideoCodec).join('|')})x?$`, 'i')
if (kind === 'audio') {
regex = new RegExp(`^audio/(${Object.values(AudioCodec).join('|')})$`, 'i')
if (browserData.isChrome()) {
codecs.multiopus = { mimeType: 'audio/multiopus', channels: 6 }
}
}
for (const codec of browserCapabilites.codecs) {
const matches = codec.mimeType.match(regex)
if (matches) {
const codecName = matches[1].toLowerCase()
codecs[codecName] = { ...codecs[codecName], mimeType: codec.mimeType }
if (codec.scalabilityModes) {
let modes = codecs[codecName].scalabilityModes || []
modes = [...modes, ...codec.scalabilityModes]
codecs[codecName].scalabilityModes = [...new Set(modes)]
}
if (codec.channels) {
codecs[codecName].channels = codec.channels
}
}
}
browserCapabilites.codecs = Object.keys(codecs).map((key) => { return { codec: key, ...codecs[key] } })
}
return browserCapabilites
}
/**
* Get sender tracks
* @returns {Array<MediaStreamTrack>} An array with all tracks in sender peer.
*/
getTracks () {
return this.peer?.getSenders()?.map((sender) => sender.track)
}
/**
* Initialize the statistics monitoring of the RTCPeerConnection.
*
* It will be emitted every second.
* @fires PeerConnection#stats
* @example peerConnection.initStats()
* @example
* import Publish from '@wowzamediasystems/sdk-rts'
*
* //Initialize and connect your Publisher
* const wowzaPublish = new Publish(streamName, tokenGenerator)
* await wowzaPublish.connect(options)
*
* //Initialize get stats
* wowzaPublish.webRTCPeer.initStats()
*
* //Capture new stats from event every second
* wowzaPublish.webRTCPeer.on('stats', (stats) => {
* console.log('Stats from event: ', stats)
* })
* @example
* import View from '@wowzamediasystems/sdk-rts'
*
* //Initialize and connect your Viewer
* const wowzaView = new View(streamName, tokenGenerator)
* await wowzaView.connect()
*
* //Initialize get stats
* wowzaView.webRTCPeer.initStats()
*
* //Capture new stats from event every second
* wowzaView.webRTCPeer.on('stats', (stats) => {
* console.log('Stats from event: ', stats)
* })
*/
initStats () {
if (this.peerConnectionStats) {
logger.warn('Cannot init peer stats: Already initialized')
} else if (this.peer) {
this.peerConnectionStats = new PeerConnectionStats(this.peer)
this.peerConnectionStats.init()
reemit(this.peerConnectionStats, this, [peerConnectionStatsEvents.stats])
} else {
logger.warn('Cannot init peer stats: RTCPeerConnection not initialized')
}
}
/**
* Stops the monitoring of RTCPeerConnection statistics.
* @example peerConnection.stopStats()
*/
stopStats () {
this.peerConnectionStats?.stop()
this.peerConnectionStats = null
}
}
const isMediaStreamValid = mediaStream =>
mediaStream?.getAudioTracks().length <= 1 && mediaStream?.getVideoTracks().length <= 1
const getValidMediaStream = (mediaStream) => {
if (!mediaStream) {
return null
}
if (mediaStream instanceof MediaStream && isMediaStreamValid(mediaStream)) {
return mediaStream
} else if (!(mediaStream instanceof MediaStream)) {
logger.info('Creating MediaStream to add received tracks.')
const stream = new MediaStream()
for (const track of mediaStream) {
stream.addTrack(track)
}
if (isMediaStreamValid(stream)) {
return stream
}
}
logger.error('MediaStream must have 1 audio track and 1 video track, or at least one of them.')
throw new Error('MediaStream must have 1 audio track and 1 video track, or at least one of them.')
}
const instanceRTCPeerConnection = (instanceClass, config) => {
const instance = new RTCPeerConnection(config)
addPeerEvents(instanceClass, instance)
return instance
}
/**
* Emits peer events.
* @param {PeerConnection} instanceClass - PeerConnection instance.
* @param {RTCPeerConnection} peer - Peer instance.
* @fires PeerConnection#track
* @fires PeerConnection#connectionStateChange
*/
const addPeerEvents = (instanceClass, peer) => {
peer.ontrack = (event) => {
logger.info('New track from peer.')
logger.debug('Track event value: ', event)
/**
* New track event.
*
* @event PeerConnection#track
* @type {RTCTrackEvent}
*/
instanceClass.emit(webRTCEvents.track, event)
}
if (peer.connectionState) {
peer.onconnectionstatechange = (event) => {
logger.info('Peer connection state change: ', peer.connectionState)
/**
* Peer connection state change. Could be new, connecting, connected, disconnected, failed or closed.
*
* @event PeerConnection#connectionStateChange
* @type {RTCPeerConnectionState}
*/
instanceClass.emit(webRTCEvents.connectionStateChange, peer.connectionState)
}
} else {
// ConnectionStateChange does not exists in Firefox.
peer.oniceconnectionstatechange = (event) => {
logger.info('Peer ICE connection state change: ', peer.iceConnectionState)
/**
* @fires PeerConnection#connectionStateChange
*/
instanceClass.emit(webRTCEvents.connectionStateChange, peer.iceConnectionState)
}
}
peer.onnegotiationneeded = async (event) => {
if (!peer.remoteDescription) return
logger.info('Peer onnegotiationneeded, updating local description')
const offer = await peer.createOffer()
logger.info('Peer onnegotiationneeded, got local offer', offer.sdp)
offer.sdp = SdpParser.updateMissingVideoExtensions(offer.sdp, peer.remoteDescription.sdp)
await peer.setLocalDescription(offer)
const sdp = SdpParser.renegotiate(offer.sdp, peer.remoteDescription.sdp)
logger.info('Peer onnegotiationneeded, updating remote description', sdp)
await peer.setRemoteDescription({ type: 'answer', sdp })
logger.info('Peer onnegotiationneeded, renegotiation done')
}
}
const addMediaStreamToPeer = (peer, mediaStream, options) => {
logger.info('Adding mediaStream tracks to RTCPeerConnection')
for (const track of mediaStream.getTracks()) {
const initOptions = {
streams: [mediaStream]
}
if (track.kind === 'audio') {
initOptions.direction = !options.disableAudio ? 'sendonly' : 'inactive'
}
if (track.kind === 'video') {
initOptions.direction = !options.disableVideo ? 'sendonly' : 'inactive'
if (options.scalabilityMode && new UserAgent().isChrome()) {
logger.debug(`Video track with scalability mode: ${options.scalabilityMode}.`)
initOptions.sendEncodings = [
{ scalabilityMode: options.scalabilityMode }
]
} else if (options.scalabilityMode) {
logger.warn('SVC is only supported in Google Chrome')
}
}
peer.addTransceiver(track, initOptions)
logger.info(`Track '${track.label}' added: `, `id: ${track.id}`, `kind: ${track.kind}`)
}
}
const addReceiveTransceivers = (peer, options) => {
const browserData = new UserAgent()
if (!options.disableVideo) {
const transceiver = peer.addTransceiver('video', {
direction: 'recvonly'
})
if (browserData.isOpera()) {
transceiver.setCodecPreferences(RTCRtpReceiver
.getCapabilities('video')
.codecs
.filter(codec => codec.mimeType !== 'video/H264' || codec.sdpFmtpLine.includes('profile-level-id=4')))
}
}
if (!options.disableAudio) {
peer.addTransceiver('audio', {
direction: 'recvonly'
})
}
for (let i = 0; i < options.multiplexedAudioTracks; i++) {
peer.addTransceiver('audio', {
direction: 'recvonly'
})
}
}
const getTransceiverWithMid = async (transceiver, streams, retries = 0) => {
return new Promise((resolve, reject) => {
if (transceiver.mid) {
for (const stream of streams) {
stream.addTrack(transceiver.receiver.track)
}
resolve(transceiver)
} else if (retries >= 10) {
reject(new Error('Error, maximum number of retries has been reached'))
} else {
retries++
setTimeout(() => {
getTransceiverWithMid(transceiver, streams, retries)
.then(resolve)
.catch(reject)
}, 50)
}
})
}
const getConnectionState = (peer) => {
const connectionState = peer.connectionState ?? peer.iceConnectionState
switch (connectionState) {
case 'checking':
return 'connecting'
case 'completed':
return 'connected'
default:
return connectionState
}
}
</code></pre>
</article>
</section>
</div>
<footer class="footer" id="footer">
</footer>
<script src="scripts/third-party/prettify.js"></script>
<script src="scripts/third-party/lang-css.js"></script>
<script type="text/javascript" src="scripts/misc.js"></script>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
<script src="scripts/fix-code-block.js"></script>
<script src="scripts/fix-navbar.js"></script>
<script src="scripts/search.js"></script>
<script src="scripts/third-party/fuse.js"></script>
<script>
var list = [{"title":"Director","link":"<a href=\"module-Director.html\">Director</a>"},{"title":"module:Director~getEndpoint","link":"<a href=\"module-Director.html#~getEndpoint\">module:Director~getEndpoint ▸ undefined</a>"},{"title":"module:Director~getLiveDomain","link":"<a href=\"module-Director.html#~getLiveDomain\">module:Director~getLiveDomain ▸ undefined</a>"},{"title":"module:Director~getPublisher","link":"<a href=\"module-Director.html#~getPublisher\">module:Director~getPublisher ▸ undefined</a>"},{"title":"module:Director~getSubscriber","link":"<a href=\"module-Director.html#~getSubscriber\">module:Director~getSubscriber ▸ undefined</a>"},{"title":"module:Director~setEndpoint","link":"<a href=\"module-Director.html#~setEndpoint\">module:Director~setEndpoint ▸ undefined</a>"},{"title":"module:Director~setLiveDomain","link":"<a href=\"module-Director.html#~setLiveDomain\">module:Director~setLiveDomain ▸ undefined</a>"},{"title":"Logger","link":"<a href=\"module-Logger.html\">Logger</a>"},{"title":"module:Logger~get","link":"<a href=\"module-Logger.html#~get\">module:Logger~get ▸ undefined</a>"},{"title":"module:Logger~getHistory","link":"<a href=\"module-Logger.html#~getHistory\">module:Logger~getHistory ▸ undefined</a>"},{"title":"module:Logger~getHistoryMaxSize","link":"<a href=\"module-Logger.html#~getHistoryMaxSize\">module:Logger~getHistoryMaxSize ▸ undefined</a>"},{"title":"module:Logger~getLevel","link":"<a href=\"module-Logger.html#~getLevel\">module:Logger~getLevel ▸ undefined</a>"},{"title":"module:Logger~setHandler","link":"<a href=\"module-Logger.html#~setHandler\">module:Logger~setHandler ▸ undefined</a>"},{"title":"module:Logger~setHistoryMaxSize","link":"<a href=\"module-Logger.html#~setHistoryMaxSize\">module:Logger~setHistoryMaxSize ▸ undefined</a>"},{"title":"module:Logger~setLevel","link":"<a href=\"module-Logger.html#~setLevel\">module:Logger~setLevel ▸ undefined</a>"},{"title":"SdpParser","link":"<a href=\"module-SdpParser.html\">SdpParser</a>"},{"title":"module:SdpParser~adaptCodecName","link":"<a href=\"module-SdpParser.html#~adaptCodecName\">module:SdpParser~adaptCodecName ▸ undefined</a>"},{"title":"module:SdpParser~getAvailableHeaderExtensionIdRange","link":"<a href=\"module-SdpParser.html#~getAvailableHeaderExtensionIdRange\">module:SdpParser~getAvailableHeaderExtensionIdRange ▸ undefined</a>"},{"title":"module:SdpParser~getAvailablePayloadTypeRange","link":"<a href=\"module-SdpParser.html#~getAvailablePayloadTypeRange\">module:SdpParser~getAvailablePayloadTypeRange ▸ undefined</a>"},{"title":"module:SdpParser~removeSdpLine","link":"<a href=\"module-SdpParser.html#~removeSdpLine\">module:SdpParser~removeSdpLine ▸ undefined</a>"},{"title":"module:SdpParser~renegotiate","link":"<a href=\"module-SdpParser.html#~renegotiate\">module:SdpParser~renegotiate ▸ undefined</a>"},{"title":"module:SdpParser~setAbsoluteCaptureTime","link":"<a href=\"module-SdpParser.html#~setAbsoluteCaptureTime\">module:SdpParser~setAbsoluteCaptureTime ▸ undefined</a>"},{"title":"module:SdpParser~setDependencyDescriptor","link":"<a href=\"module-SdpParser.html#~setDependencyDescriptor\">module:SdpParser~setDependencyDescriptor ▸ undefined</a>"},{"title":"module:SdpParser~setDTX","link":"<a href=\"module-SdpParser.html#~setDTX\">module:SdpParser~setDTX ▸ undefined</a>"},{"title":"module:SdpParser~setMultiopus","link":"<a href=\"module-SdpParser.html#~setMultiopus\">module:SdpParser~setMultiopus ▸ undefined</a>"},{"title":"module:SdpParser~setSimulcast","link":"<a href=\"module-SdpParser.html#~setSimulcast\">module:SdpParser~setSimulcast ▸ undefined</a>"},{"title":"module:SdpParser~setStereo","link":"<a href=\"module-SdpParser.html#~setStereo\">module:SdpParser~setStereo ▸ undefined</a>"},{"title":"module:SdpParser~setVideoBitrate","link":"<a href=\"module-SdpParser.html#~setVideoBitrate\">module:SdpParser~setVideoBitrate ▸ undefined</a>"},{"title":"module:SdpParser~updateMissingVideoExtensions","link":"<a href=\"module-SdpParser.html#~updateMissingVideoExtensions\">module:SdpParser~updateMissingVideoExtensions ▸ undefined</a>"},{"title":"BaseWebRTC","link":"<a href=\"BaseWebRTC.html\">BaseWebRTC</a>"},{"title":"BaseWebRTC#getRTCPeerConnection","link":"<a href=\"BaseWebRTC.html#getRTCPeerConnection\">BaseWebRTC ▸ getRTCPeerConnection</a>"},{"title":"BaseWebRTC#isActive","link":"<a href=\"BaseWebRTC.html#isActive\">BaseWebRTC ▸ isActive</a>"},{"title":"BaseWebRTC#reconnect","link":"<a href=\"BaseWebRTC.html#reconnect\">BaseWebRTC ▸ reconnect</a>"},{"title":"BaseWebRTC#setReconnect","link":"<a href=\"BaseWebRTC.html#setReconnect\">BaseWebRTC ▸ setReconnect</a>"},{"title":"BaseWebRTC#stop","link":"<a href=\"BaseWebRTC.html#stop\">BaseWebRTC ▸ stop</a>"},{"title":"PeerConnection","link":"<a href=\"PeerConnection.html\">PeerConnection</a>"},{"title":"PeerConnection.getCapabilities","link":"<a href=\"PeerConnection.html#.getCapabilities\">PeerConnection ▸ getCapabilities</a>"},{"title":"PeerConnection#addRemoteTrack","link":"<a href=\"PeerConnection.html#addRemoteTrack\">PeerConnection ▸ addRemoteTrack</a>"},{"title":"PeerConnection#closeRTCPeer","link":"<a href=\"PeerConnection.html#closeRTCPeer\">PeerConnection ▸ closeRTCPeer</a>"},{"title":"PeerConnection#createRTCPeer","link":"<a href=\"PeerConnection.html#createRTCPeer\">PeerConnection ▸ createRTCPeer</a>"},{"title":"PeerConnection#getRTCLocalSDP","link":"<a href=\"PeerConnection.html#getRTCLocalSDP\">PeerConnection ▸ getRTCLocalSDP</a>"},{"title":"PeerConnection#getRTCPeer","link":"<a href=\"PeerConnection.html#getRTCPeer\">PeerConnection ▸ getRTCPeer</a>"},{"title":"PeerConnection#getRTCPeerStatus","link":"<a href=\"PeerConnection.html#getRTCPeerStatus\">PeerConnection ▸ getRTCPeerStatus</a>"},{"title":"PeerConnection#getTracks","link":"<a href=\"PeerConnection.html#getTracks\">PeerConnection ▸ getTracks</a>"},{"title":"PeerConnection#initStats","link":"<a href=\"PeerConnection.html#initStats\">PeerConnection ▸ initStats</a>"},{"title":"PeerConnection#replaceTrack","link":"<a href=\"PeerConnection.html#replaceTrack\">PeerConnection ▸ replaceTrack</a>"},{"title":"PeerConnection#setRTCRemoteSDP","link":"<a href=\"PeerConnection.html#setRTCRemoteSDP\">PeerConnection ▸ setRTCRemoteSDP</a>"},{"title":"PeerConnection#stopStats","link":"<a href=\"PeerConnection.html#stopStats\">PeerConnection ▸ stopStats</a>"},{"title":"PeerConnection#updateBandwidthRestriction","link":"<a href=\"PeerConnection.html#updateBandwidthRestriction\">PeerConnection ▸ updateBandwidthRestriction</a>"},{"title":"PeerConnection#updateBitrate","link":"<a href=\"PeerConnection.html#updateBitrate\">PeerConnection ▸ updateBitrate</a>"},{"title":"Publish","link":"<a href=\"Publish.html\">Publish</a>"},{"title":"Publish#connect","link":"<a href=\"Publish.html#connect\">Publish ▸ connect</a>"},{"title":"Publish#getRTCPeerConnection","link":"<a href=\"Publish.html#getRTCPeerConnection\">Publish ▸ getRTCPeerConnection</a>"},{"title":"Publish#isActive","link":"<a href=\"Publish.html#isActive\">Publish ▸ isActive</a>"},{"title":"Publish#reconnect","link":"<a href=\"Publish.html#reconnect\">Publish ▸ reconnect</a>"},{"title":"Publish#record","link":"<a href=\"Publish.html#record\">Publish ▸ record</a>"},{"title":"Publish#setReconnect","link":"<a href=\"Publish.html#setReconnect\">Publish ▸ setReconnect</a>"},{"title":"Publish#stop","link":"<a href=\"Publish.html#stop\">Publish ▸ stop</a>"},{"title":"Publish#unrecord","link":"<a href=\"Publish.html#unrecord\">Publish ▸ unrecord</a>"},{"title":"Signaling","link":"<a href=\"Signaling.html\">Signaling</a>"},{"title":"Signaling#close","link":"<a href=\"Signaling.html#close\">Signaling ▸ close</a>"},{"title":"Signaling#cmd","link":"<a href=\"Signaling.html#cmd\">Signaling ▸ cmd</a>"},{"title":"Signaling#connect","link":"<a href=\"Signaling.html#connect\">Signaling ▸ connect</a>"},{"title":"Signaling#publish","link":"<a href=\"Signaling.html#publish\">Signaling ▸ publish</a>"},{"title":"Signaling#subscribe","link":"<a href=\"Signaling.html#subscribe\">Signaling ▸ subscribe</a>"},{"title":"StreamEvents","link":"<a href=\"StreamEvents.html\">StreamEvents</a>"},{"title":"StreamEvents.getEventsLocation","link":"<a href=\"StreamEvents.html#.getEventsLocation\">StreamEvents ▸ getEventsLocation</a>"},{"title":"StreamEvents.init","link":"<a href=\"StreamEvents.html#.init\">StreamEvents ▸ init</a>"},{"title":"StreamEvents.setEventsLocation","link":"<a href=\"StreamEvents.html#.setEventsLocation\">StreamEvents ▸ setEventsLocation</a>"},{"title":"StreamEvents#onUserCount","link":"<a href=\"StreamEvents.html#onUserCount\">StreamEvents ▸ onUserCount</a>"},{"title":"StreamEvents#stop","link":"<a href=\"StreamEvents.html#stop\">StreamEvents ▸ stop</a>"},{"title":"View","link":"<a href=\"View.html\">View</a>"},{"title":"View#addRemoteTrack","link":"<a href=\"View.html#addRemoteTrack\">View ▸ addRemoteTrack</a>"},{"title":"View#connect","link":"<a href=\"View.html#connect\">View ▸ connect</a>"},{"title":"View#getRTCPeerConnection","link":"<a href=\"View.html#getRTCPeerConnection\">View ▸ getRTCPeerConnection</a>"},{"title":"View#isActive","link":"<a href=\"View.html#isActive\">View ▸ isActive</a>"},{"title":"View#project","link":"<a href=\"View.html#project\">View ▸ project</a>"},{"title":"View#reconnect","link":"<a href=\"View.html#reconnect\">View ▸ reconnect</a>"},{"title":"View#select","link":"<a href=\"View.html#select\">View ▸ select</a>"},{"title":"View#setReconnect","link":"<a href=\"View.html#setReconnect\">View ▸ setReconnect</a>"},{"title":"View#stop","link":"<a href=\"View.html#stop\">View ▸ stop</a>"},{"title":"View#unproject","link":"<a href=\"View.html#unproject\">View ▸ unproject</a>"},{"title":"reconnect","link":"<a href=\"BaseWebRTC.html#event:reconnect\">reconnect</a>"},{"title":"connectionStateChange","link":"<a href=\"PeerConnection.html#event:connectionStateChange\">connectionStateChange</a>"},{"title":"stats","link":"<a href=\"PeerConnection.html#event:stats\">stats</a>"},{"title":"track","link":"<a href=\"PeerConnection.html#event:track\">track</a>"},{"title":"reconnect","link":"<a href=\"Publish.html#event:reconnect\">reconnect</a>"},{"title":"broadcastEvent","link":"<a href=\"Signaling.html#event:broadcastEvent\">broadcastEvent</a>"},{"title":"wsConnectionClose","link":"<a href=\"Signaling.html#event:wsConnectionClose\">wsConnectionClose</a>"},{"title":"wsConnectionError","link":"<a href=\"Signaling.html#event:wsConnectionError\">wsConnectionError</a>"},{"title":"wsConnectionSuccess","link":"<a href=\"Signaling.html#event:wsConnectionSuccess\">wsConnectionSuccess</a>"},{"title":"reconnect","link":"<a href=\"View.html#event:reconnect\">reconnect</a>"},{"title":"addCandidateReport","link":"<a href=\"global.html#addCandidateReport\">addCandidateReport</a>"},{"title":"addInboundRtpReport","link":"<a href=\"global.html#addInboundRtpReport\">addInboundRtpReport</a>"},{"title":"addOutboundRtpReport","link":"<a href=\"global.html#addOutboundRtpReport\">addOutboundRtpReport</a>"},{"title":"addPeerEvents","link":"<a href=\"global.html#addPeerEvents\">addPeerEvents</a>"},{"title":"AudioCodec","link":"<a href=\"global.html#AudioCodec\">AudioCodec</a>"},{"title":"calculatePacketsLostDelta","link":"<a href=\"global.html#calculatePacketsLostDelta\">calculatePacketsLostDelta</a>"},{"title":"calculatePacketsLostRatio","link":"<a href=\"global.html#calculatePacketsLostRatio\">calculatePacketsLostRatio</a>"},{"title":"ConnectionStats","link":"<a href=\"global.html#ConnectionStats\">ConnectionStats</a>"},{"title":"DirectorPublisherOptions","link":"<a href=\"global.html#DirectorPublisherOptions\">DirectorPublisherOptions</a>"},{"title":"DirectorSubscriberOptions","link":"<a href=\"global.html#DirectorSubscriberOptions\">DirectorSubscriberOptions</a>"},{"title":"getBaseRtpReportData","link":"<a href=\"global.html#getBaseRtpReportData\">getBaseRtpReportData</a>"},{"title":"getCodecData","link":"<a href=\"global.html#getCodecData\">getCodecData</a>"},{"title":"getMediaType","link":"<a href=\"global.html#getMediaType\">getMediaType</a>"},{"title":"InboundStats","link":"<a href=\"global.html#InboundStats\">InboundStats</a>"},{"title":"LayerInfo","link":"<a href=\"global.html#LayerInfo\">LayerInfo</a>"},{"title":"loggerHandler","link":"<a href=\"global.html#loggerHandler\">loggerHandler</a>"},{"title":"LogLevel","link":"<a href=\"global.html#LogLevel\">LogLevel</a>"},{"title":"onUserCountCallback","link":"<a href=\"global.html#onUserCountCallback\">onUserCountCallback</a>"},{"title":"OnUserCountOptions","link":"<a href=\"global.html#OnUserCountOptions\">OnUserCountOptions</a>"},{"title":"OutboundStats","link":"<a href=\"global.html#OutboundStats\">OutboundStats</a>"},{"title":"SignalingPublishOptions","link":"<a href=\"global.html#SignalingPublishOptions\">SignalingPublishOptions</a>"},{"title":"SignalingSubscribeOptions","link":"<a href=\"global.html#SignalingSubscribeOptions\">SignalingSubscribeOptions</a>"},{"title":"tokenGeneratorCallback","link":"<a href=\"global.html#tokenGeneratorCallback\">tokenGeneratorCallback</a>"},{"title":"TrackReport","link":"<a href=\"global.html#TrackReport\">TrackReport</a>"},{"title":"VideoCodec","link":"<a href=\"global.html#VideoCodec\">VideoCodec</a>"},{"title":"WowzaCapability","link":"<a href=\"global.html#WowzaCapability\">WowzaCapability</a>"},{"title":"WowzaDirectorResponse","link":"<a href=\"global.html#WowzaDirectorResponse\">WowzaDirectorResponse</a>"}];
var options =
setupSearch(list, options)
</script>
</body>
</html>