docs: function parseStatsOTPlugin (peerConnection,
                                                        prevStats,
                                                        currentStats,
                                                        completion) {
  
        var onStatsError = function onStatsError (error) {
              completion(error);
            },
  
            ///
            // From the Audio Tracks
            // * avgAudioBitrate
            // * audioBytesTransferred
            //
            parseAudioStats = function (statsReport) {
              var lastBytesSent = prevStats.audioBytesTransferred || 0,
                  transferDelta;
  
              if (statsReport.audioInputLevel) {
                currentStats.audioSentBytes = Number(statsReport.bytesSent);
                currentStats.audioSentPackets = Number(statsReport.packetsSent);
                currentStats.audioSentPacketsLost = Number(statsReport.packetsLost);
                currentStats.audioRtt = Number(statsReport.googRtt);
                currentStats.audioCodec = statsReport.googCodecName;
              }
              else if (statsReport.audioOutputLevel) {
                currentStats.audioBytesTransferred = Number(statsReport.bytesReceived);
                currentStats.audioCodec = statsReport.googCodecName;
              }
  
              if (currentStats.audioBytesTransferred) {
                transferDelta = currentStats.audioBytesTransferred - lastBytesSent;
                currentStats.avgAudioBitrate = Math.round(transferDelta * 8 /
                  (currentStats.period/1000));
              }
            },
  
            ///
            // From the Video Tracks
            // * frameRate
            // * avgVideoBitrate
            // * videoBytesTransferred
            //
            parseVideoStats = function (statsReport) {
  
              var lastBytesSent = prevStats.videoBytesTransferred || 0,
                  transferDelta;
  
              if (statsReport.googFrameHeightSent) {
                currentStats.videoSentBytes = Number(statsReport.bytesSent);
                currentStats.videoSentPackets = Number(statsReport.packetsSent);
                currentStats.videoSentPacketsLost = Number(statsReport.packetsLost);
                currentStats.videoRtt = Number(statsReport.googRtt);
                currentStats.videoCodec = statsReport.googCodecName;
                currentStats.videoWidth = Number(statsReport.googFrameWidthSent);
                currentStats.videoHeight = Number(statsReport.googFrameHeightSent);
              }
              else if (statsReport.googFrameHeightReceived) {
                currentStats.videoRecvBytes =   Number(statsReport.bytesReceived);
                currentStats.videoRecvPackets = Number(statsReport.packetsReceived);
                currentStats.videoRecvPacketsLost = Number(statsReport.packetsLost);
                currentStats.videoRtt = Number(statsReport.googRtt);
                currentStats.videoCodec = statsReport.googCodecName;
                currentStats.videoWidth = Number(statsReport.googFrameWidthReceived);
                currentStats.videoHeight = Number(statsReport.googFrameHeightReceived);
              }
  
              if (currentStats.videoBytesTransferred) {
                transferDelta = currentStats.videoBytesTransferred - lastBytesSent;
                currentStats.avgVideoBitrate = Math.round(transferDelta * 8 /
                 (currentStats.period/1000));
              }
  
              if (statsReport.googFrameRateSent) {
                currentStats.videoFrameRate = Number(statsReport.googFrameRateSent);
              } else if (statsReport.googFrameRateReceived) {
                currentStats.videoFrameRate = Number(statsReport.googFrameRateReceived);
              }
            },
  
            isStatsForVideoTrack = function(statsReport) {
              return statsReport.googFrameHeightSent !== void 0 ||
                      statsReport.googFrameHeightReceived !== void 0 ||
                      currentStats.videoBytesTransferred !== void 0 ||
                      statsReport.googFrameRateSent !== void 0;
            },
  
            isStatsForIceCandidate = function(statsReport) {
              return statsReport.googActiveConnection === 'true';
            };
  
        peerConnection.getStats(null, function(statsReports) {
          statsReports.forEach(function(statsReport) {
            if (isStatsForIceCandidate(statsReport)) {
              currentStats.localCandidateType = statsReport.googLocalCandidateType;
              currentStats.remoteCandidateType = statsReport.googRemoteCandidateType;
              currentStats.transportType = statsReport.googTransportType;
            }
            else if (isStatsForVideoTrack(statsReport)) {
              parseVideoStats(statsReport);
            }
            else {
              parseAudioStats(statsReport);
            }
          });
  
          completion(null, currentStats);
        }, onStatsError);
      }