Adds shared screen media type to presence. Removes unnecessary log msg.

This commit is contained in:
paweldomas 2014-03-18 10:16:39 +01:00
parent 5efe0cb2f9
commit a1a0f5d4cf
2 changed files with 16 additions and 3 deletions

18
app.js
View File

@ -483,7 +483,12 @@ $(document).bind('setLocalDescription.jingle', function (event, sid) {
var i = 0;
Object.keys(newssrcs).forEach(function (mtype) {
i++;
connection.emuc.addMediaToPresence(i, mtype, newssrcs[mtype], directions[mtype]);
var type = mtype;
// Change video type to screen
if(mtype === 'video' && isUsingScreenStream) {
type = 'screen';
}
connection.emuc.addMediaToPresence(i, type, newssrcs[mtype], directions[mtype]);
});
if (i > 0) {
connection.emuc.sendPresence();
@ -597,8 +602,9 @@ $(document).bind('presence.muc', function (event, jid, info, pres) {
//console.log(jid, 'assoc ssrc', ssrc.getAttribute('type'), ssrc.getAttribute('ssrc'));
ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
var type = ssrc.getAttribute('type');
// might need to update the direction if participant just went from sendrecv to recvonly
if (ssrc.getAttribute('type') === 'video') {
if (type === 'video' || type === 'screen') {
var el = $('#participant_' + Strophe.getResourceFromJid(jid) + '>video');
switch(ssrc.getAttribute('direction')) {
case 'sendrecv':
@ -610,6 +616,14 @@ $(document).bind('presence.muc', function (event, jid, info, pres) {
//checkChangeLargeVideo(el);
break;
}
// Camera video or shared screen ?
if (type === 'screen') {
// Shared screen
//console.info("Have screen ssrc from "+jid, ssrc);
} else {
// Camera video
//console.info("Have camera ssrc from "+jid, ssrc);
}
}
});

View File

@ -120,7 +120,6 @@ function newStreamCreated(stream) {
var conferenceHandler = getConferenceHandler();
if(conferenceHandler) {
console.info("Conference considered as started");
// FIXME: will block switchInProgress on true value in case of exception
conferenceHandler.switchStreams(stream, oldStream, streamSwitchDone);
} else {