Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
Fix comparison warnings.
Boris Grozev09eaa0d303fb
diff --git a/modules/RTC/DataChannels.js b/modules/RTC/DataChannels.jsindex 2de86198cd..8fc1971208 100644--- a/modules/RTC/DataChannels.js+++ b/modules/RTC/DataChannels.js@@ -171,14 +171,13 @@ function onSelectedEndpointChanged(userResource) {function onPinnedEndpointChanged(userResource) {console.log('pinned endpoint changed: ', userResource);- if (_dataChannels && _dataChannels.length != 0) {+ if (_dataChannels && _dataChannels.length !== 0) {_dataChannels.some(function (dataChannel) {if (dataChannel.readyState == 'open') {dataChannel.send(JSON.stringify({'colibriClass': 'PinnedEndpointChangedEvent','pinnedEndpoint':- (!userResource || userResource == null)?- null : userResource+ userResource ? userResource : null}));return true;diff --git a/modules/RTC/RTC.js b/modules/RTC/RTC.jsindex 11caab9c27..3c09912ff1 100644--- a/modules/RTC/RTC.js+++ b/modules/RTC/RTC.js@@ -101,7 +101,7 @@ var RTC = {// check the video muted state from last stored presence if anyvar muted = false;var pres = APP.xmpp.getLastPresence(jid);- if(pres != null && pres.videoMuted) {+ if (pres && pres.videoMuted) {muted = pres.videoMuted;}diff --git a/modules/RTC/RTCUtils.js b/modules/RTC/RTCUtils.jsindex adf7b201e2..ded4a6c51f 100644--- a/modules/RTC/RTCUtils.js+++ b/modules/RTC/RTCUtils.js@@ -13,7 +13,7 @@ function getPreviousResolution(resolution) {var resName = null;for(var i in Resolutions) {var tmp = Resolutions[i];- if(res == null || (res.order < tmp.order && tmp.order < order)) {+ if (!res || (res.order < tmp.order && tmp.order < order)) {resName = i;res = tmp;}@@ -455,7 +455,7 @@ RTCUtils.prototype.errorCallback = function (error) {error.name == "OverconstrainedError") &&(error.constraintName == "minWidth" || error.constraintName == "maxWidth" ||error.constraintName == "minHeight" || error.constraintName == "maxHeight")- && resolution != null)+ && resolution){self.getUserMediaWithConstraints(['audio', 'video'],function (stream) {diff --git a/modules/UI/UI.js b/modules/UI/UI.jsindex dd7467867c..badc96d888 100644--- a/modules/UI/UI.js+++ b/modules/UI/UI.js@@ -755,7 +755,7 @@ UI.showLoginPopup = function(callback) {"dialog.Ok",function (e, v, m, f) {if (v) {- if (f.username !== null && f.password != null) {+ if (f.username && f.password) {callback(f.username, f.password);}}diff --git a/modules/UI/audio_levels/AudioLevels.js b/modules/UI/audio_levels/AudioLevels.jsindex 501043e9b9..97e96b7338 100644--- a/modules/UI/audio_levels/AudioLevels.js+++ b/modules/UI/audio_levels/AudioLevels.js@@ -126,7 +126,7 @@ var AudioLevels = (function(my) {return;ASDrawContext.clearRect(0, 0, 300, 300);- if(audioLevel == 0)+ if (!audioLevel)return;ASDrawContext.shadowBlur = getShadowLevel(audioLevel);diff --git a/modules/UI/prezi/PreziPlayer.js b/modules/UI/prezi/PreziPlayer.jsindex c7542ebf51..e6a42c1e57 100644--- a/modules/UI/prezi/PreziPlayer.js+++ b/modules/UI/prezi/PreziPlayer.js@@ -168,7 +168,7 @@}// jump to animation steps by calling flyToNextStep()function doAnimationSteps() {- if (obj.values.isMoving == true) {+ if (obj.values.isMoving) {setTimeout(doAnimationSteps, 100); // wait until the flight endsreturn;}diff --git a/modules/UI/videolayout/ConnectionIndicator.js b/modules/UI/videolayout/ConnectionIndicator.jsindex b77ebdbc3b..11617e9cdd 100644--- a/modules/UI/videolayout/ConnectionIndicator.js+++ b/modules/UI/videolayout/ConnectionIndicator.js@@ -86,7 +86,7 @@ ConnectionIndicator.prototype.generateText = function () {}var resolutionValue = null;- if(this.resolution && this.jid != null) {+ if(this.resolution && this.jid) {var keys = Object.keys(this.resolution);for(var ssrc in this.resolution) {resolutionValue = this.resolution[ssrc];diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.jsindex 18d29a84c5..511c36491b 100644--- a/modules/UI/videolayout/RemoteVideo.js+++ b/modules/UI/videolayout/RemoteVideo.js@@ -2,8 +2,6 @@var ConnectionIndicator = require("./ConnectionIndicator");var SmallVideo = require("./SmallVideo");var AudioLevels = require("../audio_levels/AudioLevels");-var LargeVideo = require("./LargeVideo");-var Avatar = require("../avatar/Avatar");var RTCBrowserType = require("../../RTC/RTCBrowserType");var UIUtils = require("../util/UIUtil");@@ -84,10 +82,10 @@ if (!interfaceConfig.filmStripOnly) {var self = this;muteLinkItem.onclick = function(){- if ($(this).attr('disabled') != undefined) {+ if ($(this).attr('disabled')) {event.preventDefault();}- var isMute = self.isMuted == true;+ var isMute = !!self.isMuted;APP.xmpp.setMute(self.peerJid, !isMute);popupmenuElement.setAttribute('style', 'display:none;');diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.jsindex f13ebdb16c..1240fd90ce 100644--- a/modules/UI/videolayout/SmallVideo.js+++ b/modules/UI/videolayout/SmallVideo.js@@ -171,7 +171,7 @@ SmallVideo.prototype.showAudioIndicator = function(isMuted) {}}else {- if(audioMutedSpan.length == 0 ) {+ if (!audioMutedSpan.length) {audioMutedSpan = document.createElement('span');audioMutedSpan.className = 'audioMuted';UIUtil.setTooltip(audioMutedSpan,@@ -204,7 +204,7 @@ SmallVideo.prototype.showVideoIndicator = function(isMuted) {}}else {- if(videoMutedSpan.length == 0) {+ if (!videoMutedSpan.length) {videoMutedSpan = document.createElement('span');videoMutedSpan.className = 'videoMuted';diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.jsindex d6c2a237b4..49cc99adf2 100644--- a/modules/UI/videolayout/VideoLayout.js+++ b/modules/UI/videolayout/VideoLayout.js@@ -49,7 +49,7 @@ var VideoLayout = (function (my) {my.isInLastN = function(resource) {return lastNCount < 0 || // lastN is disabled// lastNEndpoints cache not built yet- (lastNCount > 0 && lastNEndpointsCache.length == 0) ||+ (lastNCount > 0 && !lastNEndpointsCache.length) ||(lastNEndpointsCache &&lastNEndpointsCache.indexOf(resource) !== -1);};diff --git a/modules/connectionquality/connectionquality.js b/modules/connectionquality/connectionquality.jsindex 960649eae0..e2379746f8 100644--- a/modules/connectionquality/connectionquality.js+++ b/modules/connectionquality/connectionquality.js@@ -87,7 +87,7 @@ var ConnectionQuality = {updateLocalStats: function (data) {stats = data;eventEmitter.emit(CQEvents.LOCALSTATS_UPDATED, 100 - stats.packetLoss.total, stats);- if (sendIntervalId == null) {+ if (!sendIntervalId) {startSendingStats();}},@@ -98,7 +98,7 @@ var ConnectionQuality = {* @param data the statistics*/updateRemoteStats: function (jid, data) {- if (data == null || data.packetLoss_total == null) {+ if (!data || !data.packetLoss_total) {eventEmitter.emit(CQEvents.REMOTESTATS_UPDATED, jid, null, null);return;}diff --git a/modules/xmpp/JingleSessionPC.js b/modules/xmpp/JingleSessionPC.jsindex 716734fb0f..18ae10d4ab 100644--- a/modules/xmpp/JingleSessionPC.js+++ b/modules/xmpp/JingleSessionPC.js@@ -844,7 +844,7 @@ JingleSessionPC.prototype.addSource = function (elem, fromJid) {return this.getAttribute('ssrc');}).get();- if (ssrcs.length != 0) {+ if (!ssrcs.length) {lines += 'a=ssrc-group:' + semantics + ' ' + ssrcs.join(' ') + '\r\n';}});@@ -923,7 +923,7 @@ JingleSessionPC.prototype.removeSource = function (elem, fromJid) {return this.getAttribute('ssrc');}).get();- if (ssrcs.length != 0) {+ if (ssrcs.length) {lines += 'a=ssrc-group:' + semantics + ' ' + ssrcs.join(' ') + '\r\n';}});@@ -1328,7 +1328,7 @@ JingleSessionPC.prototype.setLocalDescription = function () {var session = transform.parse(this.peerconnection.localDescription.sdp);session.media.forEach(function (media) {- if (media.ssrcs != null && media.ssrcs.length > 0) {+ if (media.ssrcs && media.ssrcs.length > 0) {// TODO(gp) maybe exclude FID streams?media.ssrcs.forEach(function (ssrc) {if (ssrc.attribute !== 'cname') {diff --git a/modules/xmpp/SDP.js b/modules/xmpp/SDP.jsindex eef32092c8..d9c85ce3ef 100644--- a/modules/xmpp/SDP.js+++ b/modules/xmpp/SDP.js@@ -45,7 +45,7 @@ SDP.prototype.getMediaSsrcMap = function() {tmp.forEach(function(line){var semantics = line.substr(0, idx).substr(13);var ssrcs = line.substr(14 + semantics.length).split(' ');- if (ssrcs.length != 0) {+ if (ssrcs.length) {media.ssrcGroups.push({semantics: semantics,ssrcs: ssrcs@@ -266,7 +266,7 @@ SDP.prototype.toJingle = function (elem, thecreator, ssrcs) {idx = line.indexOf(' ');var semantics = line.substr(0, idx).substr(13);var ssrcs = line.substr(14 + semantics.length).split(' ');- if (ssrcs.length != 0) {+ if (ssrcs.length) {elem.c('ssrc-group', { semantics: semantics, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });ssrcs.forEach(function(ssrc) {elem.c('source', { ssrc: ssrc })@@ -597,7 +597,7 @@ SDP.prototype.jingle2media = function (content) {return this.getAttribute('ssrc');}).get();- if (ssrcs.length != 0) {+ if (ssrcs.length) {media += 'a=ssrc-group:' + semantics + ' ' + ssrcs.join(' ') + '\r\n';}});diff --git a/modules/xmpp/SDPDiffer.js b/modules/xmpp/SDPDiffer.jsindex ff4341e396..38d52150aa 100644--- a/modules/xmpp/SDPDiffer.js+++ b/modules/xmpp/SDPDiffer.js@@ -143,7 +143,7 @@ SDPDiffer.prototype.toJingle = function(modify) {// generate source groups from linesmedia.ssrcGroups.forEach(function(ssrcGroup) {- if (ssrcGroup.ssrcs.length != 0) {+ if (ssrcGroup.ssrcs.length) {modify.c('ssrc-group', {semantics: ssrcGroup.semantics,diff --git a/modules/xmpp/TraceablePeerConnection.js b/modules/xmpp/TraceablePeerConnection.jsindex 8d7344016d..0acd33dd93 100644--- a/modules/xmpp/TraceablePeerConnection.js+++ b/modules/xmpp/TraceablePeerConnection.js@@ -179,7 +179,7 @@ var normalizePlanB = function(desc) {for (i = 0; i<mLine.ssrcs.length; i++){if (typeof mLine.ssrcs[i] === 'object'&& typeof mLine.ssrcs[i].id !== 'undefined'- && $.inArray(mLine.ssrcs[i].id, firstSsrcs) == 0) {+ && !$.inArray(mLine.ssrcs[i].id, firstSsrcs)) {newSsrcLines.push(mLine.ssrcs[i]);delete mLine.ssrcs[i];}diff --git a/modules/xmpp/recording.js b/modules/xmpp/recording.jsindex 885aa58af7..e450928377 100644--- a/modules/xmpp/recording.js+++ b/modules/xmpp/recording.js@@ -84,7 +84,7 @@ function setRecordingColibri(state, token, callback, connection) {recordingEnabled = newState;callback(newState);- if (newState === 'pending' && recordingStateChangeCallback == null) {+ if (newState === 'pending' && !recordingStateChangeCallback) {recordingStateChangeCallback = callback;connection.addHandler(function(iq){var state = $(iq).find('recording').attr('state');