openvidu-server dashboard updated

pull/30/merge
pabloFuente 2018-03-14 11:49:59 +01:00
parent da493fd12b
commit d4621422fc
3 changed files with 26 additions and 30 deletions

View File

@ -1 +1 @@
{"version":3,"sources":["webpack/bootstrap d87ad4405972368f7b26"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t\"inline\": 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d87ad4405972368f7b26"],"sourceRoot":"webpack:///"} {"version":3,"sources":["webpack/bootstrap 1f7a086378041c1af3be"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t\"inline\": 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 1f7a086378041c1af3be"],"sourceRoot":"webpack:///"}

View File

@ -2423,11 +2423,10 @@ var Session = /** @class */ (function () {
// Listens to the deactivation of the default behaviour upon the disconnection of a Session // Listens to the deactivation of the default behaviour upon the disconnection of a Session
this.session.addEventListener('session-disconnected-default', function () { this.session.addEventListener('session-disconnected-default', function () {
var s; var s;
for (var _i = 0, _a = _this.openVidu.openVidu.getRemoteStreams(); _i < _a.length; _i++) { for (var streamId in _this.session.getRemoteStreams()) {
s = _a[_i]; _this.session.getRemoteStreams()[streamId].removeVideo();
s.removeVideo();
} }
if (_this.connection) { if (_this.connection && (Object.keys(_this.connection.getStreams()).length > 0)) {
for (var streamId in _this.connection.getStreams()) { for (var streamId in _this.connection.getStreams()) {
_this.connection.getStreams()[streamId].removeVideo(); _this.connection.getStreams()[streamId].removeVideo();
} }
@ -2678,11 +2677,11 @@ var Connection = /** @class */ (function () {
Connection.prototype.addStream = function (stream) { Connection.prototype.addStream = function (stream) {
stream.connection = this; stream.connection = this;
this.streams[stream.streamId] = stream; this.streams[stream.streamId] = stream;
this.room.getStreams()[stream.streamId] = stream; //this.room.getStreams()[stream.streamId] = stream;
}; };
Connection.prototype.removeStream = function (key) { Connection.prototype.removeStream = function (key) {
delete this.streams[key]; delete this.streams[key];
delete this.room.getStreams()[key]; //delete this.room.getStreams()[key];
delete this.inboundStreamsOpts; delete this.inboundStreamsOpts;
}; };
Connection.prototype.setOptions = function (options) { Connection.prototype.setOptions = function (options) {
@ -3021,7 +3020,6 @@ var Stream_1 = __webpack_require__("../../../../openvidu-browser/lib/OpenViduInt
var RpcBuilder = __webpack_require__("../../../../openvidu-browser/lib/KurentoUtils/kurento-jsonrpc/index.js"); var RpcBuilder = __webpack_require__("../../../../openvidu-browser/lib/KurentoUtils/kurento-jsonrpc/index.js");
var OpenViduInternal = /** @class */ (function () { var OpenViduInternal = /** @class */ (function () {
function OpenViduInternal() { function OpenViduInternal() {
this.remoteStreams = [];
this.recorder = false; this.recorder = false;
} }
/* NEW METHODS */ /* NEW METHODS */
@ -3130,9 +3128,6 @@ var OpenViduInternal = /** @class */ (function () {
OpenViduInternal.prototype.getLocalStream = function () { OpenViduInternal.prototype.getLocalStream = function () {
return this.localStream; return this.localStream;
}; };
OpenViduInternal.prototype.getRemoteStreams = function () {
return this.remoteStreams;
};
/* NEW METHODS */ /* NEW METHODS */
OpenViduInternal.prototype.getWsUri = function () { OpenViduInternal.prototype.getWsUri = function () {
return this.wsUri; return this.wsUri;
@ -3368,7 +3363,7 @@ var SessionInternal = /** @class */ (function () {
function SessionInternal(openVidu, sessionId) { function SessionInternal(openVidu, sessionId) {
this.openVidu = openVidu; this.openVidu = openVidu;
this.ee = new EventEmitter(); this.ee = new EventEmitter();
this.streams = {}; this.remoteStreams = {};
this.participants = {}; this.participants = {};
this.publishersSpeaking = []; this.publishersSpeaking = [];
this.connected = false; this.connected = false;
@ -3453,7 +3448,7 @@ var SessionInternal = /** @class */ (function () {
}; };
if (_this.localParticipant) { if (_this.localParticipant) {
if (Object.keys(_this.localParticipant.getStreams()).some(function (streamId) { if (Object.keys(_this.localParticipant.getStreams()).some(function (streamId) {
return _this.streams[streamId].isDataChannelEnabled(); return _this.remoteStreams[streamId].isDataChannelEnabled();
})) { })) {
joinParams.dataChannels = true; joinParams.dataChannels = true;
} }
@ -3502,8 +3497,8 @@ var SessionInternal = /** @class */ (function () {
for (var _b = 0, _c = roomEvent.streams; _b < _c.length; _b++) { for (var _b = 0, _c = roomEvent.streams; _b < _c.length; _b++) {
var stream = _c[_b]; var stream = _c[_b];
_this.ee.emitEvent('streamCreated', [{ stream: stream }]); _this.ee.emitEvent('streamCreated', [{ stream: stream }]);
// Adding the remote stream to the OpenVidu object // Store the remote stream
_this.openVidu.getRemoteStreams().push(stream); _this.remoteStreams[stream.streamId] = stream;
} }
callback(undefined); callback(undefined);
} }
@ -3598,14 +3593,16 @@ var SessionInternal = /** @class */ (function () {
var streams = connection.getStreams(); var streams = connection.getStreams();
for (var key in streams) { for (var key in streams) {
var stream = streams[key]; var stream = streams[key];
if (!this.streams[stream.streamId]) { if (!this.remoteStreams[stream.streamId]) {
// Avoid race condition between stream.subscribe() in "onParticipantPublished" and in "joinRoom" rpc callback // Avoid race condition between stream.subscribe() in "onParticipantPublished" and in "joinRoom" rpc callback
// This condition is false if openvidu-server sends "participantPublished" event to a subscriber participant that has
// already subscribed to certain stream in the callback of "joinRoom" method
if (this.subscribeToStreams) { if (this.subscribeToStreams) {
stream.subscribe(); stream.subscribe();
} }
this.ee.emitEvent('streamCreated', [{ stream: stream }]); this.ee.emitEvent('streamCreated', [{ stream: stream }]);
// Adding the remote stream to the OpenVidu object // Store the remote stream
this.openVidu.getRemoteStreams().push(stream); this.remoteStreams[stream.streamId] = stream;
} }
} }
}; };
@ -3622,12 +3619,11 @@ var SessionInternal = /** @class */ (function () {
this.ee.emitEvent('stream-destroyed-default', [{ this.ee.emitEvent('stream-destroyed-default', [{
stream: streams[key] stream: streams[key]
}]); }]);
// Deleting the removed stream from the OpenVidu object // Deleting the remote stream
var index = this.openVidu.getRemoteStreams().indexOf(streams[key]); var streamId = streams[key].streamId;
var stream = this.openVidu.getRemoteStreams()[index]; var stream = this.remoteStreams[streamId];
stream.dispose(); stream.dispose();
this.openVidu.getRemoteStreams().splice(index, 1); delete this.remoteStreams[stream.streamId];
delete this.streams[stream.streamId];
connection.removeStream(stream.streamId); connection.removeStream(stream.streamId);
} }
} }
@ -3661,7 +3657,6 @@ var SessionInternal = /** @class */ (function () {
var _this = this; var _this = this;
var connection = this.participants[msg.name]; var connection = this.participants[msg.name];
if (connection !== undefined) { if (connection !== undefined) {
delete this.participants[msg.name];
this.ee.emitEvent('participant-left', [{ this.ee.emitEvent('participant-left', [{
connection: connection connection: connection
}]); }]);
@ -3674,11 +3669,12 @@ var SessionInternal = /** @class */ (function () {
this.ee.emitEvent('stream-destroyed-default', [{ this.ee.emitEvent('stream-destroyed-default', [{
stream: streams[key] stream: streams[key]
}]); }]);
// Deleting the removed stream from the OpenVidu object // Deleting the remote stream
var index = this.openVidu.getRemoteStreams().indexOf(streams[key]); var streamId = streams[key].streamId;
this.openVidu.getRemoteStreams().splice(index, 1); delete this.remoteStreams[streamId];
} }
connection.dispose(); connection.dispose();
delete this.participants[msg.name];
this.ee.emitEvent('connectionDestroyed', [{ this.ee.emitEvent('connectionDestroyed', [{
connection: connection connection: connection
}]); }]);
@ -3862,8 +3858,8 @@ var SessionInternal = /** @class */ (function () {
}]); }]);
} }
}; };
SessionInternal.prototype.getStreams = function () { SessionInternal.prototype.getRemoteStreams = function () {
return this.streams; return this.remoteStreams;
}; };
SessionInternal.prototype.addParticipantSpeaking = function (participantId) { SessionInternal.prototype.addParticipantSpeaking = function (participantId) {
this.publishersSpeaking.push(participantId); this.publishersSpeaking.push(participantId);

File diff suppressed because one or more lines are too long