Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JavaScript analytics #12

Open
mithro opened this issue Mar 11, 2012 · 4 comments
Open

Add JavaScript analytics #12

mithro opened this issue Mar 11, 2012 · 4 comments
Labels

Comments

@mithro
Copy link
Member

mithro commented Mar 11, 2012

The system has a nice stat tracking feature. Make the frontend record everything possible about the client experiences.

@mithro
Copy link
Member Author

mithro commented Mar 16, 2014

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.

@mithro
Copy link
Member Author

mithro commented Mar 16, 2014

'''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.

@mithro
Copy link
Member Author

mithro commented Mar 16, 2014

Also look at #44
(Should these two bugs be merged?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant