Add JavaScript analytics
The system has a nice stat tracking feature. Make the frontend record everything possible about the client experiences.
http://wiki.whatwg.org/wiki/Video_Metrics https://www.w3.org/Bugs/Public/show_bug.cgi?id=12399 https://www.w3.org/Bugs/Public/show_bug.cgi?id=14310
From Jeroen Wijering (JW Player developer) back in May 2011
Grabbing the stats from the video element and periodically pinging it back to the player can indeed be done with vanilla JS. JW Player would make it easier though, since the event gathering and normalization is done for you. A logical step would be to write a small JS plugin for the player that does the actual callback. We have such plugins for e.g. Google Analytics.
Some information about jwplayer
- http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/6067/statistics-revisited/
- http://www.longtailvideo.com/support/bits-on-the-run/15976/charting-video-statistics/
- http://www.longtailvideo.com/support/jw-player/28853/connecting-google-analytics/
'''JW Player''' (using actionscript) broadcasts the following QOS ''metrics'' for both RTMP dynamic and HTTP adaptive:
- bandwidth: server-client data rate, in kilobytespersecond.
- latency: client-server-client roundtrip time, in milliseconds.
- frameDropRate: number of frames not presented to the viewer, in frames per second.
- screenWidth / screenHeight: dimensions of the video viewport, in pixels. Changes e.g. when the viewer jumps fullscreen.
- qualityLevel: index of the currently playing quality level (see below).
Bandwidth and droprate are running metrics (averaged out). Latency and dimensions are sampled (taken once). For RTMP dynamic, the metrics are broadcast at a settable interval (default 2s). For HTTP adaptive, metrics are calculated and broadcast upon completion of a fragment load.
Separately, JW Player broadcasts a ''SWITCH'' event at the painting of a frame that has a different qualityLevel than the preceding frame(s). While the ''metrics.qualityLevel'' tells developers the qualityLevel of the currently downloading buffer/fragment, the ''SWITCH'' event tells developers the exact point in time where the viewer experiences a jump in video quality. This event also helps developers correlate the value of ''frameDropRate'' to the currently playing qualityLevel (as opposed to the currently loading one). Depending upon buffer, fragment and GOP size, the time delta between a change in ''metrics.qualityLevel'' and ''SWITCH.qualityLevel'' may vary from a few seconds to a few minutes.
Finally, JW Player accepts and exposes per video an array with quality levels (the distinct streams of a video between which the player can switch). For each quality level, properties like ''bitrate'', ''framerate'', ''height'' and ''width'' are available. The plain mapping using ''qualityLevel'' works b/c JW Player to date solely supports single A/V muxed dynamic/adaptive videos - no multi track.
Also look at #44 (Should these two bugs be merged?)