diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/signaling.js | 8 | ||||
-rw-r--r-- | src/utils/webrtc/index.js | 8 | ||||
-rw-r--r-- | src/utils/webrtc/models/CallParticipantModel.js | 4 | ||||
-rw-r--r-- | src/utils/webrtc/webrtc.js | 65 |
4 files changed, 44 insertions, 41 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js index 7eba45581..bc6a46beb 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -72,7 +72,7 @@ const Signaling = { } /** - * @param settings + * @param {object} settings The signaling settings */ function Base(settings) { this.settings = settings @@ -337,7 +337,7 @@ Signaling.Base.prototype.leaveCall = function(token, keepToken) { // Connection to the internal signaling server provided by the app. /** - * @param settings + * @param {object} settings The signaling settings */ function Internal(settings) { Signaling.Base.prototype.constructor.apply(this, arguments) @@ -545,8 +545,8 @@ Signaling.Internal.prototype.sendPendingMessages = function() { } /** - * @param settings - * @param urls + * @param {object} settings The signaling settings + * @param {string|string[]} urls The url of the signaling server */ function Standalone(settings, urls) { Signaling.Base.prototype.constructor.apply(this, arguments) diff --git a/src/utils/webrtc/index.js b/src/utils/webrtc/index.js index 7bbb16125..9b4ed8730 100644 --- a/src/utils/webrtc/index.js +++ b/src/utils/webrtc/index.js @@ -47,7 +47,7 @@ let signaling = null let tokensInSignaling = {} /** - * @param token + * @param {string} token The token of the conversation to get the signaling settings for */ async function getSignalingSettings(token) { // If getSignalingSettings is called again while a previous one was still @@ -80,7 +80,7 @@ async function getSignalingSettings(token) { } /** - * @param token + * @param {string} token The token of the conversation to connect to */ async function connectSignaling(token) { const settings = await getSignalingSettings(token) @@ -111,8 +111,8 @@ let startedCall = null let failedToStartCall = null /** - * @param signaling - * @param configuration + * @param {object} signaling The signaling object + * @param {object} configuration Media to connect with */ function startCall(signaling, configuration) { let flags = PARTICIPANT.CALL_FLAG.IN_CALL diff --git a/src/utils/webrtc/models/CallParticipantModel.js b/src/utils/webrtc/models/CallParticipantModel.js index 3237bdb9c..897a664bf 100644 --- a/src/utils/webrtc/models/CallParticipantModel.js +++ b/src/utils/webrtc/models/CallParticipantModel.js @@ -34,7 +34,9 @@ export const ConnectionState = { } /** - * @param options + * @param {object} options The model + * @param {string} options.peerId The peerId of the participant + * @param {object} options.webRtc The WebRTC connection to the participant */ export default function CallParticipantModel(options) { diff --git a/src/utils/webrtc/webrtc.js b/src/utils/webrtc/webrtc.js index 88af1971b..8f1b7d757 100644 --- a/src/utils/webrtc/webrtc.js +++ b/src/utils/webrtc/webrtc.js @@ -15,7 +15,7 @@ * * @author Joas Schilling <coding@schilljs.com> * - * @license GNU AGPL version 3 or later + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -58,8 +58,8 @@ let sendCurrentStateWithRepetitionTimeout = null let startedWithMedia /** - * @param a - * @param b + * @param {Array} a Source object + * @param {Array} b Object to find all items in */ function arrayDiff(a, b) { return a.filter(function(i) { @@ -68,8 +68,8 @@ function arrayDiff(a, b) { } /** - * @param signaling - * @param sessionId + * @param {object} signaling The signaling object + * @param {string} sessionId The user's sessionId */ function createScreensharingPeer(signaling, sessionId) { const currentSessionId = signaling.getSessionId() @@ -135,7 +135,7 @@ function createScreensharingPeer(signaling, sessionId) { } /** - * @param signaling + * @param {object} signaling The signaling object */ function checkStartPublishOwnPeer(signaling) { 'use strict' @@ -218,7 +218,7 @@ function sendCurrentNick() { } /** - * @param timeout + * @param {number} timeout Time until we give up retrying */ function sendCurrentStateWithRepetition(timeout) { if (!timeout) { @@ -247,7 +247,8 @@ function sendCurrentStateWithRepetition(timeout) { } /** - * @param user + * @param {object} user The user to check + * @return {boolean} True if the user has an audio or video stream */ function userHasStreams(user) { let flags = user @@ -260,9 +261,9 @@ function userHasStreams(user) { } /** - * @param signaling - * @param newUsers - * @param disconnectedSessionIds + * @param {object} signaling The signaling object + * @param {Array} newUsers Newly added participants + * @param {Array} disconnectedSessionIds Remove participants */ function usersChanged(signaling, newUsers, disconnectedSessionIds) { 'use strict' @@ -429,8 +430,8 @@ function usersChanged(signaling, newUsers, disconnectedSessionIds) { } /** - * @param signaling - * @param users + * @param {object} signaling The signaling object + * @param {object} users Participant list with sessionId as key */ function usersInCallChanged(signaling, users) { const previousSelfInCall = selfInCall @@ -486,9 +487,9 @@ function usersInCallChanged(signaling, users) { } /** - * @param signaling - * @param _callParticipantCollection - * @param _localCallParticipantModel + * @param {object} signaling The signaling object + * @param {object} _callParticipantCollection Collection with participants + * @param {object} _localCallParticipantModel The local participant */ export default function initWebRtc(signaling, _callParticipantCollection, _localCallParticipantModel) { callParticipantCollection = _callParticipantCollection @@ -655,7 +656,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to handle the state on */ function handleIceConnectionStateConnected(peer) { // Send the current information about the state. @@ -674,7 +675,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to handle the state on */ function handleIceConnectionStateDisconnected(peer) { setTimeout(function() { @@ -703,7 +704,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to handle the state on */ function handleIceConnectionStateFailed(peer) { if (!showedTURNWarning && !signaling.settings.turnservers.length) { @@ -748,7 +749,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to handle the state on */ function setHandlerForIceConnectionStateChange(peer) { // Initialize ice restart counter for peer @@ -787,7 +788,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to handle the state on */ function setHandlerForOwnIceConnectionStateChange(peer) { peer.pc.addEventListener('iceconnectionstatechange', function() { @@ -850,7 +851,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to handle the state on */ function setHandlerForNegotiationNeeded(peer) { peer.pc.addEventListener('negotiationneeded', function() { @@ -1013,9 +1014,9 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local }) /** - * @param peer - * @param track - * @param mediaType + * @param {object} peer The peer connection to check media on + * @param {object} track The track to check the media on + * @param {string} mediaType "video" or "audio" */ function checkPeerMedia(peer, track, mediaType) { return new Promise((resolve, reject) => { @@ -1050,7 +1051,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to check media on */ function stopPeerCheckAudioMedia(peer) { clearInterval(peer.check_audio_interval) @@ -1058,7 +1059,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to check media on */ function stopPeerCheckVideoMedia(peer) { clearInterval(peer.check_video_interval) @@ -1066,8 +1067,8 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peerId - * @param mediaType + * @param {string} peerId ID to get the peer for + * @param {string} mediaType "video" or "audio" */ function stopPeerIdCheckMediaType(peerId, mediaType) { // There should be just one video peer with that id, but iterating is @@ -1092,7 +1093,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer + * @param {object} peer The peer connection to check media on */ function stopPeerCheckMedia(peer) { stopPeerCheckAudioMedia(peer) @@ -1100,8 +1101,8 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } /** - * @param peer - * @param stream + * @param {object} peer The peer connection to check media on + * @param {object} stream The stream to check */ function startPeerCheckMedia(peer, stream) { stopPeerCheckMedia(peer) |