Merge branch 'logs' of https://github.com/isymchych/jitsi-meet into jitsi-meet-new

This commit is contained in:
damencho 2016-01-19 14:53:10 -06:00
commit 41b1a6f3c3
3 changed files with 33 additions and 19 deletions

View File

@ -270,6 +270,9 @@ export default {
}, },
// end used by torture // end used by torture
getLogs () {
return room.getLogs();
},
_createRoom () { _createRoom () {
room = connection.initJitsiConference(APP.conference.roomName, room = connection.initJitsiConference(APP.conference.roomName,
this._getConferenceOptions()); this._getConferenceOptions());
@ -286,6 +289,7 @@ export default {
}); });
roomLocker = createRoomLocker(room); roomLocker = createRoomLocker(room);
this._room = room; // FIXME do not use this this._room = room; // FIXME do not use this
this.localId = room.myUserId();
let email = APP.settings.getEmail(); let email = APP.settings.getEmail();
email && sendEmail(email); email && sendEmail(email);

View File

@ -698,6 +698,27 @@ JitsiConference.prototype.isStartVideoMuted = function () {
return this.startVideoMuted; return this.startVideoMuted;
}; };
/**
* Get object with internal logs.
*/
JitsiConference.prototype.getLogs = function () {
var data = this.xmpp.getJingleLog();
var metadata = {};
metadata.time = new Date();
metadata.url = window.location.href;
metadata.ua = navigator.userAgent;
var log = this.xmpp.getXmppLog();
if (log) {
metadata.xmpp = log;
}
data.metadata = metadata;
return data;
};
/** /**
* Setups the listeners needed for the conference. * Setups the listeners needed for the conference.
* @param conference the conference * @param conference the conference
@ -3684,6 +3705,7 @@ var ScreenObtainer = {
* 'desktop' stream for returned stream token. * 'desktop' stream for returned stream token.
*/ */
obtainScreenFromExtension: function (streamCallback, failCallback) { obtainScreenFromExtension: function (streamCallback, failCallback) {
var self = this;
if (chromeExtInstalled) { if (chromeExtInstalled) {
doGetStreamFromExtension(this.options, streamCallback, doGetStreamFromExtension(this.options, streamCallback,
failCallback); failCallback);
@ -3702,7 +3724,7 @@ var ScreenObtainer = {
// We need to give a moment for the endpoint to become // We need to give a moment for the endpoint to become
// available // available
window.setTimeout(function () { window.setTimeout(function () {
doGetStreamFromExtension(this.options, streamCallback, doGetStreamFromExtension(self.options, streamCallback,
failCallback); failCallback);
}, 500); }, 500);
}, },
@ -12519,22 +12541,6 @@ XMPP.prototype.disconnect = function () {
this.connection.disconnect(); this.connection.disconnect();
}; };
/**
* Gets the SSRC of local media stream.
* @param mediaType the media type that tells whether we want to get
* the SSRC of local audio or video stream.
* @returns {*} the SSRC number for local media stream or <tt>null</tt> if
* not available.
*/
XMPP.prototype.getLocalSSRC = function (mediaType) {
if (this.connection.jingle.activecall &&
this.connection.jingle.activecall.peerconnection) {
return this.connection.jingle.activecall.getLocalSSRC(mediaType);
} else {
return null;
}
};
module.exports = XMPP; module.exports = XMPP;
}).call(this,"/modules/xmpp/xmpp.js") }).call(this,"/modules/xmpp/xmpp.js")

View File

@ -279,8 +279,12 @@ UI.start = function () {
$('#notice').css({display: 'block'}); $('#notice').css({display: 'block'});
} }
$("#downloadlog").click(function (event) { $("#downloadlog").click(function (event) {
// dump(event.target); let logs = APP.conference.getLogs();
// FIXME integrate logs let data = encodeURIComponent(JSON.stringify(logs, null, ' '));
let elem = event.target.parentNode;
elem.download = 'meetlog.json';
elem.href = 'data:application/json;charset=utf-8,\n' + data;
}); });
Feedback.init(); Feedback.init();
} else { } else {