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
Removes the sid property from MediaStream (how did we end up having a Jingle session ID in MediaStream and passing it around in the UI?)
Boris Grozevebdd91df4e38
diff --git a/modules/RTC/MediaStream.js b/modules/RTC/MediaStream.jsindex 9384386caf..c5e3ca7f1f 100644--- a/modules/RTC/MediaStream.js+++ b/modules/RTC/MediaStream.js@@ -6,13 +6,12 @@ var MediaStreamType = require("../../service/RTC/MediaStreamTypes");** @param data the data object from which we obtain the stream,* the peerjid, etc.- * @param sid the session id* @param ssrc the ssrc corresponding to this MediaStream* @param mute the whether this MediaStream is muted** @constructor*/-function MediaStream(data, sid, ssrc, browser, eventEmitter, mute) {+function MediaStream(data, ssrc, browser, eventEmitter, muted) {// XXX(gp) to minimize headaches in the future, we should build our// abstractions around tracks and not streams. ORTC is track based API.@@ -24,14 +23,13 @@ function MediaStream(data, sid, ssrc, browser, eventEmitter, mute) {// Also, we should be able to associate multiple SSRCs with a MediaTrack as// a track might have an associated RTX and FEC sources.- this.sid = sid;this.stream = data.stream;this.peerjid = data.peerjid;this.videoType = data.videoType;this.ssrc = ssrc;this.type = (this.stream.getVideoTracks().length > 0)?MediaStreamType.VIDEO_TYPE : MediaStreamType.AUDIO_TYPE;- this.muted = mute;+ this.muted = muted;this.eventEmitter = eventEmitter;}diff --git a/modules/RTC/RTC.js b/modules/RTC/RTC.jsindex 081b3b7e39..901f7fd624 100644--- a/modules/RTC/RTC.js+++ b/modules/RTC/RTC.js@@ -101,7 +101,7 @@ var RTC = {}}},- createRemoteStream: function (data, sid, ssrc) {+ createRemoteStream: function (data, ssrc) {var jid = data.peerjid || APP.xmpp.myJid();// check the video muted state from last stored presence if any@@ -111,7 +111,7 @@ var RTC = {muted = pres.videoMuted;}- var remoteStream = new MediaStream(data, sid, ssrc,+ var remoteStream = new MediaStream(data, ssrc,RTCBrowserType.getBrowserType(), eventEmitter, muted);if(!this.remoteStreams[jid]) {diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.jsindex 367b1a4ed1..c0185a3bca 100644--- a/modules/UI/videolayout/RemoteVideo.js+++ b/modules/UI/videolayout/RemoteVideo.js@@ -204,13 +204,13 @@ RemoteVideo.prototype.waitForPlayback = function (sel, stream) {sel[0].onplaying = onPlayingHandler;};-RemoteVideo.prototype.addRemoteStreamElement = function (sid, stream) {+RemoteVideo.prototype.addRemoteStreamElement = function (stream) {if (!this.container)return;var self = this;var isVideo = stream.getVideoTracks().length > 0;- var streamElement = SmallVideo.createStreamElement(sid, stream);+ var streamElement = SmallVideo.createStreamElement(stream);var newElementId = streamElement.id;// Put new stream element always in frontdiff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.jsindex cdf4b194e6..20ea7ce39f 100644--- a/modules/UI/videolayout/SmallVideo.js+++ b/modules/UI/videolayout/SmallVideo.js@@ -102,20 +102,21 @@ SmallVideo.prototype.setPresenceStatus = function (statusMsg) {};/**- * Creates an audio or video stream element.+ * Creates an audio or video element for a particular MediaStream.*/-SmallVideo.createStreamElement = function (sid, stream) {+SmallVideo.createStreamElement = function (stream) {var isVideo = stream.getVideoTracks().length > 0;var element = isVideo ? document.createElement('video'): document.createElement('audio');- var id = (isVideo ? 'remoteVideo_' : 'remoteAudio_') + sid + '_' +- APP.RTC.getStreamID(stream);- element.id = id;if (!RTCBrowserType.isIExplorer()) {element.autoplay = true;}++ element.id = (isVideo ? 'remoteVideo_' : 'remoteAudio_') ++ APP.RTC.getStreamID(stream);+element.oncontextmenu = function () { return false; };return element;diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.jsindex 4122ea6600..0bc817e3d6 100644--- a/modules/UI/videolayout/VideoLayout.js+++ b/modules/UI/videolayout/VideoLayout.js@@ -175,9 +175,7 @@ var VideoLayout = (function (my) {var resourceJid = Strophe.getResourceFromJid(stream.peerjid);remoteVideos[resourceJid].addRemoteStreamElement(- stream.sid,- stream.getOriginalStream(),- stream.ssrc);+ stream.getOriginalStream());}};diff --git a/modules/xmpp/JingleSessionPC.js b/modules/xmpp/JingleSessionPC.jsindex 19ee0b24a1..d316050e7e 100644--- a/modules/xmpp/JingleSessionPC.js+++ b/modules/xmpp/JingleSessionPC.js@@ -122,9 +122,8 @@ JingleSessionPC.prototype.doInitialize = function () {self.remoteStreamAdded(event);};this.peerconnection.onremovestream = function (event) {- // Remove the stream from remoteStreams- // FIXME: remotestreamremoved.jingle not defined anywhere(unused)- $(document).trigger('remotestreamremoved.jingle', [event, self.sid]);+ // Remove the stream from remoteStreams?+ console.log("We are ignoring a removestream event: " + event);};this.peerconnection.onsignalingstatechange = function (event) {if (!(self && self.peerconnection)) return;@@ -1487,7 +1486,7 @@ JingleSessionPC.prototype.remoteStreamAdded = function (event) {}}- APP.RTC.createRemoteStream(event, this.sid, ssrc);+ APP.RTC.createRemoteStream(event, ssrc);};module.exports = JingleSessionPC;