.showStats() API

1
peer5.showStats();

Peer5 provides live visualization of playback (Such as FPS & rebuffers count) & traffic (Such as download speeds) statistics right on top of the player.
This API is useful for debugging purposes of the Peer5 integration, as it shows both HTTP & P2P statistics.

Using the API

The API itself is really simple. A single call to peer5.showStats() will enable the visualization which will show up on top of the player, like in the image below:

Lets go over the stats shows in the box:

  1. # of Rebuffer - Number of times the playback stalled for rebuffering.
  2. FPS (actual/video) - The number on the right side is the frame rate of the video source, and the number on the left is the actual frame rate being played. If the actual number is lower, it means frame processing is too slow and frames are being dropped.
  3. Frames (drop/total) - The number on the right side is the total number of frames played, and the number of the left is the number of frames dropped (Weren't played).
  4. HTTP Speed - The HTTP download speed.
  5. P2P Speed - The P2P download speed.
  6. Peers - The number of peers you are currently connected to.
  7. Render Method - The video rendering method. Can be one of "HTML5" or "Flash".
  8. Total HTTP Downloaded - The total number of bytes that were downloaded through HTTP.
  9. Total P2P (%) - The percentage of P2P out of the total bytes downloaded (From both HTTP & P2P).
  10. Total P2P Downloaded - The total number of bytes that were downloaded through P2P.

Below the stats you will see a live chart showing the HTTP & P2P speed over the past 1 minute.