docs: function parseStatsOldAPI (peerConnection,
                                                        prevStats,
                                                        currentStats,
                                                        completion) {
  
        /* this parses a result if there it contains the video bitrate */
        var parseVideoStats = function (result) {
              if (result.stat('googFrameRateSent')) {
                currentStats.videoSentBytes = Number(result.stat('bytesSent'));
                currentStats.videoSentPackets = Number(result.stat('packetsSent'));
                currentStats.videoSentPacketsLost = Number(result.stat('packetsLost'));
                currentStats.videoRtt = Number(result.stat('googRtt'));
                currentStats.videoFrameRate = Number(result.stat('googFrameRateInput'));
                currentStats.videoWidth = Number(result.stat('googFrameWidthSent'));
                currentStats.videoHeight = Number(result.stat('googFrameHeightSent'));
                currentStats.videoCodec = result.stat('googCodecName');
              } else if (result.stat('googFrameRateReceived')) {
                currentStats.videoRecvBytes = Number(result.stat('bytesReceived'));
                currentStats.videoRecvPackets = Number(result.stat('packetsReceived'));
                currentStats.videoRecvPacketsLost = Number(result.stat('packetsLost'));
                currentStats.videoFrameRate = Number(result.stat('googFrameRateOutput'));
                currentStats.videoWidth = Number(result.stat('googFrameWidthReceived'));
                currentStats.videoHeight = Number(result.stat('googFrameHeightReceived'));
                currentStats.videoCodec = result.stat('googCodecName');
              }
              return null;
            },
  
            parseAudioStats = function (result) {
              if (result.stat('audioInputLevel')) {
                currentStats.audioSentPackets = Number(result.stat('packetsSent'));
                currentStats.audioSentPacketsLost = Number(result.stat('packetsLost'));
                currentStats.audioSentBytes =  Number(result.stat('bytesSent'));
                currentStats.audioCodec = result.stat('googCodecName');
                currentStats.audioRtt = Number(result.stat('googRtt'));
              } else if (result.stat('audioOutputLevel')) {
                currentStats.audioRecvPackets = Number(result.stat('packetsReceived'));
                currentStats.audioRecvPacketsLost = Number(result.stat('packetsLost'));
                currentStats.audioRecvBytes =  Number(result.stat('bytesReceived'));
                currentStats.audioCodec = result.stat('googCodecName');
              }
            },
  
            parseStatsReports = function (stats) {
              if (stats.result) {
                var resultList = stats.result();
                for (var resultIndex = 0; resultIndex < resultList.length; resultIndex++) {
                  var result = resultList[resultIndex];
  
                  if (result.stat) {
  
                    if(result.stat('googActiveConnection') === 'true') {
                      currentStats.localCandidateType = result.stat('googLocalCandidateType');
                      currentStats.remoteCandidateType = result.stat('googRemoteCandidateType');
                      currentStats.transportType = result.stat('googTransportType');
                    }
  
                    parseAudioStats(result);
                    parseVideoStats(result);
                  }
                }
              }
  
              completion(null, currentStats);
            };
  
        peerConnection.getStats(parseStatsReports);
      }