Changes the logger from console to jitsi-meet-logger
This commit is contained in:
parent
831c3564ec
commit
771593ef06
|
@ -1,3 +1,5 @@
|
|||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var RTC = require("./modules/RTC/RTC");
|
||||
var XMPPEvents = require("./service/xmpp/XMPPEvents");
|
||||
var StreamEventTypes = require("./service/RTC/StreamEventTypes");
|
||||
|
@ -19,7 +21,7 @@ var Statistics = require("./modules/statistics/statistics");
|
|||
|
||||
function JitsiConference(options) {
|
||||
if(!options.name || options.name.toLowerCase() !== options.name) {
|
||||
console.error("Invalid conference name (no conference name passed or it"
|
||||
logger.error("Invalid conference name (no conference name passed or it"
|
||||
+ "contains invalid characters like capital letters)!");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ var JitsiConferenceEvents = require("./JitsiConferenceEvents");
|
|||
var JitsiConnectionEvents = require("./JitsiConnectionEvents");
|
||||
var JitsiConnectionErrors = require("./JitsiConnectionErrors");
|
||||
var JitsiConferenceErrors = require("./JitsiConferenceErrors");
|
||||
var Logger = require("jitsi-meet-logger");
|
||||
|
||||
/**
|
||||
* Namespace for the interface of Jitsi Meet Library.
|
||||
|
@ -18,11 +19,15 @@ var LibJitsiMeet = {
|
|||
conference: JitsiConferenceErrors,
|
||||
connection: JitsiConnectionErrors
|
||||
},
|
||||
logLevels: Logger.levels,
|
||||
init: function (options) {
|
||||
require("./modules/RTC/RTC").init(options || {});
|
||||
},
|
||||
setLogLevel: function (level) {
|
||||
Logger.setLogLevel(level);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//Setups the promise object.
|
||||
window.Promise = window.Promise || require("es6-promise").polyfill();
|
||||
|
|
15
doc/API.md
15
doc/API.md
|
@ -41,6 +41,11 @@ The ```options``` parameter is JS object with the following properties:
|
|||
|
||||
* ```JitsiMeetJS.JitsiConnection``` - the ```JitsiConnection``` constructor. You can use that to create new server connection.
|
||||
|
||||
* ```JitsiMeetJS.setLogLevel``` - changes the log level for the library. For example to have only error messages you should do:
|
||||
```
|
||||
JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
|
||||
```
|
||||
|
||||
* ```JitsiMeetJS.events``` - JS object that contains all events used by the API. You will need that JS object when you try to subscribe for connection or conference events.
|
||||
We have two event types - connection and conference. You can access the events with the following code ```JitsiMeetJS.events.<event_type>.<event_name>```.
|
||||
For example if you want to use the conference event that is fired when somebody leave conference you can use the following code - ```JitsiMeetJS.events.conference.USER_LEFT```.
|
||||
|
@ -77,7 +82,13 @@ The ```options``` parameter is JS object with the following properties:
|
|||
- PASSWORD_REQUIRED - passed when the connection to the server failed. You should try to authenticate with password.
|
||||
- CONNECTION_ERROR - indicates connection failures.
|
||||
- OTHER_ERROR - all other errors
|
||||
|
||||
* ```JitsiMeetJS.logLevels``` - object with the log levels:
|
||||
1. TRACE
|
||||
2. DEBUG
|
||||
3. INFO
|
||||
4. LOG
|
||||
5. WARN
|
||||
6. ERROR
|
||||
|
||||
JitsiConnection
|
||||
------------
|
||||
|
@ -108,7 +119,7 @@ This objects represents the server connection. You can create new ```JitsiConnec
|
|||
1. devices - array with the devices - "video" and "audio" that will be passed to GUM. If that property is not set GUM will try to get all available devices.
|
||||
2. resolution - the prefered resolution for the local video.
|
||||
3. openSctp - boolean property. Enables/disables datachannel support. **NOTE: we recommend to set that option to true**
|
||||
4. disableAudioLevels - boolean property. Enables/disables audio levels.
|
||||
4. disableAudioLevels - boolean property. Enables/disables audio levels.
|
||||
|
||||
5. addEventListener(event, listener) - Subscribes the passed listener to the event.
|
||||
- event - one of the events from ```JitsiMeetJS.events.connection``` object.
|
||||
|
|
|
@ -120,7 +120,10 @@ function unload() {
|
|||
$(window).bind('beforeunload', unload);
|
||||
$(window).bind('unload', unload);
|
||||
|
||||
JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
|
||||
|
||||
JitsiMeetJS.init();
|
||||
|
||||
var connection = new JitsiMeetJS.JitsiConnection(null, null, options);
|
||||
|
||||
var room = null;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,6 +2,8 @@
|
|||
|
||||
// cache datachannels to avoid garbage collection
|
||||
// https://code.google.com/p/chromium/issues/detail?id=405545
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var RTCEvents = require("../../service/RTC/RTCEvents");
|
||||
|
||||
|
||||
|
@ -35,7 +37,7 @@ function DataChannels(peerConnection, emitter) {
|
|||
dataChannel.onmessage = function (event)
|
||||
{
|
||||
var msgData = event.data;
|
||||
console.info("Got My Data Channel Message:", msgData, dataChannel);
|
||||
logger.info("Got My Data Channel Message:", msgData, dataChannel);
|
||||
};*/
|
||||
};
|
||||
|
||||
|
@ -50,7 +52,7 @@ DataChannels.prototype.onDataChannel = function (event) {
|
|||
var self = this;
|
||||
|
||||
dataChannel.onopen = function () {
|
||||
console.info("Data channel opened by the Videobridge!", dataChannel);
|
||||
logger.info("Data channel opened by the Videobridge!", dataChannel);
|
||||
|
||||
// Code sample for sending string and/or binary data
|
||||
// Sends String message to the bridge
|
||||
|
@ -62,7 +64,7 @@ DataChannels.prototype.onDataChannel = function (event) {
|
|||
};
|
||||
|
||||
dataChannel.onerror = function (error) {
|
||||
console.error("Data Channel Error:", error, dataChannel);
|
||||
logger.error("Data Channel Error:", error, dataChannel);
|
||||
};
|
||||
|
||||
dataChannel.onmessage = function (event) {
|
||||
|
@ -74,7 +76,7 @@ DataChannels.prototype.onDataChannel = function (event) {
|
|||
obj = JSON.parse(data);
|
||||
}
|
||||
catch (e) {
|
||||
console.error(
|
||||
logger.error(
|
||||
"Failed to parse data channel message as JSON: ",
|
||||
data,
|
||||
dataChannel);
|
||||
|
@ -86,7 +88,7 @@ DataChannels.prototype.onDataChannel = function (event) {
|
|||
// Endpoint ID from the Videobridge.
|
||||
var dominantSpeakerEndpoint = obj.dominantSpeakerEndpoint;
|
||||
|
||||
console.info(
|
||||
logger.info(
|
||||
"Data channel new dominant speaker event: ",
|
||||
dominantSpeakerEndpoint);
|
||||
self.eventEmitter.emit(RTCEvents.DOMINANTSPEAKER_CHANGED, dominantSpeakerEndpoint);
|
||||
|
@ -122,20 +124,20 @@ DataChannels.prototype.onDataChannel = function (event) {
|
|||
// endpoint IDs.
|
||||
var endpointsEnteringLastN = obj.endpointsEnteringLastN;
|
||||
|
||||
console.log(
|
||||
logger.log(
|
||||
"Data channel new last-n event: ",
|
||||
lastNEndpoints, endpointsEnteringLastN, obj);
|
||||
this.eventEmitter.emit(RTCEvents.LASTN_ENDPOINT_CHANGED,
|
||||
lastNEndpoints, endpointsEnteringLastN, obj);
|
||||
}
|
||||
else {
|
||||
console.debug("Data channel JSON-formatted message: ", obj);
|
||||
logger.debug("Data channel JSON-formatted message: ", obj);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
dataChannel.onclose = function () {
|
||||
console.info("The Data Channel closed", dataChannel);
|
||||
logger.info("The Data Channel closed", dataChannel);
|
||||
var idx = self._dataChannels.indexOf(dataChannel);
|
||||
if (idx > -1)
|
||||
self._dataChannels = self._dataChannels.splice(idx, 1);
|
||||
|
@ -144,11 +146,11 @@ DataChannels.prototype.onDataChannel = function (event) {
|
|||
};
|
||||
|
||||
DataChannels.prototype.handleSelectedEndpointEvent = function (userResource) {
|
||||
console.log('selected endpoint changed: ', userResource);
|
||||
logger.log('selected endpoint changed: ', userResource);
|
||||
if (this._dataChannels && this._dataChannels.length != 0) {
|
||||
this._dataChannels.some(function (dataChannel) {
|
||||
if (dataChannel.readyState == 'open') {
|
||||
console.log('sending selected endpoint changed ' +
|
||||
logger.log('sending selected endpoint changed ' +
|
||||
'notification to the bridge: ', userResource);
|
||||
dataChannel.send(JSON.stringify({
|
||||
'colibriClass': 'SelectedEndpointChangedEvent',
|
||||
|
@ -164,7 +166,7 @@ DataChannels.prototype.handleSelectedEndpointEvent = function (userResource) {
|
|||
}
|
||||
|
||||
DataChannels.prototype.handlePinnedEndpointEvent = function (userResource) {
|
||||
console.log('pinned endpoint changed: ', userResource);
|
||||
logger.log('pinned endpoint changed: ', userResource);
|
||||
if (this._dataChannels && this._dataChannels.length != 0) {
|
||||
this._dataChannels.some(function (dataChannel) {
|
||||
if (dataChannel.readyState == 'open') {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* global config, require, attachMediaStream, getUserMedia */
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var RTCBrowserType = require("./RTCBrowserType");
|
||||
var Resolutions = require("../../service/RTC/Resolutions");
|
||||
var AdapterJS = require("./adapter.screenshare");
|
||||
|
@ -102,7 +104,7 @@ function getConstraints(um, resolution, bandwidth, fps, desktopStream) {
|
|||
]
|
||||
};
|
||||
} else {
|
||||
console.error(
|
||||
logger.error(
|
||||
"'screen' WebRTC media source is supported only in Chrome" +
|
||||
" and with Temasys plugin");
|
||||
}
|
||||
|
@ -188,7 +190,7 @@ var RTCUtils = {
|
|||
RTCSessionDescription = mozRTCSessionDescription;
|
||||
RTCIceCandidate = mozRTCIceCandidate;
|
||||
} else {
|
||||
console.error(
|
||||
logger.error(
|
||||
"Firefox version too old: " + FFversion + ". Required >= 40.");
|
||||
window.location.href = 'unsupported_browser.html';
|
||||
return;
|
||||
|
@ -260,7 +262,7 @@ var RTCUtils = {
|
|||
};
|
||||
self.getVideoSrc = function (element) {
|
||||
if (!element) {
|
||||
console.warn("Attempt to get video SRC of null element");
|
||||
logger.warn("Attempt to get video SRC of null element");
|
||||
return null;
|
||||
}
|
||||
var children = element.children;
|
||||
|
@ -269,13 +271,13 @@ var RTCUtils = {
|
|||
return children[i].value;
|
||||
}
|
||||
}
|
||||
//console.info(element.id + " SRC: " + src);
|
||||
//logger.info(element.id + " SRC: " + src);
|
||||
return null;
|
||||
};
|
||||
self.setVideoSrc = function (element, src) {
|
||||
//console.info("Set video src: ", element, src);
|
||||
//logger.info("Set video src: ", element, src);
|
||||
if (!src) {
|
||||
console.warn("Not attaching video stream, 'src' is null");
|
||||
logger.warn("Not attaching video stream, 'src' is null");
|
||||
return;
|
||||
}
|
||||
AdapterJS.WebRTCPlugin.WaitForPluginReady();
|
||||
|
@ -288,7 +290,7 @@ var RTCUtils = {
|
|||
});
|
||||
} else {
|
||||
try {
|
||||
console.error('Browser does not appear to be WebRTC-capable');
|
||||
logger.error('Browser does not appear to be WebRTC-capable');
|
||||
} catch (e) {
|
||||
}
|
||||
return;
|
||||
|
@ -301,27 +303,27 @@ var RTCUtils = {
|
|||
var constraints = getConstraints(
|
||||
um, resolution, bandwidth, fps, desktopStream);
|
||||
|
||||
console.info("Get media constraints", constraints);
|
||||
logger.info("Get media constraints", constraints);
|
||||
|
||||
var self = this;
|
||||
|
||||
try {
|
||||
this.getUserMedia(constraints,
|
||||
function (stream) {
|
||||
console.log('onUserMediaSuccess');
|
||||
logger.log('onUserMediaSuccess');
|
||||
self.setAvailableDevices(RTC, um, true);
|
||||
success_callback(stream);
|
||||
},
|
||||
function (error) {
|
||||
self.setAvailableDevices(RTC, um, false);
|
||||
console.warn('Failed to get access to local media. Error ',
|
||||
logger.warn('Failed to get access to local media. Error ',
|
||||
error, constraints);
|
||||
if (failure_callback) {
|
||||
failure_callback(error, resolution);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('GUM failed: ', e);
|
||||
logger.error('GUM failed: ', e);
|
||||
if (failure_callback) {
|
||||
failure_callback(e);
|
||||
}
|
||||
|
@ -401,7 +403,7 @@ var RTCUtils = {
|
|||
});
|
||||
},
|
||||
function (error, resolution) {
|
||||
console.error(
|
||||
logger.error(
|
||||
'failed to obtain video stream - stop', error);
|
||||
self.errorCallback(error, resolve, RTC, resolution, dontCreateJitsiTracks);
|
||||
},
|
||||
|
@ -416,7 +418,7 @@ var RTCUtils = {
|
|||
obtainVideo(audioStream);
|
||||
},
|
||||
function (error) {
|
||||
console.error(
|
||||
logger.error(
|
||||
'failed to obtain audio stream - stop', error);
|
||||
self.errorCallback(error, resolve, RTC, null, dontCreateJitsiTracks);
|
||||
}
|
||||
|
@ -454,7 +456,7 @@ var RTCUtils = {
|
|||
// If this is FF or IE, the stream parameter is *not* a MediaStream object,
|
||||
// it's an object with two properties: audioStream, videoStream.
|
||||
if (stream && stream.getAudioTracks && stream.getVideoTracks)
|
||||
console.log('got', stream, stream.getAudioTracks().length,
|
||||
logger.log('got', stream, stream.getAudioTracks().length,
|
||||
stream.getVideoTracks().length);
|
||||
return this.handleLocalStream(RTC, stream, usageOptions, resolution);
|
||||
},
|
||||
|
@ -471,7 +473,7 @@ var RTCUtils = {
|
|||
*/
|
||||
errorCallback: function (error, resolve, RTC, currentResolution, dontCreateJitsiTracks) {
|
||||
var self = this;
|
||||
console.error('failed to obtain audio/video stream - trying audio only', error);
|
||||
logger.error('failed to obtain audio/video stream - trying audio only', error);
|
||||
var resolution = getPreviousResolution(currentResolution);
|
||||
if (typeof error == "object" && error.constraintName && error.name
|
||||
&& (error.name == "ConstraintNotSatisfiedError" ||
|
||||
|
@ -496,7 +498,7 @@ var RTCUtils = {
|
|||
resolve(dontCreateJitsiTracks? streams: RTC.createLocalStreams(streams));
|
||||
},
|
||||
function (error) {
|
||||
console.error('failed to obtain audio/video stream - stop',
|
||||
logger.error('failed to obtain audio/video stream - stop',
|
||||
error);
|
||||
var streams = self.successCallback(RTC, null);
|
||||
resolve(dontCreateJitsiTracks? streams: RTC.createLocalStreams(streams));
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*! adapterjs - v0.12.0 - 2015-09-04 */
|
||||
var console = require("jitsi-meet-logger").getLogger(__filename);
|
||||
|
||||
// Adapter's interface.
|
||||
var AdapterJS = AdapterJS || {};
|
||||
|
@ -359,11 +360,11 @@ AdapterJS.renderNotificationBar = function (text, buttonText, buttonLink, openNe
|
|||
clearInterval(pluginInstallInterval);
|
||||
AdapterJS.WebRTCPlugin.defineWebRTCInterface();
|
||||
},
|
||||
function() {
|
||||
function() {
|
||||
// still no plugin detected, nothing to do
|
||||
});
|
||||
} , 500);
|
||||
});
|
||||
});
|
||||
|
||||
// On click on Cancel
|
||||
AdapterJS.addEvent(c.document.getElementById('cancel'), 'click', function(e) {
|
||||
|
@ -1087,7 +1088,7 @@ if (navigator.mozGetUserMedia) {
|
|||
newElement.onclick(arg);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return newElement;
|
||||
};
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ var extInstalled = false;
|
|||
*/
|
||||
var extUpdateRequired = false;
|
||||
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var AdapterJS = require("../RTC/adapter.screenshare");
|
||||
|
||||
var EventEmitter = require("events");
|
||||
|
@ -107,7 +109,7 @@ function isUpdateRequired(minVersion, extVersion)
|
|||
}
|
||||
catch (e)
|
||||
{
|
||||
console.error("Failed to parse extension version", e);
|
||||
logger.error("Failed to parse extension version", e);
|
||||
APP.UI.messageHandler.showError("dialog.error",
|
||||
"dialog.detectext");
|
||||
return true;
|
||||
|
@ -126,14 +128,14 @@ function checkChromeExtInstalled(callback) {
|
|||
function (response) {
|
||||
if (!response || !response.version) {
|
||||
// Communication failure - assume that no endpoint exists
|
||||
console.warn(
|
||||
logger.warn(
|
||||
"Extension not installed?: ", chrome.runtime.lastError);
|
||||
callback(false, false);
|
||||
return;
|
||||
}
|
||||
// Check installed extension version
|
||||
var extVersion = response.version;
|
||||
console.log('Extension version is: ' + extVersion);
|
||||
logger.log('Extension version is: ' + extVersion);
|
||||
var updateRequired
|
||||
= isUpdateRequired(config.minChromeExtVersion, extVersion);
|
||||
callback(!updateRequired, updateRequired);
|
||||
|
@ -152,7 +154,7 @@ function doGetStreamFromExtension(streamCallback, failCallback) {
|
|||
failCallback(chrome.runtime.lastError);
|
||||
return;
|
||||
}
|
||||
console.log("Response from extension: " + response);
|
||||
logger.log("Response from extension: " + response);
|
||||
if (response.streamId) {
|
||||
APP.RTC.getUserMediaWithConstraints(
|
||||
['desktop'],
|
||||
|
@ -185,7 +187,7 @@ function obtainScreenFromExtension(streamCallback, failCallback) {
|
|||
chrome.webstore.install(
|
||||
getWebStoreInstallUrl(),
|
||||
function (arg) {
|
||||
console.log("Extension installed successfully", arg);
|
||||
logger.log("Extension installed successfully", arg);
|
||||
extInstalled = true;
|
||||
// We need to give a moment for the endpoint to become available
|
||||
window.setTimeout(function () {
|
||||
|
@ -193,7 +195,7 @@ function obtainScreenFromExtension(streamCallback, failCallback) {
|
|||
}, 500);
|
||||
},
|
||||
function (arg) {
|
||||
console.log("Failed to install the extension", arg);
|
||||
logger.log("Failed to install the extension", arg);
|
||||
failCallback(arg);
|
||||
APP.UI.messageHandler.showError("dialog.error",
|
||||
"dialog.failtoinstall");
|
||||
|
@ -218,31 +220,31 @@ function setDesktopSharing(method) {
|
|||
// care about 'method' parameter
|
||||
if (RTCBrowserType.isTemasysPluginUsed()) {
|
||||
if (!AdapterJS.WebRTCPlugin.plugin.HasScreensharingFeature) {
|
||||
console.info("Screensharing not supported by this plugin version");
|
||||
logger.info("Screensharing not supported by this plugin version");
|
||||
} else if (!AdapterJS.WebRTCPlugin.plugin.isScreensharingAvailable) {
|
||||
console.info(
|
||||
logger.info(
|
||||
"Screensharing not available with Temasys plugin on this site");
|
||||
} else {
|
||||
obtainDesktopStream = obtainWebRTCScreen;
|
||||
console.info("Using Temasys plugin for desktop sharing");
|
||||
logger.info("Using Temasys plugin for desktop sharing");
|
||||
}
|
||||
} else if (RTCBrowserType.isChrome()) {
|
||||
if (method == "ext") {
|
||||
if (RTCBrowserType.getChromeVersion() >= 34) {
|
||||
obtainDesktopStream = obtainScreenFromExtension;
|
||||
console.info("Using Chrome extension for desktop sharing");
|
||||
logger.info("Using Chrome extension for desktop sharing");
|
||||
initChromeExtension();
|
||||
} else {
|
||||
console.info("Chrome extension not supported until ver 34");
|
||||
logger.info("Chrome extension not supported until ver 34");
|
||||
}
|
||||
} else if (method == "webrtc") {
|
||||
obtainDesktopStream = obtainWebRTCScreen;
|
||||
console.info("Using Chrome WebRTC for desktop sharing");
|
||||
logger.info("Using Chrome WebRTC for desktop sharing");
|
||||
}
|
||||
}
|
||||
|
||||
if (!obtainDesktopStream) {
|
||||
console.info("Desktop sharing disabled");
|
||||
logger.info("Desktop sharing disabled");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,21 +265,21 @@ function initChromeExtension() {
|
|||
checkChromeExtInstalled(function (installed, updateRequired) {
|
||||
extInstalled = installed;
|
||||
extUpdateRequired = updateRequired;
|
||||
console.info(
|
||||
logger.info(
|
||||
"Chrome extension installed: " + extInstalled +
|
||||
" updateRequired: " + extUpdateRequired);
|
||||
});
|
||||
}
|
||||
|
||||
function getVideoStreamFailed(error) {
|
||||
console.error("Failed to obtain the stream to switch to", error);
|
||||
logger.error("Failed to obtain the stream to switch to", error);
|
||||
switchInProgress = false;
|
||||
isUsingScreenStream = false;
|
||||
newStreamCreated(null);
|
||||
}
|
||||
|
||||
function getDesktopStreamFailed(error) {
|
||||
console.error("Failed to obtain the stream to switch to", error);
|
||||
logger.error("Failed to obtain the stream to switch to", error);
|
||||
switchInProgress = false;
|
||||
}
|
||||
|
||||
|
@ -343,7 +345,7 @@ module.exports = {
|
|||
*/
|
||||
toggleScreenSharing: function () {
|
||||
if (switchInProgress || !obtainDesktopStream) {
|
||||
console.warn("Switch in progress or no method defined");
|
||||
logger.warn("Switch in progress or no method defined");
|
||||
return;
|
||||
}
|
||||
switchInProgress = true;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
function supportsLocalStorage() {
|
||||
try {
|
||||
return 'localStorage' in window && window.localStorage !== null;
|
||||
} catch (e) {
|
||||
console.log("localstorage is not supported");
|
||||
logger.log("localstorage is not supported");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +31,7 @@ function Settings(conferenceID) {
|
|||
this.confSettings = JSON.parse(window.localStorage.getItem(conferenceID));
|
||||
if(!this.confSettings.jitsiMeetId) {
|
||||
this.confSettings.jitsiMeetId = generateUniqueId();
|
||||
console.log("generated id",
|
||||
logger.log("generated id",
|
||||
this.confSettings.jitsiMeetId);
|
||||
this.save();
|
||||
}
|
||||
|
@ -38,7 +40,7 @@ function Settings(conferenceID) {
|
|||
this.displayName = this.confSettings.displayname || '';
|
||||
this.language = this.confSettings.language;
|
||||
} else {
|
||||
console.log("local storage is not supported");
|
||||
logger.log("local storage is not supported");
|
||||
this.userId = generateUniqueId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
/* global config, $, APP, Strophe, callstats */
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
|
||||
var jsSHA = require('jssha');
|
||||
var io = require('socket.io-client');
|
||||
var callStats = null;
|
||||
|
||||
function initCallback (err, msg) {
|
||||
console.log("Initializing Status: err="+err+" msg="+msg);
|
||||
logger.log("Initializing Status: err="+err+" msg="+msg);
|
||||
}
|
||||
|
||||
var CallStats = {
|
||||
|
@ -41,7 +43,7 @@ var CallStats = {
|
|||
pcCallback: function (err, msg) {
|
||||
if (!callStats)
|
||||
return;
|
||||
console.log("Monitoring status: "+ err + " msg: " + msg);
|
||||
logger.log("Monitoring status: "+ err + " msg: " + msg);
|
||||
callStats.sendFabricEvent(this.peerconnection,
|
||||
callStats.fabricEvent.fabricSetup, this.confID);
|
||||
},
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* global require, ssrc2jid */
|
||||
/* jshint -W117 */
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var RTCBrowserType = require("../RTC/RTCBrowserType");
|
||||
|
||||
/* Whether we support the browser we are running into for logging statistics */
|
||||
|
@ -295,7 +297,7 @@ StatsCollector.prototype.stop = function () {
|
|||
*/
|
||||
StatsCollector.prototype.errorCallback = function (error)
|
||||
{
|
||||
console.error("Get stats error", error);
|
||||
logger.error("Get stats error", error);
|
||||
this.stop();
|
||||
};
|
||||
|
||||
|
@ -318,7 +320,7 @@ StatsCollector.prototype.start = function ()
|
|||
else {
|
||||
results = report.result();
|
||||
}
|
||||
//console.error("Got interval report", results);
|
||||
//logger.error("Got interval report", results);
|
||||
self.currentAudioLevelsReport = results;
|
||||
self.processAudioLevelReport();
|
||||
self.baselineAudioLevelsReport =
|
||||
|
@ -346,13 +348,13 @@ StatsCollector.prototype.start = function ()
|
|||
// //chrome
|
||||
// results = report.result();
|
||||
// }
|
||||
// //console.error("Got interval report", results);
|
||||
// //logger.error("Got interval report", results);
|
||||
// self.currentStatsReport = results;
|
||||
// try {
|
||||
// self.processStatsReport();
|
||||
// }
|
||||
// catch (e) {
|
||||
// console.error("Unsupported key:" + e, e);
|
||||
// logger.error("Unsupported key:" + e, e);
|
||||
// }
|
||||
//
|
||||
// self.baselineStatsReport = self.currentStatsReport;
|
||||
|
@ -498,7 +500,7 @@ StatsCollector.prototype.processStatsReport = function () {
|
|||
|
||||
var before = this.baselineStatsReport[idx];
|
||||
if (!before) {
|
||||
console.warn(getStatValue(now, 'ssrc') + ' not enough data');
|
||||
logger.warn(getStatValue(now, 'ssrc') + ' not enough data');
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -521,7 +523,7 @@ StatsCollector.prototype.processStatsReport = function () {
|
|||
key = 'packetsSent';
|
||||
if (!getStatValue(now, key))
|
||||
{
|
||||
console.warn("No packetsReceived nor packetSent stat found");
|
||||
logger.warn("No packetsReceived nor packetSent stat found");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -692,14 +694,14 @@ StatsCollector.prototype.processAudioLevelReport = function () {
|
|||
|
||||
var before = this.baselineAudioLevelsReport[idx];
|
||||
if (!before) {
|
||||
console.warn(getStatValue(now, 'ssrc') + ' not enough data');
|
||||
logger.warn(getStatValue(now, 'ssrc') + ' not enough data');
|
||||
continue;
|
||||
}
|
||||
|
||||
var ssrc = getStatValue(now, 'ssrc');
|
||||
if (!ssrc) {
|
||||
if((Date.now() - now.timestamp) < 3000)
|
||||
console.warn("No ssrc: ");
|
||||
logger.warn("No ssrc: ");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -718,7 +720,7 @@ StatsCollector.prototype.processAudioLevelReport = function () {
|
|||
audioLevel = getStatValue(now, 'audioOutputLevel');
|
||||
}
|
||||
catch(e) {/*not supported*/
|
||||
console.warn("Audio Levels are not available in the statistics.");
|
||||
logger.warn("Audio Levels are not available in the statistics.");
|
||||
clearInterval(this.audioLevelsIntervalId);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
|
||||
var Moderator = require("./moderator");
|
||||
var EventEmitter = require("events");
|
||||
|
@ -60,7 +62,7 @@ function ChatRoom(connection, jid, password, XMPP, options) {
|
|||
this.roomjid = Strophe.getBareJidFromJid(jid);
|
||||
this.myroomjid = jid;
|
||||
this.password = password;
|
||||
console.info("Joined MUC as " + this.myroomjid);
|
||||
logger.info("Joined MUC as " + this.myroomjid);
|
||||
this.members = {};
|
||||
this.presMap = {};
|
||||
this.presHandlers = {};
|
||||
|
@ -128,7 +130,7 @@ ChatRoom.prototype.sendPresence = function (tokenPassword) {
|
|||
|
||||
|
||||
ChatRoom.prototype.doLeave = function () {
|
||||
console.log("do leave", this.myroomjid);
|
||||
logger.log("do leave", this.myroomjid);
|
||||
var pres = $pres({to: this.myroomjid, type: 'unavailable' });
|
||||
this.presMap.length = 0;
|
||||
this.connection.send(pres);
|
||||
|
@ -150,7 +152,7 @@ ChatRoom.prototype.createNonAnonymousRoom = function () {
|
|||
'>query>x[xmlns="jabber:x:data"]' +
|
||||
'>field[var="muc#roomconfig_whois"]').length) {
|
||||
|
||||
console.error('non-anonymous rooms not supported');
|
||||
logger.error('non-anonymous rooms not supported');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -169,7 +171,7 @@ ChatRoom.prototype.createNonAnonymousRoom = function () {
|
|||
self.connection.sendIQ(formSubmit);
|
||||
|
||||
}, function (error) {
|
||||
console.error("Error getting room configuration form");
|
||||
logger.error("Error getting room configuration form");
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -209,7 +211,7 @@ ChatRoom.prototype.onPresence = function (pres) {
|
|||
if (displayName && displayName.length > 0) {
|
||||
this.eventEmitter.emit(XMPPEvents.DISPLAY_NAME_CHANGED, from, displayName);
|
||||
}
|
||||
console.info("Display name: " + displayName, pres);
|
||||
logger.info("Display name: " + displayName, pres);
|
||||
}
|
||||
break;
|
||||
case "userId":
|
||||
|
@ -246,10 +248,10 @@ ChatRoom.prototype.onPresence = function (pres) {
|
|||
} else if (this.members[from] === undefined) {
|
||||
// new participant
|
||||
this.members[from] = member;
|
||||
console.log('entered', from, member);
|
||||
logger.log('entered', from, member);
|
||||
if (member.isFocus) {
|
||||
this.focusMucJid = from;
|
||||
console.info("Ignore focus: " + from + ", real JID: " + member.jid);
|
||||
logger.info("Ignore focus: " + from + ", real JID: " + member.jid);
|
||||
}
|
||||
else {
|
||||
this.eventEmitter.emit(XMPPEvents.MUC_MEMBER_JOINED, from, member.id || member.email, member.nick);
|
||||
|
@ -295,7 +297,7 @@ ChatRoom.prototype.setSubject = function (subject) {
|
|||
var msg = $msg({to: this.roomjid, type: 'groupchat'});
|
||||
msg.c('subject', subject);
|
||||
this.connection.send(msg);
|
||||
console.log("topic changed to " + subject);
|
||||
logger.log("topic changed to " + subject);
|
||||
};
|
||||
|
||||
|
||||
|
@ -366,7 +368,7 @@ ChatRoom.prototype.onMessage = function (msg, from) {
|
|||
var subjectText = subject.text();
|
||||
if (subjectText || subjectText == "") {
|
||||
this.eventEmitter.emit(XMPPEvents.SUBJECT_CHANGED, subjectText);
|
||||
console.log("Subject is changed to " + subjectText);
|
||||
logger.log("Subject is changed to " + subjectText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -385,7 +387,7 @@ ChatRoom.prototype.onMessage = function (msg, from) {
|
|||
}
|
||||
|
||||
if (txt) {
|
||||
console.log('chat', nick, txt);
|
||||
logger.log('chat', nick, txt);
|
||||
this.eventEmitter.emit(XMPPEvents.MESSAGE_RECEIVED,
|
||||
from, nick, txt, this.myroomjid, stamp);
|
||||
}
|
||||
|
@ -393,7 +395,7 @@ ChatRoom.prototype.onMessage = function (msg, from) {
|
|||
|
||||
ChatRoom.prototype.onPresenceError = function (pres, from) {
|
||||
if ($(pres).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
|
||||
console.log('on password required', from);
|
||||
logger.log('on password required', from);
|
||||
this.eventEmitter.emit(XMPPEvents.PASSWORD_REQUIRED);
|
||||
} else if ($(pres).find(
|
||||
'>error[type="cancel"]>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
|
||||
|
@ -406,11 +408,11 @@ ChatRoom.prototype.onPresenceError = function (pres, from) {
|
|||
this.eventEmitter.emit(XMPPEvents.ROOM_JOIN_ERROR, pres);
|
||||
|
||||
} else {
|
||||
console.warn('onPresError ', pres);
|
||||
logger.warn('onPresError ', pres);
|
||||
this.eventEmitter.emit(XMPPEvents.ROOM_CONNECT_ERROR, pres);
|
||||
}
|
||||
} else {
|
||||
console.warn('onPresError ', pres);
|
||||
logger.warn('onPresError ', pres);
|
||||
this.eventEmitter.emit(XMPPEvents.ROOM_CONNECT_ERROR, pres);
|
||||
}
|
||||
};
|
||||
|
@ -424,10 +426,10 @@ ChatRoom.prototype.kick = function (jid) {
|
|||
this.connection.sendIQ(
|
||||
kickIQ,
|
||||
function (result) {
|
||||
console.log('Kick participant with jid: ', jid, result);
|
||||
logger.log('Kick participant with jid: ', jid, result);
|
||||
},
|
||||
function (error) {
|
||||
console.log('Kick participant error: ', error);
|
||||
logger.log('Kick participant error: ', error);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -503,7 +505,7 @@ ChatRoom.prototype.switchStreams = function (stream, oldStream, callback, isAudi
|
|||
this.session.switchStreams(stream, oldStream, callback, isAudio);
|
||||
} else {
|
||||
// We are done immediately
|
||||
console.warn("No conference handler or conference not started yet");
|
||||
logger.warn("No conference handler or conference not started yet");
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
@ -514,7 +516,7 @@ ChatRoom.prototype.addStream = function (stream, callback) {
|
|||
this.session.addStream(stream, callback);
|
||||
} else {
|
||||
// We are done immediately
|
||||
console.warn("No conference handler or conference not started yet");
|
||||
logger.warn("No conference handler or conference not started yet");
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
@ -541,7 +543,7 @@ ChatRoom.prototype.setVideoMute = function (mute, callback, options) {
|
|||
ChatRoom.prototype.setAudioMute = function (mute, callback) {
|
||||
//This will be for remote streams only
|
||||
// if (this.forceMuted && !mute) {
|
||||
// console.info("Asking focus for unmute");
|
||||
// logger.info("Asking focus for unmute");
|
||||
// this.connection.moderate.setMute(this.connection.emuc.myroomjid, mute);
|
||||
// // FIXME: wait for result before resetting muted status
|
||||
// this.forceMuted = false;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* have different implementations depending on the underlying interface used
|
||||
* (i.e. WebRTC and ORTC) and here we hold the code common to all of them.
|
||||
*/
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
|
||||
function JingleSession(me, sid, connection, service, eventEmitter) {
|
||||
/**
|
||||
* Our JID.
|
||||
|
@ -64,7 +66,7 @@ JingleSession.prototype.initialize = function(peerjid, isInitiator,
|
|||
this.ice_config = ice_config;
|
||||
|
||||
if (this.state !== null) {
|
||||
console.error('attempt to initiate on session ' + this.sid +
|
||||
logger.error('attempt to initiate on session ' + this.sid +
|
||||
'in state ' + this.state);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* jshint -W117 */
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var JingleSession = require("./JingleSession");
|
||||
var TraceablePeerConnection = require("./TraceablePeerConnection");
|
||||
var SDPDiffer = require("./SDPDiffer");
|
||||
|
@ -96,14 +98,14 @@ JingleSessionPC.prototype.doInitialize = function () {
|
|||
};
|
||||
this.peerconnection.onaddstream = function (event) {
|
||||
if (event.stream.id !== 'default') {
|
||||
console.log("REMOTE STREAM ADDED: ", event.stream , event.stream.id);
|
||||
logger.log("REMOTE STREAM ADDED: ", event.stream , event.stream.id);
|
||||
self.remoteStreamAdded(event);
|
||||
} else {
|
||||
// This is a recvonly stream. Clients that implement Unified Plan,
|
||||
// such as Firefox use recvonly "streams/channels/tracks" for
|
||||
// receiving remote stream/tracks, as opposed to Plan B where there
|
||||
// are only 3 channels: audio, video and data.
|
||||
console.log("RECVONLY REMOTE STREAM IGNORED: " + event.stream + " - " + event.stream.id);
|
||||
logger.log("RECVONLY REMOTE STREAM IGNORED: " + event.stream + " - " + event.stream.id);
|
||||
}
|
||||
};
|
||||
this.peerconnection.onremovestream = function (event) {
|
||||
|
@ -216,7 +218,7 @@ JingleSessionPC.prototype.accept = function () {
|
|||
if (!pranswer || pranswer.type != 'pranswer') {
|
||||
return;
|
||||
}
|
||||
console.log('going from pranswer to answer');
|
||||
logger.log('going from pranswer to answer');
|
||||
if (this.usetrickle) {
|
||||
// remove candidates already sent from session-accept
|
||||
var lines = SDPUtil.find_lines(pranswer.sdp, 'a=candidate:');
|
||||
|
@ -249,7 +251,7 @@ JingleSessionPC.prototype.accept = function () {
|
|||
var self = this;
|
||||
this.peerconnection.setLocalDescription(new RTCSessionDescription({type: 'answer', sdp: sdp}),
|
||||
function () {
|
||||
//console.log('setLocalDescription success');
|
||||
//logger.log('setLocalDescription success');
|
||||
self.setLocalDescription();
|
||||
|
||||
SSRCReplacement.processSessionInit(accept);
|
||||
|
@ -271,7 +273,7 @@ JingleSessionPC.prototype.accept = function () {
|
|||
10000);
|
||||
},
|
||||
function (e) {
|
||||
console.error('setLocalDescription failed', e);
|
||||
logger.error('setLocalDescription failed', e);
|
||||
self.room.eventEmitter.emit(XMPPEvents.CONFERENCE_SETUP_FAILED);
|
||||
}
|
||||
);
|
||||
|
@ -297,7 +299,7 @@ JingleSessionPC.prototype.sendIceCandidate = function (candidate) {
|
|||
var ice = SDPUtil.iceparams(this.localSDP.media[candidate.sdpMLineIndex], this.localSDP.session);
|
||||
var jcand = SDPUtil.candidateToJingle(candidate.candidate);
|
||||
if (!(ice && jcand)) {
|
||||
console.error('failed to get ice && jcand');
|
||||
logger.error('failed to get ice && jcand');
|
||||
return;
|
||||
}
|
||||
ice.xmlns = 'urn:xmpp:jingle:transports:ice-udp:1';
|
||||
|
@ -326,9 +328,9 @@ JingleSessionPC.prototype.sendIceCandidate = function (candidate) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
//console.log('sendIceCandidate: last candidate.');
|
||||
//logger.log('sendIceCandidate: last candidate.');
|
||||
if (!this.usetrickle) {
|
||||
//console.log('should send full offer now...');
|
||||
//logger.log('should send full offer now...');
|
||||
//FIXME why do we generate session-accept in 3 different places ?
|
||||
var init = $iq({to: this.peerjid,
|
||||
type: 'set'})
|
||||
|
@ -349,7 +351,7 @@ JingleSessionPC.prototype.sendIceCandidate = function (candidate) {
|
|||
|
||||
self.connection.sendIQ(init,
|
||||
function () {
|
||||
//console.log('session initiate ack');
|
||||
//logger.log('session initiate ack');
|
||||
var ack = {};
|
||||
ack.source = 'offer';
|
||||
$(document).trigger('ack.jingle', [self.sid, ack]);
|
||||
|
@ -369,8 +371,8 @@ JingleSessionPC.prototype.sendIceCandidate = function (candidate) {
|
|||
sendJingle();
|
||||
}
|
||||
this.lasticecandidate = true;
|
||||
console.log('Have we encountered any srflx candidates? ' + this.hadstuncandidate);
|
||||
console.log('Have we encountered any relay candidates? ' + this.hadturncandidate);
|
||||
logger.log('Have we encountered any srflx candidates? ' + this.hadstuncandidate);
|
||||
logger.log('Have we encountered any relay candidates? ' + this.hadturncandidate);
|
||||
|
||||
if (!(this.hadstuncandidate || this.hadturncandidate) && this.peerconnection.signalingState != 'closed') {
|
||||
$(document).trigger('nostuncandidates.jingle', [this.sid]);
|
||||
|
@ -379,7 +381,7 @@ JingleSessionPC.prototype.sendIceCandidate = function (candidate) {
|
|||
};
|
||||
|
||||
JingleSessionPC.prototype.sendIceCandidates = function (candidates) {
|
||||
console.log('sendIceCandidates', candidates);
|
||||
logger.log('sendIceCandidates', candidates);
|
||||
var cand = $iq({to: this.peerjid, type: 'set'})
|
||||
.c('jingle', {xmlns: 'urn:xmpp:jingle:1',
|
||||
action: 'transport-info',
|
||||
|
@ -414,7 +416,7 @@ JingleSessionPC.prototype.sendIceCandidates = function (candidates) {
|
|||
}
|
||||
}
|
||||
// might merge last-candidate notification into this, but it is called alot later. See webrtc issue #2340
|
||||
//console.log('was this the last candidate', this.lasticecandidate);
|
||||
//logger.log('was this the last candidate', this.lasticecandidate);
|
||||
this.connection.sendIQ(cand,
|
||||
function () {
|
||||
var ack = {};
|
||||
|
@ -434,13 +436,13 @@ JingleSessionPC.prototype.sendIceCandidates = function (candidates) {
|
|||
|
||||
|
||||
JingleSessionPC.prototype.sendOffer = function () {
|
||||
//console.log('sendOffer...');
|
||||
//logger.log('sendOffer...');
|
||||
var self = this;
|
||||
this.peerconnection.createOffer(function (sdp) {
|
||||
self.createdOffer(sdp);
|
||||
},
|
||||
function (e) {
|
||||
console.error('createOffer failed', e);
|
||||
logger.error('createOffer failed', e);
|
||||
},
|
||||
this.media_constraints
|
||||
);
|
||||
|
@ -448,7 +450,7 @@ JingleSessionPC.prototype.sendOffer = function () {
|
|||
|
||||
// FIXME createdOffer is never used in jitsi-meet
|
||||
JingleSessionPC.prototype.createdOffer = function (sdp) {
|
||||
//console.log('createdOffer', sdp);
|
||||
//logger.log('createdOffer', sdp);
|
||||
var self = this;
|
||||
this.localSDP = new SDP(sdp.sdp);
|
||||
//this.localSDP.mangle();
|
||||
|
@ -492,10 +494,10 @@ JingleSessionPC.prototype.createdOffer = function (sdp) {
|
|||
sendJingle();
|
||||
}
|
||||
self.setLocalDescription();
|
||||
//console.log('setLocalDescription success');
|
||||
//logger.log('setLocalDescription success');
|
||||
},
|
||||
function (e) {
|
||||
console.error('setLocalDescription failed', e);
|
||||
logger.error('setLocalDescription failed', e);
|
||||
self.room.eventEmitter.emit(XMPPEvents.CONFERENCE_SETUP_FAILED);
|
||||
}
|
||||
);
|
||||
|
@ -533,12 +535,12 @@ JingleSessionPC.prototype.getSsrcOwner = function (ssrc) {
|
|||
};
|
||||
|
||||
JingleSessionPC.prototype.setRemoteDescription = function (elem, desctype) {
|
||||
//console.log('setting remote description... ', desctype);
|
||||
//logger.log('setting remote description... ', desctype);
|
||||
this.remoteSDP = new SDP('');
|
||||
this.remoteSDP.fromJingle(elem);
|
||||
this.readSsrcInfo($(elem).find(">content"));
|
||||
if (this.peerconnection.remoteDescription !== null) {
|
||||
console.log('setRemoteDescription when remote description is not null, should be pranswer', this.peerconnection.remoteDescription);
|
||||
logger.log('setRemoteDescription when remote description is not null, should be pranswer', this.peerconnection.remoteDescription);
|
||||
if (this.peerconnection.remoteDescription.type == 'pranswer') {
|
||||
var pranswer = new SDP(this.peerconnection.remoteDescription.sdp);
|
||||
for (var i = 0; i < pranswer.media.length; i++) {
|
||||
|
@ -547,12 +549,12 @@ JingleSessionPC.prototype.setRemoteDescription = function (elem, desctype) {
|
|||
if (SDPUtil.find_line(pranswer.media[i], 'a=ice-ufrag:', pranswer.session)) {
|
||||
this.remoteSDP.media[i] += SDPUtil.find_line(pranswer.media[i], 'a=ice-ufrag:', pranswer.session) + '\r\n';
|
||||
} else {
|
||||
console.warn('no ice ufrag?');
|
||||
logger.warn('no ice ufrag?');
|
||||
}
|
||||
if (SDPUtil.find_line(pranswer.media[i], 'a=ice-pwd:', pranswer.session)) {
|
||||
this.remoteSDP.media[i] += SDPUtil.find_line(pranswer.media[i], 'a=ice-pwd:', pranswer.session) + '\r\n';
|
||||
} else {
|
||||
console.warn('no ice pwd?');
|
||||
logger.warn('no ice pwd?');
|
||||
}
|
||||
}
|
||||
// copy over candidates
|
||||
|
@ -568,10 +570,10 @@ JingleSessionPC.prototype.setRemoteDescription = function (elem, desctype) {
|
|||
|
||||
this.peerconnection.setRemoteDescription(remotedesc,
|
||||
function () {
|
||||
//console.log('setRemoteDescription success');
|
||||
//logger.log('setRemoteDescription success');
|
||||
},
|
||||
function (e) {
|
||||
console.error('setRemoteDescription error', e);
|
||||
logger.error('setRemoteDescription error', e);
|
||||
JingleSessionPC.onJingleFatalError(self, e);
|
||||
}
|
||||
);
|
||||
|
@ -583,7 +585,7 @@ JingleSessionPC.prototype.addIceCandidate = function (elem) {
|
|||
return;
|
||||
}
|
||||
if (!this.peerconnection.remoteDescription && this.peerconnection.signalingState == 'have-local-offer') {
|
||||
console.log('trickle ice candidate arriving before session accept...');
|
||||
logger.log('trickle ice candidate arriving before session accept...');
|
||||
// create a PRANSWER for setRemoteDescription
|
||||
if (!this.remoteSDP) {
|
||||
var cobbled = 'v=0\r\n' +
|
||||
|
@ -614,7 +616,7 @@ JingleSessionPC.prototype.addIceCandidate = function (elem) {
|
|||
if (tmp.length) {
|
||||
self.remoteSDP.media[i] += 'a=fingerprint:' + tmp.attr('hash') + ' ' + tmp.text() + '\r\n';
|
||||
} else {
|
||||
console.log('no dtls fingerprint (webrtc issue #1718?)');
|
||||
logger.log('no dtls fingerprint (webrtc issue #1718?)');
|
||||
self.remoteSDP.media[i] += 'a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:BAADBAADBAADBAADBAADBAADBAADBAADBAADBAAD\r\n';
|
||||
}
|
||||
break;
|
||||
|
@ -632,19 +634,19 @@ JingleSessionPC.prototype.addIceCandidate = function (elem) {
|
|||
}).length == this.remoteSDP.media.length;
|
||||
|
||||
if (iscomplete) {
|
||||
console.log('setting pranswer');
|
||||
logger.log('setting pranswer');
|
||||
try {
|
||||
this.peerconnection.setRemoteDescription(new RTCSessionDescription({type: 'pranswer', sdp: this.remoteSDP.raw }),
|
||||
function() {
|
||||
},
|
||||
function(e) {
|
||||
console.log('setRemoteDescription pranswer failed', e.toString());
|
||||
logger.log('setRemoteDescription pranswer failed', e.toString());
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('setting pranswer failed', e);
|
||||
logger.error('setting pranswer failed', e);
|
||||
}
|
||||
} else {
|
||||
//console.log('not yet setting pranswer');
|
||||
//logger.log('not yet setting pranswer');
|
||||
}
|
||||
}
|
||||
// operate on each content element
|
||||
|
@ -679,21 +681,21 @@ JingleSessionPC.prototype.addIceCandidate = function (elem) {
|
|||
try {
|
||||
self.peerconnection.addIceCandidate(candidate);
|
||||
} catch (e) {
|
||||
console.error('addIceCandidate failed', e.toString(), line);
|
||||
logger.error('addIceCandidate failed', e.toString(), line);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
JingleSessionPC.prototype.sendAnswer = function (provisional) {
|
||||
//console.log('createAnswer', provisional);
|
||||
//logger.log('createAnswer', provisional);
|
||||
var self = this;
|
||||
this.peerconnection.createAnswer(
|
||||
function (sdp) {
|
||||
self.createdAnswer(sdp, provisional);
|
||||
},
|
||||
function (e) {
|
||||
console.error('createAnswer failed', e);
|
||||
logger.error('createAnswer failed', e);
|
||||
self.room.eventEmitter.emit(XMPPEvents.CONFERENCE_SETUP_FAILED);
|
||||
},
|
||||
this.media_constraints
|
||||
|
@ -701,7 +703,7 @@ JingleSessionPC.prototype.sendAnswer = function (provisional) {
|
|||
};
|
||||
|
||||
JingleSessionPC.prototype.createdAnswer = function (sdp, provisional) {
|
||||
//console.log('createAnswer callback');
|
||||
//logger.log('createAnswer callback');
|
||||
var self = this;
|
||||
this.localSDP = new SDP(sdp.sdp);
|
||||
//this.localSDP.mangle();
|
||||
|
@ -752,14 +754,14 @@ JingleSessionPC.prototype.createdAnswer = function (sdp, provisional) {
|
|||
this.peerconnection.setLocalDescription(sdp,
|
||||
function () {
|
||||
|
||||
//console.log('setLocalDescription success');
|
||||
//logger.log('setLocalDescription success');
|
||||
if (self.usetrickle && !self.usepranswer) {
|
||||
sendJingle();
|
||||
}
|
||||
self.setLocalDescription();
|
||||
},
|
||||
function (e) {
|
||||
console.error('setLocalDescription failed', e);
|
||||
logger.error('setLocalDescription failed', e);
|
||||
self.room.eventEmitter.emit(XMPPEvents.CONFERENCE_SETUP_FAILED);
|
||||
}
|
||||
);
|
||||
|
@ -818,7 +820,7 @@ JingleSessionPC.prototype.addSource = function (elem, fromJid) {
|
|||
// FIXME: dirty waiting
|
||||
if (!this.peerconnection.localDescription)
|
||||
{
|
||||
console.warn("addSource - localDescription not ready yet")
|
||||
logger.warn("addSource - localDescription not ready yet")
|
||||
setTimeout(function()
|
||||
{
|
||||
self.addSource(elem, fromJid);
|
||||
|
@ -828,8 +830,8 @@ JingleSessionPC.prototype.addSource = function (elem, fromJid) {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log('addssrc', new Date().getTime());
|
||||
console.log('ice', this.peerconnection.iceConnectionState);
|
||||
logger.log('addssrc', new Date().getTime());
|
||||
logger.log('ice', this.peerconnection.iceConnectionState);
|
||||
|
||||
this.readSsrcInfo(elem);
|
||||
|
||||
|
@ -858,11 +860,11 @@ JingleSessionPC.prototype.addSource = function (elem, fromJid) {
|
|||
* ColibriFocus.modifySources have to wait for stable state. In the meantime multiple
|
||||
* addssrc are scheduled for update IQ. See
|
||||
*/
|
||||
console.warn("Got add stream request for my own ssrc: "+ssrc);
|
||||
logger.warn("Got add stream request for my own ssrc: "+ssrc);
|
||||
return;
|
||||
}
|
||||
if (sdp.containsSSRC(ssrc)) {
|
||||
console.warn("Source-add request for existing SSRC: " + ssrc);
|
||||
logger.warn("Source-add request for existing SSRC: " + ssrc);
|
||||
return;
|
||||
}
|
||||
$(this).find('>parameter').each(function () {
|
||||
|
@ -886,10 +888,10 @@ JingleSessionPC.prototype.addSource = function (elem, fromJid) {
|
|||
// When a source is added and if this is FF, a new channel is allocated
|
||||
// for receiving the added source. We need to diffuse the SSRC of this
|
||||
// new recvonly channel to the rest of the peers.
|
||||
console.log('modify sources done');
|
||||
logger.log('modify sources done');
|
||||
|
||||
var newSdp = new SDP(self.peerconnection.localDescription.sdp);
|
||||
console.log("SDPs", mySdp, newSdp);
|
||||
logger.log("SDPs", mySdp, newSdp);
|
||||
self.notifyMySSRCUpdate(mySdp, newSdp);
|
||||
});
|
||||
};
|
||||
|
@ -900,7 +902,7 @@ JingleSessionPC.prototype.removeSource = function (elem, fromJid) {
|
|||
// FIXME: dirty waiting
|
||||
if (!this.peerconnection.localDescription)
|
||||
{
|
||||
console.warn("removeSource - localDescription not ready yet")
|
||||
logger.warn("removeSource - localDescription not ready yet")
|
||||
setTimeout(function()
|
||||
{
|
||||
self.removeSource(elem, fromJid);
|
||||
|
@ -910,8 +912,8 @@ JingleSessionPC.prototype.removeSource = function (elem, fromJid) {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log('removessrc', new Date().getTime());
|
||||
console.log('ice', this.peerconnection.iceConnectionState);
|
||||
logger.log('removessrc', new Date().getTime());
|
||||
logger.log('ice', this.peerconnection.iceConnectionState);
|
||||
var sdp = new SDP(this.peerconnection.remoteDescription.sdp);
|
||||
var mySdp = new SDP(this.peerconnection.localDescription.sdp);
|
||||
|
||||
|
@ -933,7 +935,7 @@ JingleSessionPC.prototype.removeSource = function (elem, fromJid) {
|
|||
var ssrc = $(this).attr('ssrc');
|
||||
// This should never happen, but can be useful for bug detection
|
||||
if(mySdp.containsSSRC(ssrc)){
|
||||
console.error("Got remove stream request for my own ssrc: "+ssrc);
|
||||
logger.error("Got remove stream request for my own ssrc: "+ssrc);
|
||||
return;
|
||||
}
|
||||
$(this).find('>parameter').each(function () {
|
||||
|
@ -957,10 +959,10 @@ JingleSessionPC.prototype.removeSource = function (elem, fromJid) {
|
|||
// When a source is removed and if this is FF, the recvonly channel that
|
||||
// receives the remote stream is deactivated . We need to diffuse the
|
||||
// recvonly SSRC removal to the rest of the peers.
|
||||
console.log('modify sources done');
|
||||
logger.log('modify sources done');
|
||||
|
||||
var newSdp = new SDP(self.peerconnection.localDescription.sdp);
|
||||
console.log("SDPs", mySdp, newSdp);
|
||||
logger.log("SDPs", mySdp, newSdp);
|
||||
self.notifyMySSRCUpdate(mySdp, newSdp);
|
||||
});
|
||||
};
|
||||
|
@ -1007,7 +1009,7 @@ JingleSessionPC.prototype._modifySources = function (successCallback, queueCallb
|
|||
function() {
|
||||
|
||||
if(self.signalingState == 'closed') {
|
||||
console.error("createAnswer attempt on closed state");
|
||||
logger.error("createAnswer attempt on closed state");
|
||||
queueCallback("createAnswer attempt on closed state");
|
||||
return;
|
||||
}
|
||||
|
@ -1034,13 +1036,13 @@ JingleSessionPC.prototype._modifySources = function (successCallback, queueCallb
|
|||
|
||||
// FIXME: pushing down an answer while ice connection state
|
||||
// is still checking is bad...
|
||||
//console.log(self.peerconnection.iceConnectionState);
|
||||
//logger.log(self.peerconnection.iceConnectionState);
|
||||
|
||||
// trying to work around another chrome bug
|
||||
//modifiedAnswer.sdp = modifiedAnswer.sdp.replace(/a=setup:active/g, 'a=setup:actpass');
|
||||
self.peerconnection.setLocalDescription(modifiedAnswer,
|
||||
function() {
|
||||
//console.log('modified setLocalDescription ok');
|
||||
//logger.log('modified setLocalDescription ok');
|
||||
self.setLocalDescription();
|
||||
if(successCallback){
|
||||
successCallback();
|
||||
|
@ -1048,19 +1050,19 @@ JingleSessionPC.prototype._modifySources = function (successCallback, queueCallb
|
|||
queueCallback();
|
||||
},
|
||||
function(error) {
|
||||
console.error('modified setLocalDescription failed', error);
|
||||
logger.error('modified setLocalDescription failed', error);
|
||||
queueCallback(error);
|
||||
}
|
||||
);
|
||||
},
|
||||
function(error) {
|
||||
console.error('modified answer failed', error);
|
||||
logger.error('modified answer failed', error);
|
||||
queueCallback(error);
|
||||
}
|
||||
);
|
||||
},
|
||||
function(error) {
|
||||
console.error('modify failed', error);
|
||||
logger.error('modify failed', error);
|
||||
queueCallback(error);
|
||||
}
|
||||
);
|
||||
|
@ -1096,12 +1098,12 @@ JingleSessionPC.prototype.switchStreams = function (new_stream, oldStream, succe
|
|||
|
||||
self.switchstreams = true;
|
||||
self.modifySourcesQueue.push(function() {
|
||||
console.log('modify sources done');
|
||||
logger.log('modify sources done');
|
||||
|
||||
success_callback();
|
||||
|
||||
var newSdp = new SDP(self.peerconnection.localDescription.sdp);
|
||||
console.log("SDPs", oldSdp, newSdp);
|
||||
logger.log("SDPs", oldSdp, newSdp);
|
||||
self.notifyMySSRCUpdate(oldSdp, newSdp);
|
||||
});
|
||||
};
|
||||
|
@ -1133,12 +1135,12 @@ JingleSessionPC.prototype.addStream = function (stream, callback) {
|
|||
|
||||
this.addingStreams = true;
|
||||
this.modifySourcesQueue.push(function() {
|
||||
console.log('modify sources done');
|
||||
logger.log('modify sources done');
|
||||
|
||||
callback();
|
||||
|
||||
var newSdp = new SDP(self.peerconnection.localDescription.sdp);
|
||||
console.log("SDPs", oldSdp, newSdp);
|
||||
logger.log("SDPs", oldSdp, newSdp);
|
||||
self.notifyMySSRCUpdate(oldSdp, newSdp);
|
||||
});
|
||||
}
|
||||
|
@ -1152,7 +1154,7 @@ JingleSessionPC.prototype.notifyMySSRCUpdate = function (old_sdp, new_sdp) {
|
|||
|
||||
if (!(this.peerconnection.signalingState == 'stable' &&
|
||||
this.peerconnection.iceConnectionState == 'connected')){
|
||||
console.log("Too early to send updates");
|
||||
logger.log("Too early to send updates");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1174,17 +1176,17 @@ JingleSessionPC.prototype.notifyMySSRCUpdate = function (old_sdp, new_sdp) {
|
|||
remove = SSRCReplacement.processSourceRemove(remove);
|
||||
|
||||
if (removed && remove) {
|
||||
console.info("Sending source-remove", remove);
|
||||
logger.info("Sending source-remove", remove);
|
||||
this.connection.sendIQ(remove,
|
||||
function (res) {
|
||||
console.info('got remove result', res);
|
||||
logger.info('got remove result', res);
|
||||
},
|
||||
function (err) {
|
||||
console.error('got remove error', err);
|
||||
logger.error('got remove error', err);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
console.log('removal not necessary');
|
||||
logger.log('removal not necessary');
|
||||
}
|
||||
|
||||
// send source-add IQ.
|
||||
|
@ -1205,17 +1207,17 @@ JingleSessionPC.prototype.notifyMySSRCUpdate = function (old_sdp, new_sdp) {
|
|||
add = SSRCReplacement.processSourceAdd(add);
|
||||
|
||||
if (added && add) {
|
||||
console.info("Sending source-add", add);
|
||||
logger.info("Sending source-add", add);
|
||||
this.connection.sendIQ(add,
|
||||
function (res) {
|
||||
console.info('got add result', res);
|
||||
logger.info('got add result', res);
|
||||
},
|
||||
function (err) {
|
||||
console.error('got add error', err);
|
||||
logger.error('got add error', err);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
console.log('addition not necessary');
|
||||
logger.log('addition not necessary');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1263,12 +1265,12 @@ JingleSessionPC.prototype.setVideoMute = function (mute, callback, options) {
|
|||
}
|
||||
|
||||
this.modifySourcesQueue.push(function() {
|
||||
console.log('modify sources done');
|
||||
logger.log('modify sources done');
|
||||
|
||||
callback(mute);
|
||||
|
||||
var newSdp = new SDP(self.peerconnection.localDescription.sdp);
|
||||
console.log("SDPs", oldSdp, newSdp);
|
||||
logger.log("SDPs", oldSdp, newSdp);
|
||||
self.notifyMySSRCUpdate(oldSdp, newSdp);
|
||||
});
|
||||
};
|
||||
|
@ -1351,7 +1353,7 @@ JingleSessionPC.prototype.getStats = function (interval) {
|
|||
|
||||
JingleSessionPC.onJingleError = function (session, error)
|
||||
{
|
||||
console.error("Jingle error", error);
|
||||
logger.error("Jingle error", error);
|
||||
}
|
||||
|
||||
JingleSessionPC.onJingleFatalError = function (session, error)
|
||||
|
@ -1388,7 +1390,7 @@ JingleSessionPC.prototype.setLocalDescription = function () {
|
|||
|
||||
});
|
||||
|
||||
console.log('new ssrcs', newssrcs);
|
||||
logger.log('new ssrcs', newssrcs);
|
||||
|
||||
// Bind us as local SSRCs owner
|
||||
if (newssrcs.length > 0) {
|
||||
|
@ -1403,7 +1405,7 @@ JingleSessionPC.prototype.setLocalDescription = function () {
|
|||
// an attempt to work around https://github.com/jitsi/jitmeet/issues/32
|
||||
JingleSessionPC.prototype.sendKeyframe = function () {
|
||||
var pc = this.peerconnection;
|
||||
console.log('sendkeyframe', pc.iceConnectionState);
|
||||
logger.log('sendkeyframe', pc.iceConnectionState);
|
||||
if (pc.iceConnectionState !== 'connected') return; // safe...
|
||||
var self = this;
|
||||
pc.setRemoteDescription(
|
||||
|
@ -1417,19 +1419,19 @@ JingleSessionPC.prototype.sendKeyframe = function () {
|
|||
// noop
|
||||
},
|
||||
function (error) {
|
||||
console.log('triggerKeyframe setLocalDescription failed', error);
|
||||
logger.log('triggerKeyframe setLocalDescription failed', error);
|
||||
self.room.eventEmitter.emit(XMPPEvents.SET_LOCAL_DESCRIPTION_ERROR);
|
||||
}
|
||||
);
|
||||
},
|
||||
function (error) {
|
||||
console.log('triggerKeyframe createAnswer failed', error);
|
||||
logger.log('triggerKeyframe createAnswer failed', error);
|
||||
self.room.eventEmitter.emit(XMPPEvents.CREATE_ANSWER_ERROR);
|
||||
}
|
||||
);
|
||||
},
|
||||
function (error) {
|
||||
console.log('triggerKeyframe setRemoteDescription failed', error);
|
||||
logger.log('triggerKeyframe setRemoteDescription failed', error);
|
||||
eventEmitter.emit(XMPPEvents.SET_REMOTE_DESCRIPTION_ERROR);
|
||||
}
|
||||
);
|
||||
|
@ -1443,7 +1445,7 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) {
|
|||
|
||||
// look up an associated JID for a stream id
|
||||
if (!streamId) {
|
||||
console.error("No stream ID for", data.stream);
|
||||
logger.error("No stream ID for", data.stream);
|
||||
} else if (streamId && streamId.indexOf('mixedmslabel') === -1) {
|
||||
// look only at a=ssrc: and _not_ at a=ssrc-group: lines
|
||||
|
||||
|
@ -1464,13 +1466,13 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) {
|
|||
thessrc = ssrclines[0].substring(7).split(' ')[0];
|
||||
|
||||
if (!self.ssrcOwners[thessrc]) {
|
||||
console.error("No SSRC owner known for: " + thessrc);
|
||||
logger.error("No SSRC owner known for: " + thessrc);
|
||||
return;
|
||||
}
|
||||
data.peerjid = self.ssrcOwners[thessrc];
|
||||
console.log('associated jid', self.ssrcOwners[thessrc]);
|
||||
logger.log('associated jid', self.ssrcOwners[thessrc]);
|
||||
} else {
|
||||
console.error("No SSRC lines for ", streamId);
|
||||
logger.error("No SSRC lines for ", streamId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* global $ */
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
|
||||
|
||||
/*
|
||||
Here we do modifications of local video SSRCs. There are 2 situations we have
|
||||
|
@ -84,7 +86,7 @@ var filterOutSource = function (modifyIq, actionName) {
|
|||
return modifyIqTree[0];
|
||||
}
|
||||
|
||||
console.info(
|
||||
logger.info(
|
||||
'Blocking ' + actionName + ' for local video SSRC: ' + localVideoSSRC);
|
||||
|
||||
videoSSRC.remove();
|
||||
|
@ -118,7 +120,7 @@ var storeLocalVideoSSRC = function (jingleIq) {
|
|||
var ssrcVal = ssrSel.attr('ssrc');
|
||||
if (ssrcVal) {
|
||||
localVideoSSRC = ssrcVal;
|
||||
console.info('Stored local video SSRC' +
|
||||
logger.info('Stored local video SSRC' +
|
||||
' for future re-use: ' + localVideoSSRC);
|
||||
}
|
||||
}
|
||||
|
@ -148,7 +150,7 @@ function generateRecvonlySSRC() {
|
|||
localRecvOnlyMSID = localRecvOnlyMSLabel + " " + localRecvOnlyLabel;
|
||||
|
||||
|
||||
console.info(
|
||||
logger.info(
|
||||
"Generated local recvonly SSRC: " + localRecvOnlySSRC +
|
||||
", cname: " + localRecvOnlyCName);
|
||||
}
|
||||
|
@ -166,7 +168,7 @@ var LocalSSRCReplacement = {
|
|||
return;
|
||||
|
||||
if (localVideoSSRC) {
|
||||
console.error("Local SSRC stored already: " + localVideoSSRC);
|
||||
logger.error("Local SSRC stored already: " + localVideoSSRC);
|
||||
return;
|
||||
}
|
||||
storeLocalVideoSSRC(sessionInit);
|
||||
|
@ -184,7 +186,7 @@ var LocalSSRCReplacement = {
|
|||
return localDescription;
|
||||
|
||||
if (!localDescription) {
|
||||
console.warn("localDescription is null or undefined");
|
||||
logger.warn("localDescription is null or undefined");
|
||||
return localDescription;
|
||||
}
|
||||
|
||||
|
@ -200,7 +202,7 @@ var LocalSSRCReplacement = {
|
|||
var videoSSRCs = videoPart.ssrcs;
|
||||
var newSSRC = Object.keys(videoSSRCs)[0];
|
||||
|
||||
console.info(
|
||||
logger.info(
|
||||
"Replacing new video SSRC: " + newSSRC +
|
||||
" with " + localVideoSSRC);
|
||||
|
||||
|
@ -221,7 +223,7 @@ var LocalSSRCReplacement = {
|
|||
}
|
||||
localVideoSSRC = localRecvOnlySSRC;
|
||||
|
||||
console.info('No SSRC in video recvonly stream' +
|
||||
logger.info('No SSRC in video recvonly stream' +
|
||||
' - adding SSRC: ' + localRecvOnlySSRC);
|
||||
|
||||
sdp.media[1] += 'a=ssrc:' + localRecvOnlySSRC +
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* jshint -W117 */
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var SDPUtil = require("./SDPUtil");
|
||||
|
||||
// SDP STUFF
|
||||
|
@ -65,7 +67,7 @@ SDP.prototype.containsSSRC = function(ssrc) {
|
|||
var contains = false;
|
||||
Object.keys(medias).forEach(function(mediaindex){
|
||||
var media = medias[mediaindex];
|
||||
//console.log("Check", channel, ssrc);
|
||||
//logger.log("Check", channel, ssrc);
|
||||
if(Object.keys(media.ssrcs).indexOf(ssrc) != -1){
|
||||
contains = true;
|
||||
}
|
||||
|
@ -126,7 +128,7 @@ SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
|
|||
|
||||
// add content's to a jingle element
|
||||
SDP.prototype.toJingle = function (elem, thecreator, ssrcs) {
|
||||
// console.log("SSRC" + ssrcs["audio"] + " - " + ssrcs["video"]);
|
||||
// logger.log("SSRC" + ssrcs["audio"] + " - " + ssrcs["video"]);
|
||||
var i, j, k, mline, ssrc, rtpmap, tmp, line, lines;
|
||||
var self = this;
|
||||
// new bundle plan
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
SDPUtil = {
|
||||
filter_special_chars: function (text) {
|
||||
return text.replace(/[\\\/\{,\}\+]/g, "");
|
||||
|
@ -141,7 +143,7 @@ SDPUtil = {
|
|||
candidate.tcptype = elems[i + 1];
|
||||
break;
|
||||
default: // TODO
|
||||
console.log('parse_icecandidate not translating "' + elems[i] + '" = "' + elems[i + 1] + '"');
|
||||
logger.log('parse_icecandidate not translating "' + elems[i] + '" = "' + elems[i + 1] + '"');
|
||||
}
|
||||
}
|
||||
candidate.network = '1';
|
||||
|
@ -258,8 +260,8 @@ SDPUtil = {
|
|||
if (line.indexOf('candidate:') === 0) {
|
||||
line = 'a=' + line;
|
||||
} else if (line.substring(0, 12) != 'a=candidate:') {
|
||||
console.log('parseCandidate called with a line that is not a candidate line');
|
||||
console.log(line);
|
||||
logger.log('parseCandidate called with a line that is not a candidate line');
|
||||
logger.log(line);
|
||||
return null;
|
||||
}
|
||||
if (line.substring(line.length - 2) == '\r\n') // chomp it
|
||||
|
@ -268,8 +270,8 @@ SDPUtil = {
|
|||
elems = line.split(' '),
|
||||
i;
|
||||
if (elems[6] != 'typ') {
|
||||
console.log('did not find typ in the right place');
|
||||
console.log(line);
|
||||
logger.log('did not find typ in the right place');
|
||||
logger.log(line);
|
||||
return null;
|
||||
}
|
||||
candidate.foundation = elems[0].substring(12);
|
||||
|
@ -297,7 +299,7 @@ SDPUtil = {
|
|||
candidate.tcptype = elems[i + 1];
|
||||
break;
|
||||
default: // TODO
|
||||
console.log('not translating "' + elems[i] + '" = "' + elems[i + 1] + '"');
|
||||
logger.log('not translating "' + elems[i] + '" = "' + elems[i + 1] + '"');
|
||||
}
|
||||
}
|
||||
candidate.network = '1';
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
var RTC = require('../RTC/RTC');
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var RTCBrowserType = require("../RTC/RTCBrowserType.js");
|
||||
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
|
||||
var SSRCReplacement = require("./LocalSSRCReplacement");
|
||||
|
@ -26,13 +28,13 @@ function TraceablePeerConnection(ice_config, constraints, session) {
|
|||
|
||||
// override as desired
|
||||
this.trace = function (what, info) {
|
||||
/*console.warn('WTRACE', what, info);
|
||||
/*logger.warn('WTRACE', what, info);
|
||||
if (info && RTCBrowserType.isIExplorer()) {
|
||||
if (info.length > 1024) {
|
||||
console.warn('WTRACE', what, info.substr(1024));
|
||||
logger.warn('WTRACE', what, info.substr(1024));
|
||||
}
|
||||
if (info.length > 2048) {
|
||||
console.warn('WTRACE', what, info.substr(2048));
|
||||
logger.warn('WTRACE', what, info.substr(2048));
|
||||
}
|
||||
}*/
|
||||
self.updateLog.push({
|
||||
|
@ -142,7 +144,7 @@ var dumpSDP = function(description) {
|
|||
var normalizePlanB = function(desc) {
|
||||
if (typeof desc !== 'object' || desc === null ||
|
||||
typeof desc.sdp !== 'string') {
|
||||
console.warn('An empty description was passed as an argument.');
|
||||
logger.warn('An empty description was passed as an argument.');
|
||||
return desc;
|
||||
}
|
||||
|
||||
|
@ -248,7 +250,7 @@ TraceablePeerConnection.prototype.addStream = function (stream) {
|
|||
}
|
||||
catch (e)
|
||||
{
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -277,7 +279,7 @@ TraceablePeerConnection.prototype.removeStream = function (stream, stopStreams)
|
|||
if (this.peerconnection.removeStream)
|
||||
this.peerconnection.removeStream(stream);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* global $, $iq, APP, config, messageHandler,
|
||||
roomName, sessionTerminated, Strophe, Util */
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
|
||||
var Settings = require("../settings/Settings");
|
||||
|
||||
|
@ -47,7 +49,7 @@ function Moderator(roomName, xmpp, emitter) {
|
|||
function listener(event) {
|
||||
if (event.data && event.data.sessionId) {
|
||||
if (event.origin !== window.location.origin) {
|
||||
console.warn("Ignoring sessionId from different origin: " +
|
||||
logger.warn("Ignoring sessionId from different origin: " +
|
||||
event.origin);
|
||||
return;
|
||||
}
|
||||
|
@ -73,10 +75,10 @@ Moderator.prototype.isSipGatewayEnabled = function () {
|
|||
|
||||
|
||||
Moderator.prototype.onMucMemberLeft = function (jid) {
|
||||
console.info("Someone left is it focus ? " + jid);
|
||||
logger.info("Someone left is it focus ? " + jid);
|
||||
var resource = Strophe.getResourceFromJid(jid);
|
||||
if (resource === 'focus' && !this.xmppService.sessionTerminated) {
|
||||
console.info(
|
||||
logger.info(
|
||||
"Focus has left the room - leaving conference");
|
||||
//hangUp();
|
||||
// We'd rather reload to have everything re-initialized
|
||||
|
@ -89,7 +91,7 @@ Moderator.prototype.onMucMemberLeft = function (jid) {
|
|||
Moderator.prototype.setFocusUserJid = function (focusJid) {
|
||||
if (!this.focusUserJid) {
|
||||
this.focusUserJid = focusJid;
|
||||
console.info("Focus jid set to: " + this.focusUserJid);
|
||||
logger.info("Focus jid set to: " + this.focusUserJid);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -116,7 +118,7 @@ Moderator.prototype.createConferenceIq = function () {
|
|||
var sessionId = localStorage.getItem('sessionId');
|
||||
var machineUID = this.settings.getSettings().uid;
|
||||
|
||||
console.info(
|
||||
logger.info(
|
||||
"Session ID: " + sessionId + " machine UID: " + machineUID);
|
||||
|
||||
elem.c('conference', {
|
||||
|
@ -191,7 +193,7 @@ Moderator.prototype.createConferenceIq = function () {
|
|||
Moderator.prototype.parseSessionId = function (resultIq) {
|
||||
var sessionId = $(resultIq).find('conference').attr('session-id');
|
||||
if (sessionId) {
|
||||
console.info('Received sessionId: ' + sessionId);
|
||||
logger.info('Received sessionId: ' + sessionId);
|
||||
localStorage.setItem('sessionId', sessionId);
|
||||
}
|
||||
};
|
||||
|
@ -206,13 +208,13 @@ Moderator.prototype.parseConfigOptions = function (resultIq) {
|
|||
'>conference>property' +
|
||||
'[name=\'authentication\'][value=\'true\']').length > 0;
|
||||
|
||||
console.info("Authentication enabled: " + authenticationEnabled);
|
||||
logger.info("Authentication enabled: " + authenticationEnabled);
|
||||
|
||||
this.externalAuthEnabled = $(resultIq).find(
|
||||
'>conference>property' +
|
||||
'[name=\'externalAuth\'][value=\'true\']').length > 0;
|
||||
|
||||
console.info('External authentication enabled: ' + this.externalAuthEnabled);
|
||||
logger.info('External authentication enabled: ' + this.externalAuthEnabled);
|
||||
|
||||
if (!this.externalAuthEnabled) {
|
||||
// We expect to receive sessionId in 'internal' authentication mode
|
||||
|
@ -232,7 +234,7 @@ Moderator.prototype.parseConfigOptions = function (resultIq) {
|
|||
this.sipGatewayEnabled = true;
|
||||
}
|
||||
|
||||
console.info("Sip gateway enabled: " + this.sipGatewayEnabled);
|
||||
logger.info("Sip gateway enabled: " + this.sipGatewayEnabled);
|
||||
};
|
||||
|
||||
// FIXME = we need to show the fact that we're waiting for the focus
|
||||
|
@ -258,7 +260,7 @@ Moderator.prototype.allocateConferenceFocus = function ( callback) {
|
|||
callback();
|
||||
} else {
|
||||
var waitMs = self.getNextTimeout();
|
||||
console.info("Waiting for the focus... " + waitMs);
|
||||
logger.info("Waiting for the focus... " + waitMs);
|
||||
// Reset error timeout
|
||||
self.getNextErrorTimeout(true);
|
||||
window.setTimeout(
|
||||
|
@ -273,7 +275,7 @@ Moderator.prototype.allocateConferenceFocus = function ( callback) {
|
|||
var invalidSession
|
||||
= $(error).find('>error>session-invalid').length;
|
||||
if (invalidSession) {
|
||||
console.info("Session expired! - removing");
|
||||
logger.info("Session expired! - removing");
|
||||
localStorage.removeItem("sessionId");
|
||||
}
|
||||
if ($(error).find('>error>graceful-shutdown').length) {
|
||||
|
@ -295,7 +297,7 @@ Moderator.prototype.allocateConferenceFocus = function ( callback) {
|
|||
}
|
||||
// Not authorized to create new room
|
||||
if ($(error).find('>error>not-authorized').length) {
|
||||
console.warn("Unauthorized to start the conference", error);
|
||||
logger.warn("Unauthorized to start the conference", error);
|
||||
var toDomain
|
||||
= Strophe.getDomainFromJid(error.getAttribute('to'));
|
||||
if (toDomain !== this.xmppService.options.hosts.anonymousdomain) {
|
||||
|
@ -312,7 +314,7 @@ Moderator.prototype.allocateConferenceFocus = function ( callback) {
|
|||
return;
|
||||
}
|
||||
var waitMs = self.getNextErrorTimeout();
|
||||
console.error("Focus error, retry after " + waitMs, error);
|
||||
logger.error("Focus error, retry after " + waitMs, error);
|
||||
// Show message
|
||||
var focusComponent = self.getFocusComponent();
|
||||
var retrySec = waitMs / 1000;
|
||||
|
@ -346,15 +348,15 @@ Moderator.prototype.getLoginUrl = function (urlCallback) {
|
|||
var url = $(result).find('login-url').attr('url');
|
||||
url = url = decodeURIComponent(url);
|
||||
if (url) {
|
||||
console.info("Got auth url: " + url);
|
||||
logger.info("Got auth url: " + url);
|
||||
urlCallback(url);
|
||||
} else {
|
||||
console.error(
|
||||
logger.error(
|
||||
"Failed to get auth url from the focus", result);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
console.error("Get auth url error", error);
|
||||
logger.error("Get auth url error", error);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
@ -372,15 +374,15 @@ Moderator.prototype.getPopupLoginUrl = function (urlCallback) {
|
|||
var url = $(result).find('login-url').attr('url');
|
||||
url = url = decodeURIComponent(url);
|
||||
if (url) {
|
||||
console.info("Got POPUP auth url: " + url);
|
||||
logger.info("Got POPUP auth url: " + url);
|
||||
urlCallback(url);
|
||||
} else {
|
||||
console.error(
|
||||
logger.error(
|
||||
"Failed to get POPUP auth url from the focus", result);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
console.error('Get POPUP auth url error', error);
|
||||
logger.error('Get POPUP auth url error', error);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
@ -403,12 +405,12 @@ Moderator.prototype.logout = function (callback) {
|
|||
if (logoutUrl) {
|
||||
logoutUrl = decodeURIComponent(logoutUrl);
|
||||
}
|
||||
console.info("Log out OK, url: " + logoutUrl, result);
|
||||
logger.info("Log out OK, url: " + logoutUrl, result);
|
||||
localStorage.removeItem('sessionId');
|
||||
callback(logoutUrl);
|
||||
},
|
||||
function (error) {
|
||||
console.error("Logout error", error);
|
||||
logger.error("Logout error", error);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
/* a simple MUC connection plugin
|
||||
* can only handle a single MUC room
|
||||
*/
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var ChatRoom = require("./ChatRoom");
|
||||
|
||||
module.exports = function(XMPP) {
|
||||
|
@ -19,7 +21,7 @@ module.exports = function(XMPP) {
|
|||
createRoom: function (jid, password, options) {
|
||||
var roomJid = Strophe.getBareJidFromJid(jid);
|
||||
if (this.rooms[roomJid]) {
|
||||
console.error("You are already in the room!");
|
||||
logger.error("You are already in the room!");
|
||||
return;
|
||||
}
|
||||
this.rooms[roomJid] = new ChatRoom(this.connection, jid, password, XMPP, options);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* jshint -W117 */
|
||||
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var JingleSession = require("./JingleSessionPC");
|
||||
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
|
||||
var RTCBrowserType = require("../RTC/RTCBrowserType");
|
||||
|
@ -56,7 +58,7 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
to: fromJid,
|
||||
id: iq.getAttribute('id')
|
||||
});
|
||||
console.log('on jingle ' + action + ' from ' + fromJid, iq);
|
||||
logger.log('on jingle ' + action + ' from ' + fromJid, iq);
|
||||
var sess = this.sessions[sid];
|
||||
if ('session-initiate' != action) {
|
||||
if (sess === null) {
|
||||
|
@ -69,7 +71,7 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
}
|
||||
// local jid is not checked
|
||||
if (fromJid != sess.peerjid) {
|
||||
console.warn('jid mismatch for session id', sid, fromJid, sess.peerjid);
|
||||
logger.warn('jid mismatch for session id', sid, fromJid, sess.peerjid);
|
||||
ack.type = 'error';
|
||||
ack.c('error', {type: 'cancel'})
|
||||
.c('item-not-found', {xmlns: 'urn:ietf:params:xml:ns:xmpp-stanzas'}).up()
|
||||
|
@ -83,7 +85,7 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
ack.type = 'error';
|
||||
ack.c('error', {type: 'cancel'})
|
||||
.c('service-unavailable', {xmlns: 'urn:ietf:params:xml:ns:xmpp-stanzas'}).up();
|
||||
console.warn('duplicate session id', sid);
|
||||
logger.warn('duplicate session id', sid);
|
||||
this.connection.send(ack);
|
||||
return true;
|
||||
}
|
||||
|
@ -138,7 +140,7 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
{
|
||||
break;
|
||||
}
|
||||
console.log('terminating...', sess.sid);
|
||||
logger.log('terminating...', sess.sid);
|
||||
sess.terminate();
|
||||
this.terminate(sess.sid);
|
||||
if ($(iq).find('>jingle>reason').length) {
|
||||
|
@ -177,7 +179,7 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
sess.removeSource($(iq).find('>jingle>content'), fromJid);
|
||||
break;
|
||||
default:
|
||||
console.warn('jingle action not implemented', action);
|
||||
logger.warn('jingle action not implemented', action);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
@ -258,8 +260,8 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
self.ice_config.iceServers = iceservers;
|
||||
},
|
||||
function (err) {
|
||||
console.warn('getting turn credentials failed', err);
|
||||
console.warn('is mod_turncredentials or similar installed?');
|
||||
logger.warn('getting turn credentials failed', err);
|
||||
logger.warn('is mod_turncredentials or similar installed?');
|
||||
}
|
||||
);
|
||||
// implement push?
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
/**
|
||||
* Moderate connection plugin.
|
||||
*/
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
|
||||
|
||||
module.exports = function (XMPP, eventEmitter) {
|
||||
|
@ -19,7 +21,7 @@ module.exports = function (XMPP, eventEmitter) {
|
|||
null);
|
||||
},
|
||||
setMute: function (jid, mute) {
|
||||
console.info("set mute", mute);
|
||||
logger.info("set mute", mute);
|
||||
var iqToFocus = $iq({to: this.connection.emuc.focusMucJid, type: 'set'})
|
||||
.c('mute', {
|
||||
xmlns: 'http://jitsi.org/jitmeet/audio',
|
||||
|
@ -31,16 +33,16 @@ module.exports = function (XMPP, eventEmitter) {
|
|||
this.connection.sendIQ(
|
||||
iqToFocus,
|
||||
function (result) {
|
||||
console.log('set mute', result);
|
||||
logger.log('set mute', result);
|
||||
},
|
||||
function (error) {
|
||||
console.log('set mute error', error);
|
||||
logger.log('set mute error', error);
|
||||
});
|
||||
},
|
||||
onMute: function (iq) {
|
||||
var from = iq.getAttribute('from');
|
||||
if (from !== this.connection.emuc.focusMucJid) {
|
||||
console.warn("Ignored mute from non focus peer");
|
||||
logger.warn("Ignored mute from non focus peer");
|
||||
return false;
|
||||
}
|
||||
var mute = $(iq).find('mute');
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* jshint -W117 */
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
|
||||
module.exports = function() {
|
||||
Strophe.addConnectionPlugin('rayo',
|
||||
{
|
||||
|
@ -14,7 +16,7 @@ module.exports = function() {
|
|||
this.onRayo.bind(this), this.RAYO_XMLNS, 'iq', 'set', null, null);
|
||||
},
|
||||
onRayo: function (iq) {
|
||||
console.info("Rayo IQ", iq);
|
||||
logger.info("Rayo IQ", iq);
|
||||
},
|
||||
dial: function (to, from, roomName, roomPass) {
|
||||
var self = this;
|
||||
|
@ -48,21 +50,21 @@ module.exports = function() {
|
|||
this.connection.sendIQ(
|
||||
req,
|
||||
function (result) {
|
||||
console.info('Dial result ', result);
|
||||
logger.info('Dial result ', result);
|
||||
|
||||
var resource = $(result).find('ref').attr('uri');
|
||||
this.call_resource = resource.substr('xmpp:'.length);
|
||||
console.info(
|
||||
logger.info(
|
||||
"Received call resource: " + this.call_resource);
|
||||
},
|
||||
function (error) {
|
||||
console.info('Dial error ', error);
|
||||
logger.info('Dial error ', error);
|
||||
}
|
||||
);
|
||||
},
|
||||
hang_up: function () {
|
||||
if (!this.call_resource) {
|
||||
console.warn("No call in progress");
|
||||
logger.warn("No call in progress");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -81,11 +83,11 @@ module.exports = function() {
|
|||
this.connection.sendIQ(
|
||||
req,
|
||||
function (result) {
|
||||
console.info('Hangup result ', result);
|
||||
logger.info('Hangup result ', result);
|
||||
self.call_resource = null;
|
||||
},
|
||||
function (error) {
|
||||
console.info('Hangup error ', error);
|
||||
logger.info('Hangup error ', error);
|
||||
self.call_resource = null;
|
||||
}
|
||||
);
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
/**
|
||||
* Strophe logger implementation. Logs from level WARN and above.
|
||||
*/
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
|
||||
module.exports = function () {
|
||||
|
||||
Strophe.log = function (level, msg) {
|
||||
switch (level) {
|
||||
case Strophe.LogLevel.WARN:
|
||||
console.warn("Strophe: " + msg);
|
||||
logger.warn("Strophe: " + msg);
|
||||
break;
|
||||
case Strophe.LogLevel.ERROR:
|
||||
case Strophe.LogLevel.FATAL:
|
||||
console.error("Strophe: " + msg);
|
||||
logger.error("Strophe: " + msg);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* global $, APP, config, Strophe*/
|
||||
|
||||
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
||||
var EventEmitter = require("events");
|
||||
var Pako = require("pako");
|
||||
var StreamEventTypes = require("../../service/RTC/StreamEventTypes");
|
||||
|
@ -100,7 +102,7 @@ XMPP.prototype._connect = function (jid, password) {
|
|||
var connectionFailed = false;
|
||||
var lastErrorMsg;
|
||||
this.connection.connect(jid, password, function (status, msg) {
|
||||
console.log('Strophe status changed to',
|
||||
logger.log('Strophe status changed to',
|
||||
Strophe.getStatusString(status), msg);
|
||||
if (status === Strophe.Status.CONNECTED) {
|
||||
if (self.options.useStunTurn) {
|
||||
|
@ -108,7 +110,7 @@ XMPP.prototype._connect = function (jid, password) {
|
|||
}
|
||||
|
||||
|
||||
console.info("My Jabber ID: " + self.connection.jid);
|
||||
logger.info("My Jabber ID: " + self.connection.jid);
|
||||
|
||||
if (password)
|
||||
authenticatedUser = true;
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
"retry": "0.6.1",
|
||||
"jssha": "1.5.0",
|
||||
"socket.io-client": "1.3.6",
|
||||
"es6-promise": "*"
|
||||
"es6-promise": "*",
|
||||
"jitsi-meet-logger": "jitsi/jitsi-meet-logger"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "11.1.x",
|
||||
|
|
Loading…
Reference in New Issue