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?)
This commit is contained in:
Boris Grozev
2015-10-01 15:10:55 -05:00
parent 4934779187
commit ebdd91df4e
6 changed files with 16 additions and 20 deletions

View File

@@ -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 front

View File

@@ -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;

View File

@@ -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());
}
};