|
|
@@ -160,9 +160,17 @@ function obtainAudioAndVideoPermissions(callback) {
|
|
160
|
160
|
['audio', 'video'],
|
|
161
|
161
|
function (avStream) {
|
|
162
|
162
|
callback(avStream);
|
|
|
163
|
+ trackUsage('localMedia', {
|
|
|
164
|
+ audio: avStream.getAudioTracks().length,
|
|
|
165
|
+ video: avStream.getVideoTracks().length
|
|
|
166
|
+ });
|
|
163
|
167
|
},
|
|
164
|
168
|
function (error) {
|
|
165
|
169
|
console.error('failed to obtain audio/video stream - stop', error);
|
|
|
170
|
+ trackUsage('localMediaError', {
|
|
|
171
|
+ media: error.media || 'video',
|
|
|
172
|
+ name : error.name
|
|
|
173
|
+ });
|
|
166
|
174
|
},
|
|
167
|
175
|
config.resolution || '360');
|
|
168
|
176
|
}
|
|
|
@@ -592,6 +600,39 @@ $(document).bind('setLocalDescription.jingle', function (event, sid) {
|
|
592
|
600
|
}
|
|
593
|
601
|
});
|
|
594
|
602
|
|
|
|
603
|
+$(document).bind('iceconnectionstatechange.jingle', function (event, sid, session) {
|
|
|
604
|
+ switch (session.peerconnection.iceConnectionState) {
|
|
|
605
|
+ case 'checking':
|
|
|
606
|
+ session.timeChecking = (new Date()).getTime();
|
|
|
607
|
+ session.firstconnect = true;
|
|
|
608
|
+ break;
|
|
|
609
|
+ case 'completed': // on caller side
|
|
|
610
|
+ case 'connected':
|
|
|
611
|
+ if (session.firstconnect) {
|
|
|
612
|
+ session.firstconnect = false;
|
|
|
613
|
+ var metadata = {};
|
|
|
614
|
+ metadata.setupTime = (new Date()).getTime() - session.timeChecking;
|
|
|
615
|
+ session.peerconnection.getStats(function (res) {
|
|
|
616
|
+ res.result().forEach(function (report) {
|
|
|
617
|
+ if (report.type == 'googCandidatePair' && report.stat('googActiveConnection') == 'true') {
|
|
|
618
|
+ metadata.localCandidateType = report.stat('googLocalCandidateType');
|
|
|
619
|
+ metadata.remoteCandidateType = report.stat('googRemoteCandidateType');
|
|
|
620
|
+
|
|
|
621
|
+ // log pair as well so we can get nice pie charts
|
|
|
622
|
+ metadata.candidatePair = report.stat('googLocalCandidateType') + ';' + report.stat('googRemoteCandidateType');
|
|
|
623
|
+
|
|
|
624
|
+ if (report.stat('googRemoteAddress').indexOf('[') === 0) {
|
|
|
625
|
+ metadata.ipv6 = true;
|
|
|
626
|
+ }
|
|
|
627
|
+ }
|
|
|
628
|
+ });
|
|
|
629
|
+ trackUsage('iceConnected', metadata);
|
|
|
630
|
+ });
|
|
|
631
|
+ }
|
|
|
632
|
+ break;
|
|
|
633
|
+ }
|
|
|
634
|
+});
|
|
|
635
|
+
|
|
595
|
636
|
$(document).bind('joined.muc', function (event, jid, info) {
|
|
596
|
637
|
updateRoomUrl(window.location.href);
|
|
597
|
638
|
document.getElementById('localNick').appendChild(
|