|
@@ -361,11 +361,11 @@ export default class JingleSessionPC extends JingleSession {
|
361
|
361
|
}
|
362
|
362
|
|
363
|
363
|
/**
|
364
|
|
- * Handles either Jingle 'source-add' or 'source-remove' message for this
|
365
|
|
- * Jingle session.
|
366
|
|
- * @param {boolean} isAdd <tt>true</tt> for 'source-add' or <tt>false</tt>
|
367
|
|
- * otherwise.
|
|
364
|
+ * Handles either Jingle 'source-add' or 'source-remove' message for this Jingle session.
|
|
365
|
+ *
|
|
366
|
+ * @param {boolean} isAdd <tt>true</tt> for 'source-add' or <tt>false</tt> otherwise.
|
368
|
367
|
* @param {Array<Element>} elem an array of Jingle "content" elements.
|
|
368
|
+ * @returns {Promise} resolved when the operation is done or rejected with an error.
|
369
|
369
|
* @private
|
370
|
370
|
*/
|
371
|
371
|
_addOrRemoveRemoteStream(isAdd, elem) {
|
|
@@ -415,8 +415,10 @@ export default class JingleSessionPC extends JingleSession {
|
415
|
415
|
|
416
|
416
|
/**
|
417
|
417
|
* See {@link addTrackToPc} and {@link removeTrackFromPc}.
|
|
418
|
+ *
|
418
|
419
|
* @param {boolean} isRemove <tt>true</tt> for "remove" operation or <tt>false</tt> for "add" operation.
|
419
|
|
- * @param {JitsiLocalTrack} track the track that will be added/removed
|
|
420
|
+ * @param {JitsiLocalTrack} track the track that will be added/removed.
|
|
421
|
+ * @returns {Promise} resolved when the operation is done or rejected with an error.
|
420
|
422
|
* @private
|
421
|
423
|
*/
|
422
|
424
|
_addRemoveTrack(isRemove, track) {
|
|
@@ -474,22 +476,21 @@ export default class JingleSessionPC extends JingleSession {
|
474
|
476
|
|
475
|
477
|
/**
|
476
|
478
|
* Checks whether or not this session instance is still operational.
|
477
|
|
- * @private
|
|
479
|
+ *
|
478
|
480
|
* @returns {boolean} {@code true} if operation or {@code false} otherwise.
|
|
481
|
+ * @private
|
479
|
482
|
*/
|
480
|
483
|
_assertNotEnded() {
|
481
|
484
|
return this.state !== JingleSessionState.ENDED;
|
482
|
485
|
}
|
483
|
486
|
|
484
|
487
|
/**
|
485
|
|
- * Parse the information from the xml sourceAddElem and translate it
|
486
|
|
- * into sdp lines
|
487
|
|
- * @param {jquery xml element} sourceAddElem the source-add
|
488
|
|
- * element from jingle
|
489
|
|
- * @param {SDP object} currentRemoteSdp the current remote
|
490
|
|
- * sdp (as of this new source-add)
|
491
|
|
- * @returns {list} a list of SDP line strings that should
|
492
|
|
- * be added to the remote SDP
|
|
488
|
+ * Parse the information from the xml sourceAddElem and translate it into sdp lines.
|
|
489
|
+ *
|
|
490
|
+ * @param {jquery xml element} sourceAddElem the source-add element from jingle.
|
|
491
|
+ * @param {SDP object} currentRemoteSdp the current remote sdp (as of this new source-add).
|
|
492
|
+ * @returns {list} a list of SDP line strings that should be added to the remote SDP.
|
|
493
|
+ * @private
|
493
|
494
|
*/
|
494
|
495
|
_parseSsrcInfoFromSourceAdd(sourceAddElem, currentRemoteSdp) {
|
495
|
496
|
const addSsrcInfo = [];
|
|
@@ -570,14 +571,12 @@ export default class JingleSessionPC extends JingleSession {
|
570
|
571
|
}
|
571
|
572
|
|
572
|
573
|
/**
|
573
|
|
- * Parse the information from the xml sourceRemoveElem and translate it
|
574
|
|
- * into sdp lines
|
575
|
|
- * @param {jquery xml element} sourceRemoveElem the source-remove
|
576
|
|
- * element from jingle
|
577
|
|
- * @param {SDP object} currentRemoteSdp the current remote
|
578
|
|
- * sdp (as of this new source-remove)
|
579
|
|
- * @returns {list} a list of SDP line strings that should
|
580
|
|
- * be removed from the remote SDP
|
|
574
|
+ * Parse the information from the xml sourceRemoveElem and translate it into sdp lines.
|
|
575
|
+ *
|
|
576
|
+ * @param {jquery xml element} sourceRemoveElem the source-remove element from jingle.
|
|
577
|
+ * @param {SDP object} currentRemoteSdp the current remote sdp (as of this new source-remove).
|
|
578
|
+ * @returns {list} a list of SDP line strings that should be removed from the remote SDP.
|
|
579
|
+ * @private
|
581
|
580
|
*/
|
582
|
581
|
_parseSsrcInfoFromSourceRemove(sourceRemoveElem, currentRemoteSdp) {
|
583
|
582
|
const removeSsrcInfo = [];
|
|
@@ -643,9 +642,12 @@ export default class JingleSessionPC extends JingleSession {
|
643
|
642
|
}
|
644
|
643
|
|
645
|
644
|
/**
|
646
|
|
- * Takes in a jingle offer iq, returns the new sdp offer
|
647
|
|
- * @param {jquery xml element} offerIq the incoming offer
|
648
|
|
- * @returns {SDP object} the jingle offer translated to SDP
|
|
645
|
+ * Takes in a jingle offer iq, returns the new sdp offer that can be set as remote description in the
|
|
646
|
+ * peerconnection.
|
|
647
|
+ *
|
|
648
|
+ * @param {jquery xml element} offerIq the incoming offer.
|
|
649
|
+ * @returns {SDP object} the jingle offer translated to SDP.
|
|
650
|
+ * @private
|
649
|
651
|
*/
|
650
|
652
|
_processNewJingleOfferIq(offerIq) {
|
651
|
653
|
const remoteSdp = new SDP('');
|
|
@@ -667,11 +669,11 @@ export default class JingleSessionPC extends JingleSession {
|
667
|
669
|
}
|
668
|
670
|
|
669
|
671
|
/**
|
670
|
|
- * Add the given ssrc lines to the current remote sdp
|
671
|
|
- * @param {list} addSsrcInfo a list of SDP line strings that
|
672
|
|
- * should be added to the remote SDP
|
673
|
|
- * @returns type {SDP Object} the new remote SDP (after removing the lines
|
674
|
|
- * in removeSsrcInfo
|
|
672
|
+ * Adds the given ssrc lines to the current remote sdp.
|
|
673
|
+ *
|
|
674
|
+ * @param {list} addSsrcInfo a list of SDP line strings that should be added to the remote SDP.
|
|
675
|
+ * @returns type {SDP Object} the new remote SDP (after removing the lines in removeSsrcInfo.
|
|
676
|
+ * @private
|
675
|
677
|
*/
|
676
|
678
|
_processRemoteAddSource(addSsrcInfo) {
|
677
|
679
|
let remoteSdp = new SDP(this.peerconnection.remoteDescription.sdp);
|
|
@@ -703,11 +705,11 @@ export default class JingleSessionPC extends JingleSession {
|
703
|
705
|
}
|
704
|
706
|
|
705
|
707
|
/**
|
706
|
|
- * Remove the given ssrc lines from the current remote sdp
|
707
|
|
- * @param {list} removeSsrcInfo a list of SDP line strings that
|
708
|
|
- * should be removed from the remote SDP
|
709
|
|
- * @returns type {SDP Object} the new remote SDP (after removing the lines
|
710
|
|
- * in removeSsrcInfo
|
|
708
|
+ * Removes the given ssrc lines from the current remote sdp.
|
|
709
|
+ *
|
|
710
|
+ * @param {list} removeSsrcInfo a list of SDP line strings that should be removed from the remote SDP.
|
|
711
|
+ * @returns type {SDP Object} the new remote SDP (after removing the lines in removeSsrcInfo.
|
|
712
|
+ * @private
|
711
|
713
|
*/
|
712
|
714
|
_processRemoteRemoveSource(removeSsrcInfo) {
|
713
|
715
|
const remoteSdp = new SDP(this.peerconnection.peerconnection.remoteDescription.sdp);
|
|
@@ -765,6 +767,7 @@ export default class JingleSessionPC extends JingleSession {
|
765
|
767
|
* peerconnection will be used.
|
766
|
768
|
* @returns {Promise} promise which resolves when the o/a flow is complete with no arguments or rejects with an
|
767
|
769
|
* error {string}
|
|
770
|
+ * @private
|
768
|
771
|
*/
|
769
|
772
|
_renegotiate(optionalRemoteSdp) {
|
770
|
773
|
if (this.peerconnection.signalingState === 'closed') {
|
|
@@ -924,7 +927,9 @@ export default class JingleSessionPC extends JingleSession {
|
924
|
927
|
|
925
|
928
|
/**
|
926
|
929
|
* Handles a Jingle source-add message for this Jingle session.
|
927
|
|
- * @param elem An array of Jingle "content" elements.
|
|
930
|
+ *
|
|
931
|
+ * @param {Array<Element>} elem an array of Jingle "content" elements.
|
|
932
|
+ * @returns {Promise} resolved when the operation is done or rejected with an error.
|
928
|
933
|
*/
|
929
|
934
|
addRemoteStream(elem) {
|
930
|
935
|
this._addOrRemoveRemoteStream(true /* add */, elem);
|
|
@@ -1006,10 +1011,12 @@ export default class JingleSessionPC extends JingleSession {
|
1006
|
1011
|
|
1007
|
1012
|
/**
|
1008
|
1013
|
* Adds local track back to the peerconnection associated with this session.
|
1009
|
|
- * @param {JitsiLocalTrack} track
|
|
1014
|
+ *
|
|
1015
|
+ * @param {JitsiLocalTrack} track - the local track to be added back to the peerconnection.
|
1010
|
1016
|
* @return {Promise} a promise that will resolve once the local track is added back to this session and
|
1011
|
1017
|
* renegotiation succeeds (if its warranted). Will be rejected with a <tt>string</tt> that provides some error
|
1012
|
1018
|
* details in case something goes wrong.
|
|
1019
|
+ * @returns {Promise<void>}
|
1013
|
1020
|
*/
|
1014
|
1021
|
addTrackToPc(track) {
|
1015
|
1022
|
return this._addRemoveTrack(false /* add */, track)
|
|
@@ -1023,7 +1030,9 @@ export default class JingleSessionPC extends JingleSession {
|
1023
|
1030
|
}
|
1024
|
1031
|
|
1025
|
1032
|
/**
|
1026
|
|
- * Closes the peerconnection.
|
|
1033
|
+ * Closes the underlying peerconnection and shuts down the modification queue.
|
|
1034
|
+ *
|
|
1035
|
+ * @returns {void}
|
1027
|
1036
|
*/
|
1028
|
1037
|
close() {
|
1029
|
1038
|
this.state = JingleSessionState.ENDED;
|
|
@@ -1058,6 +1067,7 @@ export default class JingleSessionPC extends JingleSession {
|
1058
|
1067
|
/**
|
1059
|
1068
|
* @inheritDoc
|
1060
|
1069
|
* @param {JingleSessionPCOptions} options - a set of config options.
|
|
1070
|
+ * @returns {void}
|
1061
|
1071
|
*/
|
1062
|
1072
|
doInitialize(options) {
|
1063
|
1073
|
this.failICE = Boolean(options.failICE);
|
|
@@ -1350,6 +1360,7 @@ export default class JingleSessionPC extends JingleSession {
|
1350
|
1360
|
|
1351
|
1361
|
/**
|
1352
|
1362
|
* Returns the ice connection state for the peer connection.
|
|
1363
|
+ *
|
1353
|
1364
|
* @returns the ice connection state for the peer connection.
|
1354
|
1365
|
*/
|
1355
|
1366
|
getIceConnectionState() {
|
|
@@ -1357,20 +1368,7 @@ export default class JingleSessionPC extends JingleSession {
|
1357
|
1368
|
}
|
1358
|
1369
|
|
1359
|
1370
|
/**
|
1360
|
|
- * Remote preference for receive video max frame height.
|
1361
|
|
- *
|
1362
|
|
- * @returns {Number|undefined}
|
1363
|
|
- */
|
1364
|
|
- getRemoteRecvMaxFrameHeight() {
|
1365
|
|
- if (this.isP2P) {
|
1366
|
|
- return this.remoteRecvMaxFrameHeight;
|
1367
|
|
- }
|
1368
|
|
-
|
1369
|
|
- return undefined;
|
1370
|
|
- }
|
1371
|
|
-
|
1372
|
|
- /**
|
1373
|
|
- * Remote preference for receive video max frame heights when source-name signaling is enabled.
|
|
1371
|
+ * Returns the preference for max frame height for the remote video sources.
|
1374
|
1372
|
*
|
1375
|
1373
|
* @returns {Map<string, number>|undefined}
|
1376
|
1374
|
*/
|
|
@@ -1387,6 +1385,7 @@ export default class JingleSessionPC extends JingleSession {
|
1387
|
1385
|
*
|
1388
|
1386
|
* @param {Array<JitsiLocalTrack>} localTracks the local tracks that will be added, before the offer/answer cycle
|
1389
|
1387
|
* executes (for the local track addition to be an atomic operation together with the offer/answer).
|
|
1388
|
+ * @returns {void}
|
1390
|
1389
|
*/
|
1391
|
1390
|
invite(localTracks = []) {
|
1392
|
1391
|
if (!this.isInitiator) {
|
|
@@ -1419,6 +1418,9 @@ export default class JingleSessionPC extends JingleSession {
|
1419
|
1418
|
* Enables/disables local video based on 'senders' attribute of the video conent in 'content-modify' IQ sent by the
|
1420
|
1419
|
* remote peer. Also, checks if the sourceMaxFrameHeight (as requested by the p2p peer) or the senders attribute of
|
1421
|
1420
|
* the video content has changed and modifies the local video resolution accordingly.
|
|
1421
|
+ *
|
|
1422
|
+ * @param {Element} jingleContents - The content of the 'content-modify' IQ sent by the remote peer.
|
|
1423
|
+ * @returns {void}
|
1422
|
1424
|
*/
|
1423
|
1425
|
modifyContents(jingleContents) {
|
1424
|
1426
|
const newVideoSenders = JingleSessionPC.parseVideoSenders(jingleContents);
|
|
@@ -1454,9 +1456,8 @@ export default class JingleSessionPC extends JingleSession {
|
1454
|
1456
|
}
|
1455
|
1457
|
|
1456
|
1458
|
/**
|
1457
|
|
- * Method returns function(errorResponse) which is a callback to be passed
|
1458
|
|
- * to Strophe connection.sendIQ method. An 'error' structure is created that
|
1459
|
|
- * is passed as 1st argument to given <tt>failureCb</tt>. The format of this
|
|
1459
|
+ * Method returns function(errorResponse) which is a callback to be passed to Strophe connection.sendIQ method. An
|
|
1460
|
+ * 'error' structure is created that is passed as 1st argument to given <tt>failureCb</tt>. The format of this
|
1460
|
1461
|
* structure is as follows:
|
1461
|
1462
|
* {
|
1462
|
1463
|
* code: {XMPP error response code}
|
|
@@ -1465,10 +1466,8 @@ export default class JingleSessionPC extends JingleSession {
|
1465
|
1466
|
* source: {request.tree() that provides original request}
|
1466
|
1467
|
* session: {this JingleSessionPC.toString()}
|
1467
|
1468
|
* }
|
1468
|
|
- * @param request Strophe IQ instance which is the request to be dumped into
|
1469
|
|
- * the error structure
|
1470
|
|
- * @param failureCb function(error) called when error response was returned
|
1471
|
|
- * or when a timeout has occurred.
|
|
1469
|
+ * @param request Strophe IQ instance which is the request to be dumped into the error structure.
|
|
1470
|
+ * @param failureCb function(error) called when error response was returned or when a timeout has occurred.
|
1472
|
1471
|
* @returns {function(this:JingleSessionPC)}
|
1473
|
1472
|
*/
|
1474
|
1473
|
newJingleErrorHandler(request, failureCb) {
|
|
@@ -1517,9 +1516,11 @@ export default class JingleSessionPC extends JingleSession {
|
1517
|
1516
|
}
|
1518
|
1517
|
|
1519
|
1518
|
/**
|
1520
|
|
- * Figures out added/removed ssrcs and send update IQs.
|
|
1519
|
+ * Figures out added/removed ssrcs and sends updated IQs to the remote peer or Jicofo.
|
|
1520
|
+ *
|
1521
|
1521
|
* @param oldSDP SDP object for old description.
|
1522
|
1522
|
* @param newSDP SDP object for new description.
|
|
1523
|
+ * @returns {void}
|
1523
|
1524
|
*/
|
1524
|
1525
|
notifyMySSRCUpdate(oldSDP, newSDP) {
|
1525
|
1526
|
if (this.state !== JingleSessionState.ACTIVE) {
|
|
@@ -1628,9 +1629,11 @@ export default class JingleSessionPC extends JingleSession {
|
1628
|
1629
|
}
|
1629
|
1630
|
|
1630
|
1631
|
/**
|
|
1632
|
+ * Handles the termination of the session.
|
1631
|
1633
|
*
|
1632
|
|
- * @param reasonCondition
|
1633
|
|
- * @param reasonText
|
|
1634
|
+ * @param {string} reasonCondition - The XMPP Jingle reason condition.
|
|
1635
|
+ * @param {string} reasonText - The XMPP Jingle reason text.
|
|
1636
|
+ * @returns {void}
|
1634
|
1637
|
*/
|
1635
|
1638
|
onTerminated(reasonCondition, reasonText) {
|
1636
|
1639
|
// Do something with reason and reasonCondition when we start to care
|
|
@@ -1655,9 +1658,11 @@ export default class JingleSessionPC extends JingleSession {
|
1655
|
1658
|
}
|
1656
|
1659
|
|
1657
|
1660
|
/**
|
1658
|
|
- * Handles XMPP connection state changes.
|
|
1661
|
+ * Handles XMPP connection state changes. Resends any session updates that were cached while the XMPP connection
|
|
1662
|
+ * was down.
|
1659
|
1663
|
*
|
1660
|
1664
|
* @param {XmppConnection.Status} status - The new status.
|
|
1665
|
+ * @returns {void}
|
1661
|
1666
|
*/
|
1662
|
1667
|
onXmppStatusChanged(status) {
|
1663
|
1668
|
if (status === XmppConnection.Status.CONNECTED && this._cachedOldLocalSdp) {
|
|
@@ -1773,8 +1778,11 @@ export default class JingleSessionPC extends JingleSession {
|
1773
|
1778
|
}
|
1774
|
1779
|
|
1775
|
1780
|
/**
|
|
1781
|
+ * Processes the Jingle message received from the peer and updates the SSRC owners for all the sources signaled
|
|
1782
|
+ * in the Jingle message.
|
1776
|
1783
|
*
|
1777
|
|
- * @param contents
|
|
1784
|
+ * @param {Element} contents - The content element of the jingle message.
|
|
1785
|
+ * @returns {void}
|
1778
|
1786
|
*/
|
1779
|
1787
|
readSsrcInfo(contents) {
|
1780
|
1788
|
const ssrcs = $(contents).find('>description>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
|
|
@@ -1810,7 +1818,9 @@ export default class JingleSessionPC extends JingleSession {
|
1810
|
1818
|
|
1811
|
1819
|
/**
|
1812
|
1820
|
* Handles a Jingle source-remove message for this Jingle session.
|
1813
|
|
- * @param elem An array of Jingle "content" elements.
|
|
1821
|
+ *
|
|
1822
|
+ * @param {Array<Element>} contents - An array of content elements from the source-remove message.
|
|
1823
|
+ * @returns {void}
|
1814
|
1824
|
*/
|
1815
|
1825
|
removeRemoteStream(elem) {
|
1816
|
1826
|
this._addOrRemoveRemoteStream(false /* remove */, elem);
|
|
@@ -1850,28 +1860,25 @@ export default class JingleSessionPC extends JingleSession {
|
1850
|
1860
|
}
|
1851
|
1861
|
|
1852
|
1862
|
/**
|
1853
|
|
- * Remove local track as part of the mute operation.
|
1854
|
|
- * @param {JitsiLocalTrack} track the local track to be removed
|
1855
|
|
- * @return {Promise} a promise which will be resolved once the local track
|
1856
|
|
- * is removed from this session and the renegotiation is performed.
|
1857
|
|
- * The promise will be rejected with a <tt>string</tt> that the describes
|
1858
|
|
- * the error if anything goes wrong.
|
|
1863
|
+ * Removes local track from the peerconnection as part of the mute operation.
|
|
1864
|
+ *
|
|
1865
|
+ * @param {JitsiLocalTrack} track the local track to be removed.
|
|
1866
|
+ * @return {Promise} a promise which will be resolved once the local track is removed from this session or rejected
|
|
1867
|
+ * with a <tt>string</tt> that the describes the error if anything goes wrong.
|
1859
|
1868
|
*/
|
1860
|
1869
|
removeTrackFromPc(track) {
|
1861
|
1870
|
return this._addRemoveTrack(true /* remove */, track);
|
1862
|
1871
|
}
|
1863
|
1872
|
|
1864
|
1873
|
/**
|
1865
|
|
- * Replaces <tt>oldTrack</tt> with <tt>newTrack</tt> and performs a single
|
1866
|
|
- * offer/answer cycle after both operations are done. Either
|
1867
|
|
- * <tt>oldTrack</tt> or <tt>newTrack</tt> can be null; replacing a valid
|
1868
|
|
- * <tt>oldTrack</tt> with a null <tt>newTrack</tt> effectively just removes
|
1869
|
|
- * <tt>oldTrack</tt>
|
1870
|
|
- * @param {JitsiLocalTrack|null} oldTrack the current track in use to be
|
1871
|
|
- * replaced
|
1872
|
|
- * @param {JitsiLocalTrack|null} newTrack the new track to use
|
1873
|
|
- * @returns {Promise} which resolves once the replacement is complete
|
1874
|
|
- * with no arguments or rejects with an error {string}
|
|
1874
|
+ * Replaces <tt>oldTrack</tt> with <tt>newTrack</tt> and performs a single offer/answer cycle (if needed) after
|
|
1875
|
+ * both operations are done.
|
|
1876
|
+ * <tt>oldTrack</tt> or <tt>newTrack</tt> can be null; replacing a valid <tt>oldTrack</tt> with a null
|
|
1877
|
+ * <tt>newTrack</tt> effectively just removes <tt>oldTrack</tt>.
|
|
1878
|
+ *
|
|
1879
|
+ * @param {JitsiLocalTrack|null} oldTrack the current track in use to be replaced.
|
|
1880
|
+ * @param {JitsiLocalTrack|null} newTrack the new track to use.
|
|
1881
|
+ * @returns {Promise} which resolves once the replacement is complete with no arguments or rejects with an error.
|
1875
|
1882
|
*/
|
1876
|
1883
|
replaceTrack(oldTrack, newTrack) {
|
1877
|
1884
|
const workFunction = finishedCallback => {
|
|
@@ -1923,8 +1930,10 @@ export default class JingleSessionPC extends JingleSession {
|
1923
|
1930
|
}
|
1924
|
1931
|
|
1925
|
1932
|
/**
|
1926
|
|
- * Will send 'content-modify' IQ in order to ask the remote peer to
|
1927
|
|
- * either stop or resume sending video media or to adjust sender's video constraints.
|
|
1933
|
+ * Sends 'content-modify' IQ in order to ask the remote peer to either stop or resume sending video media or to
|
|
1934
|
+ * adjust sender's video constraints.
|
|
1935
|
+ *
|
|
1936
|
+ * @returns {void}
|
1928
|
1937
|
* @private
|
1929
|
1938
|
*/
|
1930
|
1939
|
sendContentModify() {
|
|
@@ -1970,8 +1979,10 @@ export default class JingleSessionPC extends JingleSession {
|
1970
|
1979
|
|
1971
|
1980
|
/**
|
1972
|
1981
|
* Sends given candidate in Jingle 'transport-info' message.
|
|
1982
|
+ *
|
1973
|
1983
|
* @param {RTCIceCandidate} candidate the WebRTC ICE candidate instance
|
1974
|
1984
|
* @private
|
|
1985
|
+ * @returns {void}
|
1975
|
1986
|
*/
|
1976
|
1987
|
sendIceCandidate(candidate) {
|
1977
|
1988
|
const localSDP = new SDP(this.peerconnection.localDescription.sdp);
|
|
@@ -2011,8 +2022,9 @@ export default class JingleSessionPC extends JingleSession {
|
2011
|
2022
|
|
2012
|
2023
|
/**
|
2013
|
2024
|
* Sends given candidates in Jingle 'transport-info' message.
|
2014
|
|
- * @param {Array<RTCIceCandidate>} candidates an array of the WebRTC ICE
|
2015
|
|
- * candidate instances
|
|
2025
|
+ *
|
|
2026
|
+ * @param {Array<RTCIceCandidate>} candidates an array of the WebRTC ICE candidate instances.
|
|
2027
|
+ * @returns {void}
|
2016
|
2028
|
* @private
|
2017
|
2029
|
*/
|
2018
|
2030
|
sendIceCandidates(candidates) {
|
|
@@ -2090,10 +2102,10 @@ export default class JingleSessionPC extends JingleSession {
|
2090
|
2102
|
|
2091
|
2103
|
/**
|
2092
|
2104
|
* Sends Jingle 'session-accept' message.
|
2093
|
|
- * @param {function()} success callback called when we receive 'RESULT'
|
2094
|
|
- * packet for the 'session-accept'
|
2095
|
|
- * @param {function(error)} failure called when we receive an error response
|
2096
|
|
- * or when the request has timed out.
|
|
2105
|
+ *
|
|
2106
|
+ * @param {function()} success callback called when we receive 'RESULT' packet for the 'session-accept'.
|
|
2107
|
+ * @param {function(error)} failure called when we receive an error response or when the request has timed out.
|
|
2108
|
+ * @returns {void}
|
2097
|
2109
|
* @private
|
2098
|
2110
|
*/
|
2099
|
2111
|
sendSessionAccept(success, failure) {
|
|
@@ -2165,8 +2177,8 @@ export default class JingleSessionPC extends JingleSession {
|
2165
|
2177
|
* NOTE this method is synchronous and we're not waiting for the RESULT
|
2166
|
2178
|
* response which would delay the startup process.
|
2167
|
2179
|
*
|
2168
|
|
- * @param {string} offerSdp - The local session description which will be
|
2169
|
|
- * used to generate an offer.
|
|
2180
|
+ * @param {string} offerSdp - The local session description which will be used to generate an offer.
|
|
2181
|
+ * @returns {void}
|
2170
|
2182
|
* @private
|
2171
|
2183
|
*/
|
2172
|
2184
|
sendSessionInitiate(offerSdp) {
|
|
@@ -2198,7 +2210,9 @@ export default class JingleSessionPC extends JingleSession {
|
2198
|
2210
|
/**
|
2199
|
2211
|
* Sets the answer received from the remote peer as the remote description.
|
2200
|
2212
|
*
|
2201
|
|
- * @param jingleAnswer
|
|
2213
|
+ * @param {Element} jingleAnswer - The jingle answer element.
|
|
2214
|
+ * @returns {void}
|
|
2215
|
+ * @throws {Error} if the method is called on a responder session.
|
2202
|
2216
|
*/
|
2203
|
2217
|
setAnswer(jingleAnswer) {
|
2204
|
2218
|
if (!this.isInitiator) {
|
|
@@ -2238,7 +2252,7 @@ export default class JingleSessionPC extends JingleSession {
|
2238
|
2252
|
/**
|
2239
|
2253
|
* Resumes or suspends media transfer over the underlying peer connection.
|
2240
|
2254
|
*
|
2241
|
|
- * @param {boolean} active - <tt>true</tt> to enable media transfer or <tt>false</tt> to suspend media transmission
|
|
2255
|
+ * @param {boolean} active - <tt>true</tt> to enable media transfer or <tt>false</tt> to suspend media transmission.
|
2242
|
2256
|
* @returns {Promise}
|
2243
|
2257
|
*/
|
2244
|
2258
|
setMediaTransferActive(active) {
|
|
@@ -2275,6 +2289,7 @@ export default class JingleSessionPC extends JingleSession {
|
2275
|
2289
|
* @param {Array<JitsiLocalTrack>} [localTracks] the optional list of the local tracks that will be added, before
|
2276
|
2290
|
* the offer/answer cycle executes (for the local track addition to be an atomic operation together with the
|
2277
|
2291
|
* offer/answer).
|
|
2292
|
+ * @returns {void}
|
2278
|
2293
|
*/
|
2279
|
2294
|
setOfferAnswerCycle(jingleOfferAnswerIq, success, failure, localTracks = []) {
|
2280
|
2295
|
logger.debug(`${this} Executing setOfferAnswerCycle task`);
|
|
@@ -2363,6 +2378,7 @@ export default class JingleSessionPC extends JingleSession {
|
2363
|
2378
|
* the remote p2p peer.
|
2364
|
2379
|
*
|
2365
|
2380
|
* @param {Map<string, number>} sourceReceiverConstraints - The receiver constraints per source.
|
|
2381
|
+ * @returns {void}
|
2366
|
2382
|
*/
|
2367
|
2383
|
setReceiverVideoConstraint(sourceReceiverConstraints) {
|
2368
|
2384
|
logger.info(`${this} setReceiverVideoConstraint - constraints: ${JSON.stringify(sourceReceiverConstraints)}`);
|
|
@@ -2378,7 +2394,8 @@ export default class JingleSessionPC extends JingleSession {
|
2378
|
2394
|
}
|
2379
|
2395
|
|
2380
|
2396
|
/**
|
2381
|
|
- * Sets the resolution constraint on the local camera track.
|
|
2397
|
+ * Sets the resolution constraint on the local video tracks.
|
|
2398
|
+ *
|
2382
|
2399
|
* @param {number} maxFrameHeight - The user preferred max frame height.
|
2383
|
2400
|
* @param {string} sourceName - The source name of the track.
|
2384
|
2401
|
* @returns {Promise} promise that will be resolved when the operation is
|
|
@@ -2399,11 +2416,12 @@ export default class JingleSessionPC extends JingleSession {
|
2399
|
2416
|
}
|
2400
|
2417
|
|
2401
|
2418
|
/**
|
2402
|
|
- * Updates the codecs on the peerconnection and initiates a renegotiation for the
|
|
2419
|
+ * Updates the codecs on the peerconnection and initiates a renegotiation (if needed) for the
|
2403
|
2420
|
* new codec config to take effect.
|
2404
|
2421
|
*
|
2405
|
2422
|
* @param {Array<CodecMimeType>} codecList - Preferred codecs for video.
|
2406
|
2423
|
* @param {CodecMimeType} screenshareCodec - The preferred screenshare codec.
|
|
2424
|
+ * @returns {void}
|
2407
|
2425
|
*/
|
2408
|
2426
|
setVideoCodecs(codecList, screenshareCodec) {
|
2409
|
2427
|
if (this._assertNotEnded()) {
|
|
@@ -2514,6 +2532,7 @@ export default class JingleSessionPC extends JingleSession {
|
2514
|
2532
|
|
2515
|
2533
|
/**
|
2516
|
2534
|
* Converts to string with minor summary.
|
|
2535
|
+ *
|
2517
|
2536
|
* @return {string}
|
2518
|
2537
|
*/
|
2519
|
2538
|
toString() {
|