' + data.url + ' ' + data.rtcConfiguration + ' ' + data.constraints + '
'; return peerConnectionElement; } /** * Adds a peer connection update. * * @param {!PeerConnectionUpdateEntry} data The peer connection update data. */ function updatePeerConnection(data) { var peerConnectionElement = $(getPeerConnectionId(data)); addPeerConnectionUpdate(peerConnectionElement, data); } /** * Adds the information of all peer connections created so far. * * @param {Array.} data An array of the information of all peer * connections. Each array item contains pid, lid, url, rtcConfiguration, * constraints, and an array of updates as the log. */ function updateAllPeerConnections(data) { for (var i = 0; i < data.length; ++i) { var peerConnection = addPeerConnection(data[i]); var log = data[i].log; if (!log) continue; for (var j = 0; j < log.length; ++j) { addPeerConnectionUpdate(peerConnection, log[j]); } } requestStats(); } /** * Handles the report of stats. * * @param {!Object} data The object containing pid, lid, and reports, where * reports is an array of stats reports. Each report contains id, type, * and stats, where stats is the object containing timestamp and values, * which is an array of strings, whose even index entry is the name of the * stat, and the odd index entry is the value. */ function addStats(data) { var peerConnectionElement = $(getPeerConnectionId(data)); if (!peerConnectionElement) return; for (var i = 0; i < data.reports.length; ++i) { var report = data.reports[i]; statsTable.addStatsReport(peerConnectionElement, report); drawSingleReport(peerConnectionElement, report); } } /** * Adds a getUserMedia request. * * @param {!Object} data The object containing rid {number}, pid {number}, * origin {string}, audio {string}, video {string}. */ function addGetUserMedia(data) { userMediaRequests.push(data); if (!$(USER_MEDIA_TAB_ID)) { tabView.addTab(USER_MEDIA_TAB_ID, 'GetUserMedia Requests'); } var requestDiv = document.createElement('div'); requestDiv.className = 'user-media-request-div-class'; requestDiv.rid = data.rid; $(USER_MEDIA_TAB_ID).appendChild(requestDiv); appendChildWithText(requestDiv, 'div', 'Caller origin: ' + data.origin); appendChildWithText(requestDiv, 'div', 'Caller process id: ' + data.pid); appendChildWithText(requestDiv, 'span', 'Audio Constraints').style.fontWeight = 'bold'; appendChildWithText(requestDiv, 'div', data.audio); appendChildWithText(requestDiv, 'span', 'Video Constraints').style.fontWeight = 'bold'; appendChildWithText(requestDiv, 'div', data.video); } /** * Removes the getUserMedia requests from the specified |rid|. * * @param {!Object} data The object containing rid {number}, the render id. */ function removeGetUserMediaForRenderer(data) { for (var i = userMediaRequests.length - 1; i >= 0; --i) { if (userMediaRequests[i].rid == data.rid) userMediaRequests.splice(i, 1); } var requests = $(USER_MEDIA_TAB_ID).childNodes; for (var i = 0; i < requests.length; ++i) { if (requests[i].rid == data.rid) $(USER_MEDIA_TAB_ID).removeChild(requests[i]); } if ($(USER_MEDIA_TAB_ID).childNodes.length == 0) tabView.removeTab(USER_MEDIA_TAB_ID); } /** * Notification that the AEC recording file selection dialog was cancelled, * i.e. AEC has not been enabled. */ function aecRecordingFileSelectionCancelled() { dumpCreator.disableAecRecording(); } /** * Set */ function enableAecRecording() { dumpCreator.enableAecRecording(); }